aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-03 05:47:29 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 20:29:54 -0400
commit635d19bea0e91df473a81391ec8f3db2d049a218 (patch)
tree8886deb8530f815711ad0c65bc35ce491f25f3f9 /drivers/pcmcia
parentf958095ef4fc96e978c6eddcaca29100e5276c7f (diff)
pcmcia: deprecate CS_NO_MORE_ITEMS
CS_NO_MORE_ITEMS is returned by the CIS tuple reading and parsing code if the end of a tuple chain is reached. As at least one PCMCIA driver relies on matching this return value, replace it with -ENOSPC which is now uniquely used for this purpose within the in-kernel pcmcia subsystem. CC: Russell King <rmk+kernel@arm.linux.org.uk> CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/cistpl.c10
-rw-r--r--drivers/pcmcia/ds.c2
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c2
-rw-r--r--drivers/pcmcia/pcmcia_resource.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 660e162c502f..a59e09dd8557 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -450,7 +450,7 @@ int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple
450 if (pccard_get_next_tuple(s, function, tuple) == 0) { 450 if (pccard_get_next_tuple(s, function, tuple) == 0) {
451 tuple->DesiredTuple = CISTPL_LINKTARGET; 451 tuple->DesiredTuple = CISTPL_LINKTARGET;
452 if (pccard_get_next_tuple(s, function, tuple) != 0) 452 if (pccard_get_next_tuple(s, function, tuple) != 0)
453 return CS_NO_MORE_ITEMS; 453 return -ENOSPC;
454 } else 454 } else
455 tuple->CISOffset = tuple->TupleLink = 0; 455 tuple->CISOffset = tuple->TupleLink = 0;
456 tuple->DesiredTuple = req; 456 tuple->DesiredTuple = req;
@@ -526,7 +526,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
526 /* End of chain? Follow long link if possible */ 526 /* End of chain? Follow long link if possible */
527 if (link[0] == CISTPL_END) { 527 if (link[0] == CISTPL_END) {
528 if ((ofs = follow_link(s, tuple)) < 0) 528 if ((ofs = follow_link(s, tuple)) < 0)
529 return CS_NO_MORE_ITEMS; 529 return -ENOSPC;
530 attr = SPACE(tuple->Flags); 530 attr = SPACE(tuple->Flags);
531 read_cis_cache(s, attr, ofs, 2, link); 531 read_cis_cache(s, attr, ofs, 2, link);
532 } 532 }
@@ -584,7 +584,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
584 } 584 }
585 if (i == MAX_TUPLES) { 585 if (i == MAX_TUPLES) {
586 cs_dbg(s, 1, "cs: overrun in pcmcia_get_next_tuple\n"); 586 cs_dbg(s, 1, "cs: overrun in pcmcia_get_next_tuple\n");
587 return CS_NO_MORE_ITEMS; 587 return -ENOSPC;
588 } 588 }
589 589
590 tuple->TupleCode = link[0]; 590 tuple->TupleCode = link[0];
@@ -606,7 +606,7 @@ int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple)
606 return -EINVAL; 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 -ENOSPC;
610 len = tuple->TupleLink - tuple->TupleOffset; 610 len = tuple->TupleLink - tuple->TupleOffset;
611 tuple->TupleDataLen = tuple->TupleLink; 611 tuple->TupleDataLen = tuple->TupleLink;
612 if (len == 0) 612 if (len == 0)
@@ -1490,7 +1490,7 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, unsigned
1490 cards have only a broken VERS_2 tuple; hence the bogus test. */ 1490 cards have only a broken VERS_2 tuple; hence the bogus test. */
1491 if ((pccard_read_tuple(s, function, CISTPL_MANFID, p) == 0) || 1491 if ((pccard_read_tuple(s, function, CISTPL_MANFID, p) == 0) ||
1492 (pccard_read_tuple(s, function, CISTPL_VERS_1, p) == 0) || 1492 (pccard_read_tuple(s, function, CISTPL_VERS_1, p) == 0) ||
1493 (pccard_read_tuple(s, function, CISTPL_VERS_2, p) != CS_NO_MORE_ITEMS)) 1493 (pccard_read_tuple(s, function, CISTPL_VERS_2, p) != -ENOSPC))
1494 ident_ok++; 1494 ident_ok++;
1495 1495
1496 if (!dev_ok && !ident_ok) 1496 if (!dev_ok && !ident_ok)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 7f38eb06c81e..591d9627bb2a 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -88,7 +88,7 @@ static const lookup_t error_table[] = {
88 { CS_BAD_ARGS, "Bad arguments" }, 88 { CS_BAD_ARGS, "Bad arguments" },
89 { -EACCES, "Configuration locked" }, 89 { -EACCES, "Configuration locked" },
90 { CS_IN_USE, "Resource in use" }, 90 { CS_IN_USE, "Resource in use" },
91 { CS_NO_MORE_ITEMS, "No more items" }, 91 { -ENOSPC, "No more items" },
92 { CS_OUT_OF_RESOURCE, "Out of resource" }, 92 { CS_OUT_OF_RESOURCE, "Out of resource" },
93 { CS_BAD_TUPLE, "Bad CIS tuple" } 93 { CS_BAD_TUPLE, "Bad CIS tuple" }
94}; 94};
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index ed8c4fb1e8c1..a6289e5a75e1 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -973,7 +973,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
973 err = -EBUSY; break; 973 err = -EBUSY; break;
974 case CS_OUT_OF_RESOURCE: 974 case CS_OUT_OF_RESOURCE:
975 err = -ENOSPC; break; 975 err = -ENOSPC; break;
976 case CS_NO_MORE_ITEMS: 976 case -ENOSPC:
977 err = -ENODATA; break; 977 err = -ENODATA; break;
978 case -ENOSYS: 978 case -ENOSYS:
979 err = -ENOSYS; break; 979 err = -ENOSYS; break;
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 670465d4aac2..8f2c805e793b 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -211,7 +211,7 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle,
211 if (s->state & SOCKET_WIN_REQ(w)) 211 if (s->state & SOCKET_WIN_REQ(w))
212 break; 212 break;
213 if (w == MAX_WIN) 213 if (w == MAX_WIN)
214 return CS_NO_MORE_ITEMS; 214 return -EINVAL;
215 win = &s->win[w]; 215 win = &s->win[w];
216 req->Base = win->ctl.res->start; 216 req->Base = win->ctl.res->start;
217 req->Size = win->ctl.res->end - win->ctl.res->start + 1; 217 req->Size = win->ctl.res->end - win->ctl.res->start + 1;