From 86a315c49d3641d512cb977ed3db1eddb31eb662 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 22 Sep 2008 15:58:14 +0100 Subject: [PATCH] --- yaml --- r: 109935 b: refs/heads/master c: cec5eb7be3a104fffd27ca967ee8e15a123050e2 h: refs/heads/master i: 109933: 7b9436f3eca271a61529f39eab7f8e402ea1a585 109931: e2818b570eebbec9bce16ad0debc120f009f58c4 109927: 4cd2bd18692f1698d2c260d6167ccb5d1b0f9492 109919: 661e580d911693352f658bc0a23c16c88f7039fb v: v3 --- [refs] | 2 +- trunk/drivers/pcmcia/ds.c | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 9930e726239e..a6695d800fac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ae9111912500db9fcc244ec16c3d7e471c551f52 +refs/heads/master: cec5eb7be3a104fffd27ca967ee8e15a123050e2 diff --git a/trunk/drivers/pcmcia/ds.c b/trunk/drivers/pcmcia/ds.c index 4174d9656e35..34c83d3ca0fa 100644 --- a/trunk/drivers/pcmcia/ds.c +++ b/trunk/drivers/pcmcia/ds.c @@ -427,6 +427,18 @@ static int pcmcia_device_probe(struct device * dev) p_drv = to_pcmcia_drv(dev->driver); s = p_dev->socket; + /* The PCMCIA code passes the match data in via dev->driver_data + * which is an ugly hack. Once the driver probe is called it may + * and often will overwrite the match data so we must save it first + * + * handle pseudo multifunction devices: + * there are at most two pseudo multifunction devices. + * if we're matching against the first, schedule a + * call which will then check whether there are two + * pseudo devices, and if not, add the second one. + */ + did = p_dev->dev.driver_data; + ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, p_drv->drv.name); @@ -455,21 +467,14 @@ static int pcmcia_device_probe(struct device * dev) goto put_module; } - /* handle pseudo multifunction devices: - * there are at most two pseudo multifunction devices. - * if we're matching against the first, schedule a - * call which will then check whether there are two - * pseudo devices, and if not, add the second one. - */ - did = p_dev->dev.driver_data; if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) pcmcia_add_device_later(p_dev->socket, 0); - put_module: +put_module: if (ret) module_put(p_drv->owner); - put_dev: +put_dev: if (ret) put_device(dev); return (ret);