diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 17:51:09 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 18:29:36 -0400 |
commit | 84897fc0524d7cbfc81d0bdf9f92ade6e3c3816b (patch) | |
tree | e24975ac12a1947c1a74dde7d23e795e27c41146 /drivers/pcmcia/ds.c | |
parent | 30514ccfc5651b0b1eb27d5ac1cb580b152cd85f (diff) |
pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup
pccard_read_tuple(), which is only used by the PCMCIA core, should
handle TUPLE_RETURN_COMMON more sensibly: If a specific function (which
may be 0) is requested, set tuple.Attributes = 0 as was done in all
PCMCIA drivers. If, however, BIND_FN_ALL is requested, return the
"common" tuple. As to the callers of pccard_read_tuple():
- All calls to pcmcia_validate_cis() had set the "function" parameter to
BIND_FN_ALL. Therefore, remove the "function" parameter and make the
parameter to pccard_read_tuple explicit.
- Calls to CISTPL_VERS_1 and CISTPL_MANFID now set BIND_FN_ALL. This was
already the case for calls to CISTPL_LONGLINK_MFC.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 9f300d3cb125..c70fb3bc0e0f 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -547,7 +547,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) | |||
547 | if (!vers1) | 547 | if (!vers1) |
548 | return -ENOMEM; | 548 | return -ENOMEM; |
549 | 549 | ||
550 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, | 550 | if (!pccard_read_tuple(p_dev->socket, BIND_FN_ALL, |
551 | CISTPL_MANFID, &manf_id)) { | 551 | CISTPL_MANFID, &manf_id)) { |
552 | p_dev->manf_id = manf_id.manf; | 552 | p_dev->manf_id = manf_id.manf; |
553 | p_dev->card_id = manf_id.card; | 553 | p_dev->card_id = manf_id.card; |
@@ -581,7 +581,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) | |||
581 | kfree(devgeo); | 581 | kfree(devgeo); |
582 | } | 582 | } |
583 | 583 | ||
584 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_VERS_1, | 584 | if (!pccard_read_tuple(p_dev->socket, BIND_FN_ALL, CISTPL_VERS_1, |
585 | vers1)) { | 585 | vers1)) { |
586 | for (i=0; i < vers1->ns; i++) { | 586 | for (i=0; i < vers1->ns; i++) { |
587 | char *tmp; | 587 | char *tmp; |
@@ -733,7 +733,7 @@ static int pcmcia_card_add(struct pcmcia_socket *s) | |||
733 | return -EAGAIN; /* try again, but later... */ | 733 | return -EAGAIN; /* try again, but later... */ |
734 | } | 734 | } |
735 | 735 | ||
736 | ret = pccard_validate_cis(s, BIND_FN_ALL, &no_chains); | 736 | ret = pccard_validate_cis(s, &no_chains); |
737 | if (ret || !no_chains) { | 737 | if (ret || !no_chains) { |
738 | ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n"); | 738 | ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n"); |
739 | return -ENODEV; | 739 | return -ENODEV; |