···352 kfree(p_dev);353}35400000000355356static int pcmcia_device_probe(struct device * dev)357{358 struct pcmcia_device *p_dev;359 struct pcmcia_driver *p_drv;0360 struct pcmcia_socket *s;361 int ret = 0;362···401 }402403 ret = p_drv->probe(p_dev);0000000000000404405 put_module:406 if (ret)···682 s->pcmcia_state.device_add_pending = 0;683}684685-static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s)686-{687- if (!s->pcmcia_state.device_add_pending) {688- s->pcmcia_state.device_add_pending = 1;689- schedule_work(&s->device_add);690- }691- return;692-}693-694static int pcmcia_requery(struct device *dev, void * _data)695{696 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);···768 }769770 if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {771- /* handle pseudo multifunction devices:772- * there are at most two pseudo multifunction devices.773- * if we're matching against the first, schedule a774- * call which will then check whether there are two775- * pseudo devices, and if not, add the second one.776- */777- if (dev->device_no == 0)778- pcmcia_add_pseudo_device(dev->socket);779-780 if (dev->device_no != did->device_no)781 return 0;782 }
···352 kfree(p_dev);353}354355+static void pcmcia_add_pseudo_device(struct pcmcia_socket *s)356+{357+ if (!s->pcmcia_state.device_add_pending) {358+ s->pcmcia_state.device_add_pending = 1;359+ schedule_work(&s->device_add);360+ }361+ return;362+}363364static int pcmcia_device_probe(struct device * dev)365{366 struct pcmcia_device *p_dev;367 struct pcmcia_driver *p_drv;368+ struct pcmcia_device_id *did;369 struct pcmcia_socket *s;370 int ret = 0;371···392 }393394 ret = p_drv->probe(p_dev);395+ if (ret)396+ goto put_module;397+398+ /* handle pseudo multifunction devices:399+ * there are at most two pseudo multifunction devices.400+ * if we're matching against the first, schedule a401+ * call which will then check whether there are two402+ * pseudo devices, and if not, add the second one.403+ */404+ did = (struct pcmcia_device_id *) p_dev->dev.driver_data;405+ if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&406+ (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))407+ pcmcia_add_pseudo_device(p_dev->socket);408409 put_module:410 if (ret)···660 s->pcmcia_state.device_add_pending = 0;661}662000000000663static int pcmcia_requery(struct device *dev, void * _data)664{665 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);···755 }756757 if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {000000000758 if (dev->device_no != did->device_no)759 return 0;760 }