Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6bed035 authored by Chase Southwood's avatar Chase Southwood Committed by Greg Kroah-Hartman
Browse files

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: default avatarChase Southwood <chase.southwood@yahoo.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60800abd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;