diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-03 05:10:56 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2008-08-22 20:29:43 -0400 |
commit | 3939c1ef1f954409d1441c09fbc08376655758fe (patch) | |
tree | a66c10593b8b47a1a63471dd6fc6f9fb214063ca /drivers/pcmcia | |
parent | d8b0a49da4f213c637d458319432016f4ea5e12a (diff) |
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/pcmcia')
-rw-r--r-- | drivers/pcmcia/cistpl.c | 4 | ||||
-rw-r--r-- | drivers/pcmcia/cs.c | 16 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_ioctl.c | 4 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 14 |
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 | |||
427 | if (!s) | 427 | if (!s) |
428 | return CS_BAD_HANDLE; | 428 | return CS_BAD_HANDLE; |
429 | if (!(s->state & SOCKET_PRESENT)) | 429 | if (!(s->state & SOCKET_PRESENT)) |
430 | return CS_NO_CARD; | 430 | return -ENODEV; |
431 | tuple->TupleLink = tuple->Flags = 0; | 431 | tuple->TupleLink = tuple->Flags = 0; |
432 | #ifdef CONFIG_CARDBUS | 432 | #ifdef CONFIG_CARDBUS |
433 | if (s->state & SOCKET_CARDBUS) { | 433 | if (s->state & SOCKET_CARDBUS) { |
@@ -507,7 +507,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_ | |||
507 | if (!s) | 507 | if (!s) |
508 | return CS_BAD_HANDLE; | 508 | return CS_BAD_HANDLE; |
509 | if (!(s->state & SOCKET_PRESENT)) | 509 | if (!(s->state & SOCKET_PRESENT)) |
510 | return CS_NO_CARD; | 510 | return -ENODEV; |
511 | 511 | ||
512 | link[1] = tuple->TupleLink; | 512 | link[1] = tuple->TupleLink; |
513 | ofs = tuple->CISOffset + tuple->TupleLink; | 513 | 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) | |||
367 | skt->ops->get_status(skt, &status); | 367 | skt->ops->get_status(skt, &status); |
368 | 368 | ||
369 | if (!(status & SS_DETECT)) | 369 | if (!(status & SS_DETECT)) |
370 | return CS_NO_CARD; | 370 | return -ENODEV; |
371 | 371 | ||
372 | if (status & SS_READY) | 372 | if (status & SS_READY) |
373 | return 0; | 373 | return 0; |
@@ -428,14 +428,14 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay) | |||
428 | 428 | ||
429 | skt->ops->get_status(skt, &status); | 429 | skt->ops->get_status(skt, &status); |
430 | if (!(status & SS_DETECT)) | 430 | if (!(status & SS_DETECT)) |
431 | return CS_NO_CARD; | 431 | return -ENODEV; |
432 | 432 | ||
433 | msleep(initial_delay * 10); | 433 | msleep(initial_delay * 10); |
434 | 434 | ||
435 | for (i = 0; i < 100; i++) { | 435 | for (i = 0; i < 100; i++) { |
436 | skt->ops->get_status(skt, &status); | 436 | skt->ops->get_status(skt, &status); |
437 | if (!(status & SS_DETECT)) | 437 | if (!(status & SS_DETECT)) |
438 | return CS_NO_CARD; | 438 | return -ENODEV; |
439 | 439 | ||
440 | if (!(status & SS_PENDING)) | 440 | if (!(status & SS_PENDING)) |
441 | break; | 441 | break; |
@@ -504,7 +504,7 @@ static int socket_insert(struct pcmcia_socket *skt) | |||
504 | cs_dbg(skt, 4, "insert\n"); | 504 | cs_dbg(skt, 4, "insert\n"); |
505 | 505 | ||
506 | if (!cs_socket_get(skt)) | 506 | if (!cs_socket_get(skt)) |
507 | return CS_NO_CARD; | 507 | return -ENODEV; |
508 | 508 | ||
509 | ret = socket_setup(skt, setup_delay); | 509 | ret = socket_setup(skt, setup_delay); |
510 | if (ret == 0) { | 510 | if (ret == 0) { |
@@ -761,7 +761,7 @@ int pccard_reset_card(struct pcmcia_socket *skt) | |||
761 | mutex_lock(&skt->skt_mutex); | 761 | mutex_lock(&skt->skt_mutex); |
762 | do { | 762 | do { |
763 | if (!(skt->state & SOCKET_PRESENT)) { | 763 | if (!(skt->state & SOCKET_PRESENT)) { |
764 | ret = CS_NO_CARD; | 764 | ret = -ENODEV; |
765 | break; | 765 | break; |
766 | } | 766 | } |
767 | if (skt->state & SOCKET_SUSPEND) { | 767 | if (skt->state & SOCKET_SUSPEND) { |
@@ -806,7 +806,7 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt) | |||
806 | mutex_lock(&skt->skt_mutex); | 806 | mutex_lock(&skt->skt_mutex); |
807 | do { | 807 | do { |
808 | if (!(skt->state & SOCKET_PRESENT)) { | 808 | if (!(skt->state & SOCKET_PRESENT)) { |
809 | ret = CS_NO_CARD; | 809 | ret = -ENODEV; |
810 | break; | 810 | break; |
811 | } | 811 | } |
812 | if (skt->state & SOCKET_CARDBUS) { | 812 | if (skt->state & SOCKET_CARDBUS) { |
@@ -836,7 +836,7 @@ int pcmcia_resume_card(struct pcmcia_socket *skt) | |||
836 | mutex_lock(&skt->skt_mutex); | 836 | mutex_lock(&skt->skt_mutex); |
837 | do { | 837 | do { |
838 | if (!(skt->state & SOCKET_PRESENT)) { | 838 | if (!(skt->state & SOCKET_PRESENT)) { |
839 | ret = CS_NO_CARD; | 839 | ret = -ENODEV; |
840 | break; | 840 | break; |
841 | } | 841 | } |
842 | if (skt->state & SOCKET_CARDBUS) { | 842 | if (skt->state & SOCKET_CARDBUS) { |
@@ -896,7 +896,7 @@ int pcmcia_insert_card(struct pcmcia_socket *skt) | |||
896 | ret = -EBUSY; | 896 | ret = -EBUSY; |
897 | break; | 897 | break; |
898 | } | 898 | } |
899 | if (socket_insert(skt) == CS_NO_CARD) { | 899 | if (socket_insert(skt) == -ENODEV) { |
900 | ret = -ENODEV; | 900 | ret = -ENODEV; |
901 | break; | 901 | break; |
902 | } | 902 | } |
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[] = { | |||
83 | { CS_BAD_SIZE, "Bad size" }, | 83 | { CS_BAD_SIZE, "Bad size" }, |
84 | { CS_BAD_TYPE, "Bad type" }, | 84 | { CS_BAD_TYPE, "Bad type" }, |
85 | { -EIO, "Input/Output error" }, | 85 | { -EIO, "Input/Output error" }, |
86 | { CS_NO_CARD, "No card present" }, | 86 | { -ENODEV, "No card present" }, |
87 | { -EINVAL, "Bad parameter" }, | 87 | { -EINVAL, "Bad parameter" }, |
88 | { CS_GENERAL_FAILURE, "General failure" }, | 88 | { CS_GENERAL_FAILURE, "General failure" }, |
89 | { CS_BAD_ARGS, "Bad arguments" }, | 89 | { 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, | |||
248 | if (s->state & SOCKET_SUSPEND) | 248 | if (s->state & SOCKET_SUSPEND) |
249 | status->CardState |= CS_EVENT_PM_SUSPEND; | 249 | status->CardState |= CS_EVENT_PM_SUSPEND; |
250 | if (!(s->state & SOCKET_PRESENT)) | 250 | if (!(s->state & SOCKET_PRESENT)) |
251 | return CS_NO_CARD; | 251 | return -ENODEV; |
252 | 252 | ||
253 | c = (p_dev) ? p_dev->function_config : NULL; | 253 | c = (p_dev) ? p_dev->function_config : NULL; |
254 | 254 | ||
@@ -294,7 +294,7 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
294 | config_t *c; | 294 | config_t *c; |
295 | 295 | ||
296 | if (!(s->state & SOCKET_PRESENT)) | 296 | if (!(s->state & SOCKET_PRESENT)) |
297 | return CS_NO_CARD; | 297 | return -ENODEV; |
298 | 298 | ||
299 | 299 | ||
300 | #ifdef CONFIG_CARDBUS | 300 | #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, | |||
169 | u_char val; | 169 | u_char val; |
170 | 170 | ||
171 | if (!p_dev || !p_dev->function_config) | 171 | if (!p_dev || !p_dev->function_config) |
172 | return CS_NO_CARD; | 172 | return -EINVAL; |
173 | 173 | ||
174 | s = p_dev->socket; | 174 | s = p_dev->socket; |
175 | c = p_dev->function_config; | 175 | c = p_dev->function_config; |
@@ -206,7 +206,7 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, | |||
206 | int w; | 206 | int w; |
207 | 207 | ||
208 | if (!s || !(s->state & SOCKET_PRESENT)) | 208 | if (!s || !(s->state & SOCKET_PRESENT)) |
209 | return CS_NO_CARD; | 209 | return -ENODEV; |
210 | for (w = idx; w < MAX_WIN; w++) | 210 | for (w = idx; w < MAX_WIN; w++) |
211 | if (s->state & SOCKET_WIN_REQ(w)) | 211 | if (s->state & SOCKET_WIN_REQ(w)) |
212 | break; | 212 | break; |
@@ -276,7 +276,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, | |||
276 | c = p_dev->function_config; | 276 | c = p_dev->function_config; |
277 | 277 | ||
278 | if (!(s->state & SOCKET_PRESENT)) | 278 | if (!(s->state & SOCKET_PRESENT)) |
279 | return CS_NO_CARD; | 279 | return -ENODEV; |
280 | if (!(c->state & CONFIG_LOCKED)) | 280 | if (!(c->state & CONFIG_LOCKED)) |
281 | return CS_CONFIGURATION_LOCKED; | 281 | return CS_CONFIGURATION_LOCKED; |
282 | 282 | ||
@@ -481,7 +481,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, | |||
481 | pccard_io_map iomap; | 481 | pccard_io_map iomap; |
482 | 482 | ||
483 | if (!(s->state & SOCKET_PRESENT)) | 483 | if (!(s->state & SOCKET_PRESENT)) |
484 | return CS_NO_CARD; | 484 | return -ENODEV;; |
485 | 485 | ||
486 | if (req->IntType & INT_CARDBUS) { | 486 | if (req->IntType & INT_CARDBUS) { |
487 | ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n"); | 487 | 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) | |||
602 | config_t *c; | 602 | config_t *c; |
603 | 603 | ||
604 | if (!(s->state & SOCKET_PRESENT)) | 604 | if (!(s->state & SOCKET_PRESENT)) |
605 | return CS_NO_CARD; | 605 | return -ENODEV; |
606 | 606 | ||
607 | if (!req) | 607 | if (!req) |
608 | return -EINVAL; | 608 | return -EINVAL; |
@@ -662,7 +662,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) | |||
662 | int type; | 662 | int type; |
663 | 663 | ||
664 | if (!(s->state & SOCKET_PRESENT)) | 664 | if (!(s->state & SOCKET_PRESENT)) |
665 | return CS_NO_CARD; | 665 | return -ENODEV; |
666 | c = p_dev->function_config; | 666 | c = p_dev->function_config; |
667 | if (c->state & CONFIG_LOCKED) | 667 | if (c->state & CONFIG_LOCKED) |
668 | return CS_CONFIGURATION_LOCKED; | 668 | return CS_CONFIGURATION_LOCKED; |
@@ -771,7 +771,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h | |||
771 | int w; | 771 | int w; |
772 | 772 | ||
773 | if (!(s->state & SOCKET_PRESENT)) | 773 | if (!(s->state & SOCKET_PRESENT)) |
774 | return CS_NO_CARD; | 774 | return -ENODEV; |
775 | if (req->Attributes & (WIN_PAGED | WIN_SHARED)) | 775 | if (req->Attributes & (WIN_PAGED | WIN_SHARED)) |
776 | return CS_BAD_ATTRIBUTE; | 776 | return CS_BAD_ATTRIBUTE; |
777 | 777 | ||