diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-05-06 11:09:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-07 00:11:26 +0300 |
commit | 7005b7547680963ad127c5069c6be082272105bc (patch) | |
tree | a0db2e7c204ee040d07cf61ee39a0a4b270a75d1 /drivers/s390/net/qeth_core_sys.c | |
parent | 6ee091efa7b59829448d0f9287ea62c1f448a318 (diff) | |
download | linux-7005b7547680963ad127c5069c6be082272105bc.tar.xz |
s390/qeth: return error when starting a reset fails
When starting the reset worker via sysfs is unsuccessful, return an
error to the user.
Modernize the sysfs input parsing while at it.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_sys.c')
-rw-r--r-- | drivers/s390/net/qeth_core_sys.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index d7e429f6631e..c901c942fed7 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c @@ -275,17 +275,20 @@ static ssize_t qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev_get_drvdata(dev); - char *tmp; - int i; + bool reset; + int rc; + + rc = kstrtobool(buf, &reset); + if (rc) + return rc; if (!qeth_card_hw_is_reachable(card)) return -EPERM; - i = simple_strtoul(buf, &tmp, 16); - if (i == 1) - qeth_schedule_recovery(card); + if (reset) + rc = qeth_schedule_recovery(card); - return count; + return rc ? rc : count; } static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store); |