ata: libahci: replace obsolete simple_strtoul() with kstrtouint()
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 19 Feb 2014 23:28:45 +0000 (08:28 +0900)
committerTejun Heo <tj@kernel.org>
Thu, 20 Feb 2014 00:07:55 +0000 (19:07 -0500)
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libahci.c

index 0cff1167c83cf3569c33e1f2e1c82eaff83e4603..956851f0d44f91ca4b56c9fccb6eee005304c3f4 100644 (file)
@@ -1031,12 +1031,13 @@ static ssize_t ahci_led_show(struct ata_port *ap, char *buf)
 static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
                                size_t size)
 {
-       int state;
+       unsigned int state;
        int pmp;
        struct ahci_port_priv *pp = ap->private_data;
        struct ahci_em_priv *emp;
 
-       state = simple_strtoul(buf, NULL, 0);
+       if (kstrtouint(buf, 0, &state) < 0)
+               return -EINVAL;
 
        /* get the slot number from the message */
        pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8;