Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint()

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>
This commit is contained in:
Chase Southwood 2014-02-14 21:59:40 -06:00 committed by Greg Kroah-Hartman
parent 60800abdc1
commit e6bed035ca
1 changed files with 2 additions and 1 deletions

View 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;