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>
This commit is contained in:
Dominik Brodowski 2008-08-03 11:10:56 +02:00
parent d8b0a49da4
commit 3939c1ef1f
6 changed files with 21 additions and 21 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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" },

View file

@ -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

View file

@ -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;

View file

@ -304,7 +304,7 @@ typedef struct error_info_t {
#define CS_BAD_VPP -EINVAL
#define CS_BAD_WINDOW -ENODEV
#define CS_WRITE_FAILURE -EIO
#define CS_NO_CARD 0x14
#define CS_NO_CARD -ENODEV
#define CS_UNSUPPORTED_FUNCTION -ENODEV
#define CS_UNSUPPORTED_MODE -ENODEV
#define CS_BAD_SPEED -ENODEV