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 /sound/pcmcia/vx | |
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 'sound/pcmcia/vx')
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 3089fcca800e..d7df59e9c647 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -217,34 +217,12 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
217 | { | 217 | { |
218 | struct vx_core *chip = link->priv; | 218 | struct vx_core *chip = link->priv; |
219 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; | 219 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; |
220 | tuple_t tuple; | ||
221 | cisparse_t *parse; | ||
222 | u_short buf[32]; | ||
223 | int last_fn, last_ret; | 220 | int last_fn, last_ret; |
224 | 221 | ||
225 | snd_printdd(KERN_DEBUG "vxpocket_config called\n"); | 222 | snd_printdd(KERN_DEBUG "vxpocket_config called\n"); |
226 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); | ||
227 | if (! parse) { | ||
228 | snd_printk(KERN_ERR "vx: cannot allocate\n"); | ||
229 | return -ENOMEM; | ||
230 | } | ||
231 | tuple.Attributes = 0; | ||
232 | tuple.TupleData = (cisdata_t *)buf; | ||
233 | tuple.TupleDataMax = sizeof(buf); | ||
234 | tuple.TupleOffset = 0; | ||
235 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
236 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
237 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
238 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); | ||
239 | link->conf.ConfigBase = parse->config.base; | ||
240 | link->conf.Present = parse->config.rmask[0]; | ||
241 | 223 | ||
242 | /* redefine hardware record according to the VERSION1 string */ | 224 | /* redefine hardware record according to the VERSION1 string */ |
243 | tuple.DesiredTuple = CISTPL_VERS_1; | 225 | if (!strcmp(link->prod_id[1], "VX-POCKET")) { |
244 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | ||
245 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | ||
246 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); | ||
247 | if (! strcmp(parse->version_1.str + parse->version_1.ofs[1], "VX-POCKET")) { | ||
248 | snd_printdd("VX-pocket is detected\n"); | 226 | snd_printdd("VX-pocket is detected\n"); |
249 | } else { | 227 | } else { |
250 | snd_printdd("VX-pocket 440 is detected\n"); | 228 | snd_printdd("VX-pocket 440 is detected\n"); |
@@ -265,14 +243,12 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
265 | goto failed; | 243 | goto failed; |
266 | 244 | ||
267 | link->dev_node = &vxp->node; | 245 | link->dev_node = &vxp->node; |
268 | kfree(parse); | ||
269 | return 0; | 246 | return 0; |
270 | 247 | ||
271 | cs_failed: | 248 | cs_failed: |
272 | cs_error(link, last_fn, last_ret); | 249 | cs_error(link, last_fn, last_ret); |
273 | failed: | 250 | failed: |
274 | pcmcia_disable_device(link); | 251 | pcmcia_disable_device(link); |
275 | kfree(parse); | ||
276 | return -ENODEV; | 252 | return -ENODEV; |
277 | } | 253 | } |
278 | 254 | ||