diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2020-05-27 11:06:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-27 12:26:13 +0200 |
commit | f470a5b01bab175dc14ac078ffe1130ae975a6fd (patch) | |
tree | 10926b23da2dbb74f7b6336e6bef459afc5ca8f7 /drivers/staging/most | |
parent | 1fd4fb8c62d34db0d82bbb948b4cfd006c9256fb (diff) |
staging: most: usb: use correct error codes
This patch uses the -EINVAL return code where -EFAULT is wrongly being
used.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1590570387-27069-9-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/usb/usb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c index 468aabfc7c4f..3575a4028039 100644 --- a/drivers/staging/most/usb/usb.c +++ b/drivers/staging/most/usb/usb.c @@ -813,7 +813,7 @@ static int get_stat_reg_addr(const struct regs *regs, int size, return 0; } } - return -EFAULT; + return -EINVAL; } #define get_static_reg_addr(regs, name, reg_addr) \ @@ -835,7 +835,7 @@ static ssize_t value_show(struct device *dev, struct device_attribute *attr, reg_addr = dci_obj->reg_addr; else if (get_static_reg_addr(ro_regs, name, ®_addr) && get_static_reg_addr(rw_regs, name, ®_addr)) - return -EFAULT; + return -EINVAL; err = drci_rd_reg(dci_obj->usb_device, reg_addr, &val); if (err < 0) @@ -870,7 +870,7 @@ static ssize_t value_store(struct device *dev, struct device_attribute *attr, else if (!get_static_reg_addr(rw_regs, name, ®_addr)) err = drci_wr_reg(usb_dev, reg_addr, val); else - return -EFAULT; + return -EINVAL; if (err < 0) return err; |