summaryrefslogtreecommitdiff
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2020-05-05 12:00:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-05 12:17:59 +0200
commit441be56f894d5f31e0747c35bbfb4784aa3b958a (patch)
treedc632e6e89d716103777647c1fccd6670215ac08 /drivers/staging/most
parent3e8621aba71ad7b381699cf5119a779bc61e341d (diff)
staging: most: usb: use EINVAL error code
This patch replaces the error code EIO with EINVAL, when there is no IO happening. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Link: https://lore.kernel.org/r/1588672829-28883-3-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index 9527e3162516..1087ad9c0038 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -274,13 +274,13 @@ static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
unsigned int j, num_frames;
if (!frame_size)
- return -EIO;
+ return -EINVAL;
num_frames = mbo->buffer_length / frame_size;
if (num_frames < 1) {
dev_err(&mdev->usb_device->dev,
"Missed minimal transfer unit.\n");
- return -EIO;
+ return -EINVAL;
}
for (j = num_frames - 1; j > 0; j--)
@@ -308,7 +308,7 @@ static int hdm_remove_padding(struct most_dev *mdev, int channel,
unsigned int j, num_frames;
if (!frame_size)
- return -EIO;
+ return -EINVAL;
num_frames = mbo->processed_length / USB_MTU;
for (j = 1; j < num_frames; j++)
@@ -556,7 +556,7 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
void *virt_address;
if (unlikely(!mbo))
- return -EIO;
+ return -EINVAL;
if (unlikely(iface->num_channels <= channel || channel < 0))
return -ECHRNG;
@@ -577,7 +577,7 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
if ((conf->direction & MOST_CH_TX) && mdev->padding_active[channel] &&
hdm_add_padding(mdev, channel, mbo)) {
- retval = -EIO;
+ retval = -EINVAL;
goto err_free_urb;
}