diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-01-20 17:44:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-24 18:12:58 +0100 |
commit | 7159deb7622741efc1730ffb24df707384db73bb (patch) | |
tree | 2440387ba767f8a6abe43d2ad1fad6613138e3f9 /drivers/usb/fotg210 | |
parent | 861fa1c3fafffe47e6845ce95c847b2422792fcc (diff) | |
download | lwn-7159deb7622741efc1730ffb24df707384db73bb.tar.gz lwn-7159deb7622741efc1730ffb24df707384db73bb.zip |
usb: fotg210-hcd: Don't shadow error codes in store()
kstrtox() along with regmap API can return different error codes based on
circumstances.
Don't shadow them when returning to the caller.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230120154437.22025-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/fotg210')
-rw-r--r-- | drivers/usb/fotg210/fotg210-hcd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c index 46752a75c428..5a934f5343a7 100644 --- a/drivers/usb/fotg210/fotg210-hcd.c +++ b/drivers/usb/fotg210/fotg210-hcd.c @@ -4702,8 +4702,10 @@ static ssize_t uframe_periodic_max_store(struct device *dev, ssize_t ret; fotg210 = hcd_to_fotg210(bus_to_hcd(dev_get_drvdata(dev))); - if (kstrtouint(buf, 0, &uframe_periodic_max) < 0) - return -EINVAL; + + ret = kstrtouint(buf, 0, &uframe_periodic_max); + if (ret) + return ret; if (uframe_periodic_max < 100 || uframe_periodic_max >= 125) { fotg210_info(fotg210, "rejecting invalid request for uframe_periodic_max=%u\n", |