diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-10-25 21:49:27 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:12:02 -0500 |
commit | af2b3b503ad1b071b66e1531caae252b4b95c847 (patch) | |
tree | 600785af3af4a79978f688fa35e19ab900db264b /drivers/scsi/pcmcia | |
parent | a9606fd39083478bef313c0e3b77bc065e39e36e (diff) |
[PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation
struct pcmcia_device *p_dev->conf.ConfigBase and .Present are set in almost
all PCMICA driver right at the beginning, using the same calls but slightly
different implementations. Unfiy this in the PCMCIA core.
Includes a small bugfix ("drivers/net/pcmcia/xirc2ps_cs.c: remove unused
label") from and Signed-off-by Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia')
-rw-r--r-- | drivers/scsi/pcmcia/aha152x_stub.c | 7 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 5 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 6 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/qlogic_stub.c | 9 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 9 |
5 files changed, 5 insertions, 31 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index ee449b29fc82..aad362ba02e0 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
@@ -154,16 +154,11 @@ static int aha152x_config_cs(struct pcmcia_device *link) | |||
154 | 154 | ||
155 | DEBUG(0, "aha152x_config(0x%p)\n", link); | 155 | DEBUG(0, "aha152x_config(0x%p)\n", link); |
156 | 156 | ||
157 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
158 | tuple.TupleData = tuple_data; | 157 | tuple.TupleData = tuple_data; |
159 | tuple.TupleDataMax = 64; | 158 | tuple.TupleDataMax = 64; |
160 | tuple.TupleOffset = 0; | 159 | tuple.TupleOffset = 0; |
161 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
162 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
163 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
164 | link->conf.ConfigBase = parse.config.base; | ||
165 | |||
166 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 160 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
161 | tuple.Attributes = 0; | ||
167 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 162 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
168 | while (1) { | 163 | while (1) { |
169 | if (pcmcia_get_tuple_data(link, &tuple) != 0 || | 164 | if (pcmcia_get_tuple_data(link, &tuple) != 0 || |
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 85f7ffac19a0..a1c5f265069f 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -136,14 +136,9 @@ static int fdomain_config(struct pcmcia_device *link) | |||
136 | 136 | ||
137 | DEBUG(0, "fdomain_config(0x%p)\n", link); | 137 | DEBUG(0, "fdomain_config(0x%p)\n", link); |
138 | 138 | ||
139 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
140 | tuple.TupleData = tuple_data; | 139 | tuple.TupleData = tuple_data; |
141 | tuple.TupleDataMax = 64; | 140 | tuple.TupleDataMax = 64; |
142 | tuple.TupleOffset = 0; | 141 | tuple.TupleOffset = 0; |
143 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
144 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
145 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
146 | link->conf.ConfigBase = parse.config.base; | ||
147 | 142 | ||
148 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 143 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
149 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 144 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index f2d79c3f0b8e..d72df5dae4ee 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1685,16 +1685,10 @@ static int nsp_cs_config(struct pcmcia_device *link) | |||
1685 | 1685 | ||
1686 | nsp_dbg(NSP_DEBUG_INIT, "in"); | 1686 | nsp_dbg(NSP_DEBUG_INIT, "in"); |
1687 | 1687 | ||
1688 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
1689 | tuple.Attributes = 0; | 1688 | tuple.Attributes = 0; |
1690 | tuple.TupleData = tuple_data; | 1689 | tuple.TupleData = tuple_data; |
1691 | tuple.TupleDataMax = sizeof(tuple_data); | 1690 | tuple.TupleDataMax = sizeof(tuple_data); |
1692 | tuple.TupleOffset = 0; | 1691 | tuple.TupleOffset = 0; |
1693 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
1694 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
1695 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
1696 | link->conf.ConfigBase = parse.config.base; | ||
1697 | link->conf.Present = parse.config.rmask[0]; | ||
1698 | 1692 | ||
1699 | /* Look up the current Vcc */ | 1693 | /* Look up the current Vcc */ |
1700 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); | 1694 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); |
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index 336e370f7f65..9d431fe7f47f 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c | |||
@@ -208,16 +208,11 @@ static int qlogic_config(struct pcmcia_device * link) | |||
208 | 208 | ||
209 | DEBUG(0, "qlogic_config(0x%p)\n", link); | 209 | DEBUG(0, "qlogic_config(0x%p)\n", link); |
210 | 210 | ||
211 | info->manf_id = link->manf_id; | ||
212 | |||
211 | tuple.TupleData = (cisdata_t *) tuple_data; | 213 | tuple.TupleData = (cisdata_t *) tuple_data; |
212 | tuple.TupleDataMax = 64; | 214 | tuple.TupleDataMax = 64; |
213 | tuple.TupleOffset = 0; | 215 | tuple.TupleOffset = 0; |
214 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
215 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
216 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
217 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
218 | link->conf.ConfigBase = parse.config.base; | ||
219 | |||
220 | info->manf_id = link->manf_id; | ||
221 | 216 | ||
222 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 217 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
223 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 218 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 80c28b9fb70a..fb7acea60286 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -722,16 +722,11 @@ SYM53C500_config(struct pcmcia_device *link) | |||
722 | 722 | ||
723 | DEBUG(0, "SYM53C500_config(0x%p)\n", link); | 723 | DEBUG(0, "SYM53C500_config(0x%p)\n", link); |
724 | 724 | ||
725 | info->manf_id = link->manf_id; | ||
726 | |||
725 | tuple.TupleData = (cisdata_t *)tuple_data; | 727 | tuple.TupleData = (cisdata_t *)tuple_data; |
726 | tuple.TupleDataMax = 64; | 728 | tuple.TupleDataMax = 64; |
727 | tuple.TupleOffset = 0; | 729 | tuple.TupleOffset = 0; |
728 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
729 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
730 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
731 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | ||
732 | link->conf.ConfigBase = parse.config.base; | ||
733 | |||
734 | info->manf_id = link->manf_id; | ||
735 | 730 | ||
736 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 731 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
737 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 732 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |