Commit 3ec6080e authored by Ralph Loader's avatar Ralph Loader Committed by Greg Kroah-Hartman

staging: Fix some incorrect use of positive error codes.

Use -E... instead of just E... in a few places where negative error
codes are expected by a functions callers.  These were found by grepping
with coccinelle & then inspecting by hand to determine which were bugs.

The staging/cxt1e1 driver appears to intentionally use positive E...
error codes in some places, and negative -E... error codes in others,
making it hard to know which is intended where - very likely I missed
some problems in that driver.
Signed-off-by: default avatarRalph Loader <suckfish@ihug.co.nz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 01ebd764
......@@ -440,7 +440,7 @@ ar6000_ioctl_set_rssi_threshold(struct net_device *dev, struct ifreq *rq)
if (ar->rssi_map[j+1].rssi < ar->rssi_map[j].rssi) {
SWAP_THOLD(ar->rssi_map[j+1], ar->rssi_map[j]);
} else if (ar->rssi_map[j+1].rssi == ar->rssi_map[j].rssi) {
return EFAULT;
return -EFAULT;
}
}
}
......@@ -449,7 +449,7 @@ ar6000_ioctl_set_rssi_threshold(struct net_device *dev, struct ifreq *rq)
if (ar->rssi_map[j+1].rssi < ar->rssi_map[j].rssi) {
SWAP_THOLD(ar->rssi_map[j+1], ar->rssi_map[j]);
} else if (ar->rssi_map[j+1].rssi == ar->rssi_map[j].rssi) {
return EFAULT;
return -EFAULT;
}
}
}
......@@ -2870,7 +2870,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
gpio_output_set_cmd.enable_mask,
gpio_output_set_cmd.disable_mask);
if (ret != A_OK) {
ret = EIO;
ret = -EIO;
}
}
up(&ar->arSem);
......@@ -2950,7 +2950,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
gpio_register_cmd.gpioreg_id,
gpio_register_cmd.value);
if (ret != A_OK) {
ret = EIO;
ret = -EIO;
}
/* Wait for acknowledgement from Target */
......@@ -3041,7 +3041,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
} else {
ret = ar6000_gpio_intr_ack(dev, gpio_intr_ack_cmd.ack_mask);
if (ret != A_OK) {
ret = EIO;
ret = -EIO;
}
}
up(&ar->arSem);
......
......@@ -1368,7 +1368,7 @@ wl_iw_iscan_set_scan(struct net_device *dev,
if (g_scan_specified_ssid) {
WL_TRACE("%s Specific SCAN already running ignoring BC scan\n",
__func__);
return EBUSY;
return -EBUSY;
}
memset(&ssid, 0, sizeof(ssid));
......
......@@ -548,7 +548,7 @@ do_set_port (struct net_device * ndev, void *data)
return -EINVAL; /* get card info */
if (pp.portnum >= ci->max_port) /* sanity check */
return ENXIO;
return -ENXIO;
memcpy (&ci->port[pp.portnum].p, &pp, sizeof (struct sbecom_port_param));
return mkret (c4_set_port (ci, pp.portnum));
......
......@@ -389,7 +389,7 @@ EXPORT_SYMBOL(cyasdevice_gethaltag);
static int __init cyasdevice_init(void)
{
if (cyasdevice_initialize() != 0)
return ENODEV;
return -ENODEV;
return 0;
}
......
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