summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 12:47:59 +0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-23 04:29:41 +0400
commitde6405e9d1e7530ea33b62e1a3921338f836a046 (patch)
tree4952537154518b48875bd126b3ac165ed4eb9198
parent1168386aa7d850ead2ae135d5a7949a592c6e9a0 (diff)
downloadlinux-de6405e9d1e7530ea33b62e1a3921338f836a046.tar.xz
pcmcia: deprecate CS_UNSUPPORTED_*
CS_UNSUPPORTED_MODE and CS_UNSUPPORTED_FUNCTION were mostly used to denote trying to use PCMCIA functions on CardBus cards. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--drivers/pcmcia/cistpl.c2
-rw-r--r--drivers/pcmcia/cs.c6
-rw-r--r--drivers/pcmcia/ds.c3
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c4
-rw-r--r--drivers/pcmcia/pcmcia_resource.c8
-rw-r--r--include/pcmcia/cs.h4
6 files changed, 14 insertions, 13 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 8d37768d0b46..71231e8c7edd 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1397,7 +1397,7 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse)
ret = 0;
break;
default:
- ret = CS_UNSUPPORTED_FUNCTION;
+ ret = -EINVAL;
break;
}
return ret;
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 037cb0c7e094..e847c3231da8 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -769,7 +769,7 @@ int pccard_reset_card(struct pcmcia_socket *skt)
break;
}
if (skt->state & SOCKET_CARDBUS) {
- ret = CS_UNSUPPORTED_FUNCTION;
+ ret = -EPERM;
break;
}
@@ -810,7 +810,7 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt)
break;
}
if (skt->state & SOCKET_CARDBUS) {
- ret = CS_UNSUPPORTED_FUNCTION;
+ ret = -EPERM;
break;
}
if (skt->callback) {
@@ -840,7 +840,7 @@ int pcmcia_resume_card(struct pcmcia_socket *skt)
break;
}
if (skt->state & SOCKET_CARDBUS) {
- ret = CS_UNSUPPORTED_FUNCTION;
+ ret = -EPERM;
break;
}
ret = socket_resume(skt);
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 7142fd647e7b..4a658e2b6f21 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -85,8 +85,7 @@ static const lookup_t error_table[] = {
{ CS_BAD_VCC, "Bad Vcc" },
{ CS_BAD_VPP, "Bad Vpp" },
{ CS_NO_CARD, "No card present" },
- { CS_UNSUPPORTED_FUNCTION, "Usupported function" },
- { CS_UNSUPPORTED_MODE, "Unsupported mode" },
+ { -EINVAL, "Bad parameter" },
{ CS_GENERAL_FAILURE, "General failure" },
{ CS_BAD_ARGS, "Bad arguments" },
{ CS_CONFIGURATION_LOCKED, "Configuration locked" },
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index ef64ceb5e751..40bef470b47c 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -175,7 +175,7 @@ static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) {
static int pcmcia_adjust_resource_info(adjust_t *adj)
{
struct pcmcia_socket *s;
- int ret = CS_UNSUPPORTED_FUNCTION;
+ int ret = -ENOSYS;
unsigned long flags;
down_read(&pcmcia_socket_list_rwsem);
@@ -975,7 +975,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
err = -ENOSPC; break;
case CS_NO_MORE_ITEMS:
err = -ENODATA; break;
- case CS_UNSUPPORTED_FUNCTION:
+ case -ENOSYS:
err = -ENOSYS; break;
default:
err = -EIO; break;
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 69d87a7e0766..3b8b0e14d8cf 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -475,8 +475,10 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
if (!(s->state & SOCKET_PRESENT))
return CS_NO_CARD;
- if (req->IntType & INT_CARDBUS)
- return CS_UNSUPPORTED_MODE;
+ if (req->IntType & INT_CARDBUS) {
+ ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n");
+ return -EINVAL;
+ }
c = p_dev->function_config;
if (c->state & CONFIG_LOCKED)
return CS_CONFIGURATION_LOCKED;
@@ -592,7 +594,7 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
return CS_NO_CARD;
if (!req)
- return CS_UNSUPPORTED_MODE;
+ return -EINVAL;
c = p_dev->function_config;
if (c->state & CONFIG_LOCKED)
return CS_CONFIGURATION_LOCKED;
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 9e6916c1fa81..6b51d27ddae8 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -305,8 +305,8 @@ typedef struct error_info_t {
#define CS_BAD_WINDOW -ENODEV
#define CS_WRITE_FAILURE -EIO
#define CS_NO_CARD 0x14
-#define CS_UNSUPPORTED_FUNCTION 0x15
-#define CS_UNSUPPORTED_MODE 0x16
+#define CS_UNSUPPORTED_FUNCTION -ENODEV
+#define CS_UNSUPPORTED_MODE -ENODEV
#define CS_BAD_SPEED -ENODEV
#define CS_BUSY -ENODEV
#define CS_GENERAL_FAILURE 0x19