Commit 78aee651 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: cdev: fix return values

This patch makes use of the proper return values when reporting
an error to the caller.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1592815695-19305-6-git-send-email-christian.gromm@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e8e0f7fd
...@@ -326,7 +326,7 @@ static int comp_disconnect_channel(struct most_interface *iface, int channel_id) ...@@ -326,7 +326,7 @@ static int comp_disconnect_channel(struct most_interface *iface, int channel_id)
c = get_channel(iface, channel_id); c = get_channel(iface, channel_id);
if (!c) if (!c)
return -ENXIO; return -EINVAL;
mutex_lock(&c->io_mutex); mutex_lock(&c->io_mutex);
spin_lock(&c->unlink); spin_lock(&c->unlink);
...@@ -360,7 +360,7 @@ static int comp_rx_completion(struct mbo *mbo) ...@@ -360,7 +360,7 @@ static int comp_rx_completion(struct mbo *mbo)
c = get_channel(mbo->ifp, mbo->hdm_channel_id); c = get_channel(mbo->ifp, mbo->hdm_channel_id);
if (!c) if (!c)
return -ENXIO; return -EINVAL;
spin_lock(&c->unlink); spin_lock(&c->unlink);
if (!c->access_ref || !c->dev) { if (!c->access_ref || !c->dev) {
...@@ -390,7 +390,7 @@ static int comp_tx_completion(struct most_interface *iface, int channel_id) ...@@ -390,7 +390,7 @@ static int comp_tx_completion(struct most_interface *iface, int channel_id)
c = get_channel(iface, channel_id); c = get_channel(iface, channel_id);
if (!c) if (!c)
return -ENXIO; return -EINVAL;
if ((channel_id < 0) || (channel_id >= iface->num_channels)) { if ((channel_id < 0) || (channel_id >= iface->num_channels)) {
dev_warn(c->dev, "Channel ID out of range\n"); dev_warn(c->dev, "Channel ID out of range\n");
......
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