aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 05:18:00 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 20:29:45 -0400
commitffb8da20271bcfb343e299e5f630dab9ccfb6214 (patch)
tree52a228473ac4cb74726c63c4d3f2fbce8da831ff
parent8567142e87322141f9344d1ab632ccf5190cd0d3 (diff)
pcmcia: deprecate CS_BAD_HANDLE
CS_BAD_HANDLE means that something went badly wrong: no parameter was passed, or the paramater passed wasn't the correct one. Therefore, replace it with -EINVAL. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--drivers/pcmcia/cistpl.c8
-rw-r--r--drivers/pcmcia/ds.c1
-rw-r--r--drivers/pcmcia/pcmcia_resource.c12
-rw-r--r--include/pcmcia/cs.h2
4 files changed, 11 insertions, 12 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index a0eae81731c5..660e162c502f 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -425,7 +425,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int func, tuple_t *t
425int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) 425int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
426{ 426{
427 if (!s) 427 if (!s)
428 return CS_BAD_HANDLE; 428 return -EINVAL;
429 if (!(s->state & SOCKET_PRESENT)) 429 if (!(s->state & SOCKET_PRESENT))
430 return -ENODEV; 430 return -ENODEV;
431 tuple->TupleLink = tuple->Flags = 0; 431 tuple->TupleLink = tuple->Flags = 0;
@@ -505,7 +505,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
505 int ofs, i, attr; 505 int ofs, i, attr;
506 506
507 if (!s) 507 if (!s)
508 return CS_BAD_HANDLE; 508 return -EINVAL;
509 if (!(s->state & SOCKET_PRESENT)) 509 if (!(s->state & SOCKET_PRESENT))
510 return -ENODEV; 510 return -ENODEV;
511 511
@@ -603,7 +603,7 @@ int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple)
603 u_int len; 603 u_int len;
604 604
605 if (!s) 605 if (!s)
606 return CS_BAD_HANDLE; 606 return -EINVAL;
607 607
608 if (tuple->TupleLink < tuple->TupleOffset) 608 if (tuple->TupleLink < tuple->TupleOffset)
609 return CS_NO_MORE_ITEMS; 609 return CS_NO_MORE_ITEMS;
@@ -1457,7 +1457,7 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned
1457 int ret, reserved, dev_ok = 0, ident_ok = 0; 1457 int ret, reserved, dev_ok = 0, ident_ok = 0;
1458 1458
1459 if (!s) 1459 if (!s)
1460 return CS_BAD_HANDLE; 1460 return -EINVAL;
1461 1461
1462 tuple = kmalloc(sizeof(*tuple), GFP_KERNEL); 1462 tuple = kmalloc(sizeof(*tuple), GFP_KERNEL);
1463 if (tuple == NULL) { 1463 if (tuple == NULL) {
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index cb500195342f..6a37198df9f1 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -90,7 +90,6 @@ static const lookup_t error_table[] = {
90 { CS_IN_USE, "Resource in use" }, 90 { CS_IN_USE, "Resource in use" },
91 { CS_NO_MORE_ITEMS, "No more items" }, 91 { CS_NO_MORE_ITEMS, "No more items" },
92 { CS_OUT_OF_RESOURCE, "Out of resource" }, 92 { CS_OUT_OF_RESOURCE, "Out of resource" },
93 { CS_BAD_HANDLE, "Bad handle" },
94 { CS_BAD_TUPLE, "Bad CIS tuple" } 93 { CS_BAD_TUPLE, "Bad CIS tuple" }
95}; 94};
96 95
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 3e013854ec2d..55a1238b1c57 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -238,7 +238,7 @@ EXPORT_SYMBOL(pcmcia_get_window);
238int pcmcia_get_mem_page(window_handle_t win, memreq_t *req) 238int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
239{ 239{
240 if ((win == NULL) || (win->magic != WINDOW_MAGIC)) 240 if ((win == NULL) || (win->magic != WINDOW_MAGIC))
241 return CS_BAD_HANDLE; 241 return -EINVAL;
242 req->Page = 0; 242 req->Page = 0;
243 req->CardOffset = win->ctl.card_start; 243 req->CardOffset = win->ctl.card_start;
244 return 0; 244 return 0;
@@ -250,7 +250,7 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
250{ 250{
251 struct pcmcia_socket *s; 251 struct pcmcia_socket *s;
252 if ((win == NULL) || (win->magic != WINDOW_MAGIC)) 252 if ((win == NULL) || (win->magic != WINDOW_MAGIC))
253 return CS_BAD_HANDLE; 253 return -EINVAL;
254 if (req->Page != 0) 254 if (req->Page != 0)
255 return CS_BAD_PAGE; 255 return CS_BAD_PAGE;
256 s = win->sock; 256 s = win->sock;
@@ -389,7 +389,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
389 config_t *c = p_dev->function_config; 389 config_t *c = p_dev->function_config;
390 390
391 if (!p_dev->_io ) 391 if (!p_dev->_io )
392 return CS_BAD_HANDLE; 392 return -EINVAL;
393 393
394 p_dev->_io = 0; 394 p_dev->_io = 0;
395 395
@@ -415,7 +415,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
415 config_t *c= p_dev->function_config; 415 config_t *c= p_dev->function_config;
416 416
417 if (!p_dev->_irq) 417 if (!p_dev->_irq)
418 return CS_BAD_HANDLE; 418 return -EINVAL;
419 p_dev->_irq = 0; 419 p_dev->_irq = 0;
420 420
421 if (c->state & CONFIG_LOCKED) 421 if (c->state & CONFIG_LOCKED)
@@ -446,10 +446,10 @@ int pcmcia_release_window(window_handle_t win)
446 struct pcmcia_socket *s; 446 struct pcmcia_socket *s;
447 447
448 if ((win == NULL) || (win->magic != WINDOW_MAGIC)) 448 if ((win == NULL) || (win->magic != WINDOW_MAGIC))
449 return CS_BAD_HANDLE; 449 return -EINVAL;
450 s = win->sock; 450 s = win->sock;
451 if (!(win->handle->_win & CLIENT_WIN_REQ(win->index))) 451 if (!(win->handle->_win & CLIENT_WIN_REQ(win->index)))
452 return CS_BAD_HANDLE; 452 return -EINVAL;
453 453
454 /* Shut down memory window */ 454 /* Shut down memory window */
455 win->ctl.flags &= ~MAP_ACTIVE; 455 win->ctl.flags &= ~MAP_ACTIVE;
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index bec295cb94f6..dc5c1eb8ec79 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -317,7 +317,7 @@ typedef struct error_info_t {
317#define CS_IN_USE 0x1e 317#define CS_IN_USE 0x1e
318#define CS_NO_MORE_ITEMS 0x1f 318#define CS_NO_MORE_ITEMS 0x1f
319#define CS_OUT_OF_RESOURCE -ENOMEM 319#define CS_OUT_OF_RESOURCE -ENOMEM
320#define CS_BAD_HANDLE 0x21 320#define CS_BAD_HANDLE -EINVAL
321 321
322#define CS_BAD_TUPLE 0x40 322#define CS_BAD_TUPLE 0x40
323 323