Commit 025d0dfc authored by Andy Shevchenko's avatar Andy Shevchenko Committed by David S. Miller

s390/qeth: use kstrtobool() in qeth_bridgeport_hostnotification_store()

The sysfs enabled value is a boolean, so kstrtobool() is a better fit
for parsing the input string since it does the range checking for us.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ed2e93ef
...@@ -146,18 +146,15 @@ static ssize_t qeth_bridgeport_hostnotification_store(struct device *dev, ...@@ -146,18 +146,15 @@ static ssize_t qeth_bridgeport_hostnotification_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct qeth_card *card = dev_get_drvdata(dev); struct qeth_card *card = dev_get_drvdata(dev);
int rc = 0; bool enable;
int enable; int rc;
if (!card) if (!card)
return -EINVAL; return -EINVAL;
if (sysfs_streq(buf, "0")) rc = kstrtobool(buf, &enable);
enable = 0; if (rc)
else if (sysfs_streq(buf, "1")) return rc;
enable = 1;
else
return -EINVAL;
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment