summaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 12:15:11 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-23 02:29:57 +0200
commit926c5402c287f6d911f7d00f936f09ea00880527 (patch)
tree82885b3dd11e486a47a1b84fe36ef214269f0f96 /drivers/pcmcia
parent69ba44331e81e4a15b504175ec70b7b4b4e5a8b9 (diff)
downloadop-kernel-dev-926c5402c287f6d911f7d00f936f09ea00880527.zip
op-kernel-dev-926c5402c287f6d911f7d00f936f09ea00880527.tar.gz
pcmcia: deprecate CS_BAD_ARGS
CS_BAD_ARGS mean a badly written driver or invalid userspace ioctl access, so translate that to -EINVAL. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c1
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c8
-rw-r--r--drivers/pcmcia/pcmcia_resource.c10
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 3ccf409..5b24938 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -78,7 +78,6 @@ static const lookup_t error_table[] = {
{ -EIO, "Input/Output error" },
{ -ENODEV, "No card present" },
{ -EINVAL, "Bad parameter" },
- { CS_BAD_ARGS, "Bad arguments" },
{ -EACCES, "Configuration locked" },
{ -EBUSY, "Resource in use" },
{ -ENOSPC, "No more items" },
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 9956313..f2352c2 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -836,7 +836,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
case DS_GET_CONFIGURATION_INFO:
if (buf->config.Function &&
(buf->config.Function >= s->functions))
- ret = CS_BAD_ARGS;
+ ret = -EINVAL;
else {
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
ret = pccard_get_configuration_info(s, p_dev, &buf->config);
@@ -867,7 +867,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
case DS_GET_STATUS:
if (buf->status.Function &&
(buf->status.Function >= s->functions))
- ret = CS_BAD_ARGS;
+ ret = -EINVAL;
else {
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
ret = pccard_get_status(s, p_dev, &buf->status);
@@ -898,7 +898,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
goto free_out;
}
- ret = CS_BAD_ARGS;
+ ret = -EINVAL;
if (!(buf->conf_reg.Function &&
(buf->conf_reg.Function >= s->functions))) {
@@ -970,7 +970,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
case -ENOSYS:
err = ret;
break;
- case CS_BAD_ARGS: case CS_BAD_TUPLE:
+ case CS_BAD_TUPLE:
err = -EINVAL; break;
case -ENOMEM:
err = -ENOSPC; break;
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index fee5713..de13c42 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -189,7 +189,7 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
pcmcia_write_cis_mem(s, 1, addr, 1, &val);
break;
default:
- return CS_BAD_ARGS;
+ return -EINVAL;
break;
}
return 0;
@@ -401,7 +401,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
(c->io.NumPorts1 != req->NumPorts1) ||
(c->io.BasePort2 != req->BasePort2) ||
(c->io.NumPorts2 != req->NumPorts2))
- return CS_BAD_ARGS;
+ return -EINVAL;
c->state &= ~CONFIG_IO_REQ;
@@ -855,8 +855,10 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
if (req->Attributes & WIN_USE_WAIT)
win->ctl.flags |= MAP_USE_WAIT;
win->ctl.card_start = 0;
- if (s->ops->set_mem_map(s, &win->ctl) != 0)
- return CS_BAD_ARGS;
+ if (s->ops->set_mem_map(s, &win->ctl) != 0) {
+ ds_dbg(s, 0, "failed to set memory mapping\n");
+ return -EIO;
+ }
s->state |= SOCKET_WIN_REQ(w);
/* Return window handle */
OpenPOWER on IntegriCloud