[PATCH 5/6] USB: serial: ftdi_sio: replace simple_strtoul() calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace the obsolete simple_strtoul() calls with kstrtouint() calls.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/usb/serial/ftdi_sio.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 2662fc3b49c5..e6785d84280b 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1713,9 +1713,13 @@ static ssize_t latency_timer_store(struct device *dev,
 {
 	struct usb_serial_port *port = to_usb_serial_port(dev);
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
-	int v = simple_strtoul(valbuf, NULL, 10);
+	unsigned int v;
 	int rv;
 
+	rv = kstrtouint(valbuf, 10, &v);
+	if (rv)
+		return rv;
+
 	if (v < 1 || v > 255)
 		return -EINVAL;
 
@@ -1735,10 +1739,14 @@ static ssize_t store_event_char(struct device *dev,
 	struct usb_serial_port *port = to_usb_serial_port(dev);
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	struct usb_device *udev = port->serial->dev;
-	int v = simple_strtoul(valbuf, NULL, 10);
+	unsigned int v;
 	int rv;
 
-	if (v < 0 || v >= 0x200)
+	rv = kstrtouint(valbuf, 10, &v);
+	if (rv)
+		return rv;
+
+	if (v >= 0x200)
 		return -EINVAL;
 
 	dev_dbg(&port->dev, "%s: setting event char = %i\n", __func__, v);
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux