Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint()
authorChase Southwood <chase.southwood@yahoo.com>
Sat, 15 Feb 2014 03:59:40 +0000 (21:59 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Feb 2014 20:42:41 +0000 (12:42 -0800)
Since simple_strtoul() has been deprecated, replace it with kstrtouint().
Also, since return code checking for this new function is enforced, add a
check to ensure that the conversion has succeeded.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/kcomedilib/kcomedilib_main.c

index 7dc5a18e69d42bd4bd8e9df3d2458d368f769753..8777f958c04145e2a9228918a35c89518393bfb5 100644 (file)
@@ -41,7 +41,8 @@ struct comedi_device *comedi_open(const char *filename)
        if (strncmp(filename, "/dev/comedi", 11) != 0)
                return NULL;
 
-       minor = simple_strtoul(filename + 11, NULL, 0);
+       if (kstrtouint(filename + 11, 0, &minor))
+               return NULL;
 
        if (minor >= COMEDI_NUM_BOARD_MINORS)
                return NULL;