diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 4174d9656e35..34c83d3ca0fa 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -427,6 +427,18 @@ static int pcmcia_device_probe(struct device * dev) | |||
427 | p_drv = to_pcmcia_drv(dev->driver); | 427 | p_drv = to_pcmcia_drv(dev->driver); |
428 | s = p_dev->socket; | 428 | s = p_dev->socket; |
429 | 429 | ||
430 | /* The PCMCIA code passes the match data in via dev->driver_data | ||
431 | * which is an ugly hack. Once the driver probe is called it may | ||
432 | * and often will overwrite the match data so we must save it first | ||
433 | * | ||
434 | * handle pseudo multifunction devices: | ||
435 | * there are at most two pseudo multifunction devices. | ||
436 | * if we're matching against the first, schedule a | ||
437 | * call which will then check whether there are two | ||
438 | * pseudo devices, and if not, add the second one. | ||
439 | */ | ||
440 | did = p_dev->dev.driver_data; | ||
441 | |||
430 | ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, | 442 | ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, |
431 | p_drv->drv.name); | 443 | p_drv->drv.name); |
432 | 444 | ||
@@ -455,21 +467,14 @@ static int pcmcia_device_probe(struct device * dev) | |||
455 | goto put_module; | 467 | goto put_module; |
456 | } | 468 | } |
457 | 469 | ||
458 | /* handle pseudo multifunction devices: | ||
459 | * there are at most two pseudo multifunction devices. | ||
460 | * if we're matching against the first, schedule a | ||
461 | * call which will then check whether there are two | ||
462 | * pseudo devices, and if not, add the second one. | ||
463 | */ | ||
464 | did = p_dev->dev.driver_data; | ||
465 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && | 470 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && |
466 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) | 471 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) |
467 | pcmcia_add_device_later(p_dev->socket, 0); | 472 | pcmcia_add_device_later(p_dev->socket, 0); |
468 | 473 | ||
469 | put_module: | 474 | put_module: |
470 | if (ret) | 475 | if (ret) |
471 | module_put(p_drv->owner); | 476 | module_put(p_drv->owner); |
472 | put_dev: | 477 | put_dev: |
473 | if (ret) | 478 | if (ret) |
474 | put_device(dev); | 479 | put_device(dev); |
475 | return (ret); | 480 | return (ret); |