summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 11:10:56 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-23 02:29:43 +0200
commit3939c1ef1f954409d1441c09fbc08376655758fe (patch)
treea66c10593b8b47a1a63471dd6fc6f9fb214063ca /drivers
parentd8b0a49da4f213c637d458319432016f4ea5e12a (diff)
downloadlinux-3939c1ef1f954409d1441c09fbc08376655758fe.tar.bz2
pcmcia: deprecate CS_NO_CARD
It means that no card can be detected in the socket, so return -ENODEV Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/cistpl.c4
-rw-r--r--drivers/pcmcia/cs.c16
-rw-r--r--drivers/pcmcia/ds.c2
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c4
-rw-r--r--drivers/pcmcia/pcmcia_resource.c14
5 files changed, 20 insertions, 20 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 71231e8c7edd..a0eae81731c5 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -427,7 +427,7 @@ int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple
if (!s)
return CS_BAD_HANDLE;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
tuple->TupleLink = tuple->Flags = 0;
#ifdef CONFIG_CARDBUS
if (s->state & SOCKET_CARDBUS) {
@@ -507,7 +507,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
if (!s)
return CS_BAD_HANDLE;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
link[1] = tuple->TupleLink;
ofs = tuple->CISOffset + tuple->TupleLink;
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index e847c3231da8..15a1203d45fb 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -367,7 +367,7 @@ static int socket_reset(struct pcmcia_socket *skt)
skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT))
- return CS_NO_CARD;
+ return -ENODEV;
if (status & SS_READY)
return 0;
@@ -428,14 +428,14 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT))
- return CS_NO_CARD;
+ return -ENODEV;
msleep(initial_delay * 10);
for (i = 0; i < 100; i++) {
skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT))
- return CS_NO_CARD;
+ return -ENODEV;
if (!(status & SS_PENDING))
break;
@@ -504,7 +504,7 @@ static int socket_insert(struct pcmcia_socket *skt)
cs_dbg(skt, 4, "insert\n");
if (!cs_socket_get(skt))
- return CS_NO_CARD;
+ return -ENODEV;
ret = socket_setup(skt, setup_delay);
if (ret == 0) {
@@ -761,7 +761,7 @@ int pccard_reset_card(struct pcmcia_socket *skt)
mutex_lock(&skt->skt_mutex);
do {
if (!(skt->state & SOCKET_PRESENT)) {
- ret = CS_NO_CARD;
+ ret = -ENODEV;
break;
}
if (skt->state & SOCKET_SUSPEND) {
@@ -806,7 +806,7 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt)
mutex_lock(&skt->skt_mutex);
do {
if (!(skt->state & SOCKET_PRESENT)) {
- ret = CS_NO_CARD;
+ ret = -ENODEV;
break;
}
if (skt->state & SOCKET_CARDBUS) {
@@ -836,7 +836,7 @@ int pcmcia_resume_card(struct pcmcia_socket *skt)
mutex_lock(&skt->skt_mutex);
do {
if (!(skt->state & SOCKET_PRESENT)) {
- ret = CS_NO_CARD;
+ ret = -ENODEV;
break;
}
if (skt->state & SOCKET_CARDBUS) {
@@ -896,7 +896,7 @@ int pcmcia_insert_card(struct pcmcia_socket *skt)
ret = -EBUSY;
break;
}
- if (socket_insert(skt) == CS_NO_CARD) {
+ if (socket_insert(skt) == -ENODEV) {
ret = -ENODEV;
break;
}
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index f6ff1218b3f3..aaac16aedee3 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -83,7 +83,7 @@ static const lookup_t error_table[] = {
{ CS_BAD_SIZE, "Bad size" },
{ CS_BAD_TYPE, "Bad type" },
{ -EIO, "Input/Output error" },
- { CS_NO_CARD, "No card present" },
+ { -ENODEV, "No card present" },
{ -EINVAL, "Bad parameter" },
{ CS_GENERAL_FAILURE, "General failure" },
{ CS_BAD_ARGS, "Bad arguments" },
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 40bef470b47c..ed8c4fb1e8c1 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -248,7 +248,7 @@ static int pccard_get_status(struct pcmcia_socket *s,
if (s->state & SOCKET_SUSPEND)
status->CardState |= CS_EVENT_PM_SUSPEND;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
c = (p_dev) ? p_dev->function_config : NULL;
@@ -294,7 +294,7 @@ int pccard_get_configuration_info(struct pcmcia_socket *s,
config_t *c;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
#ifdef CONFIG_CARDBUS
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 9b61265fe7be..3e013854ec2d 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -169,7 +169,7 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
u_char val;
if (!p_dev || !p_dev->function_config)
- return CS_NO_CARD;
+ return -EINVAL;
s = p_dev->socket;
c = p_dev->function_config;
@@ -206,7 +206,7 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle,
int w;
if (!s || !(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
for (w = idx; w < MAX_WIN; w++)
if (s->state & SOCKET_WIN_REQ(w))
break;
@@ -276,7 +276,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
c = p_dev->function_config;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
if (!(c->state & CONFIG_LOCKED))
return CS_CONFIGURATION_LOCKED;
@@ -481,7 +481,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
pccard_io_map iomap;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;;
if (req->IntType & INT_CARDBUS) {
ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n");
@@ -602,7 +602,7 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
config_t *c;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
if (!req)
return -EINVAL;
@@ -662,7 +662,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
int type;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
c = p_dev->function_config;
if (c->state & CONFIG_LOCKED)
return CS_CONFIGURATION_LOCKED;
@@ -771,7 +771,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
int w;
if (!(s->state & SOCKET_PRESENT))
- return CS_NO_CARD;
+ return -ENODEV;
if (req->Attributes & (WIN_PAGED | WIN_SHARED))
return CS_BAD_ATTRIBUTE;