7 #include <linux/module.h>
8 #include <linux/ctype.h>
9 #include <linux/slab.h>
36 drv_id->
devs[i].id)) {
51 static void card_remove(
struct pnp_dev *dev)
56 static void card_remove_first(
struct pnp_dev *dev)
60 if (!dev->
card || !drv)
64 drv->
link.remove = &card_remove;
77 id = match_card(drv, card);
88 if (drv->
probe(clink,
id) >= 0)
105 static struct pnp_id *pnp_add_card_id(
struct pnp_card *card,
char *
id)
113 dev_id->
id[0] =
id[0];
114 dev_id->
id[1] =
id[1];
115 dev_id->
id[2] =
id[2];
120 dev_id->
id[7] =
'\0';
124 while (ptr && ptr->
next)
134 static void pnp_free_card_ids(
struct pnp_card *card)
147 static void pnp_release_card(
struct device *dmdev)
151 pnp_free_card_ids(card);
171 card->
dev.dma_mask = &card->
dev.coherent_dma_mask;
173 dev_id = pnp_add_card_id(card, pnpid);
210 static int pnp_interface_attach_card(
struct pnp_card *card)
238 card->
dev.release = &pnp_release_card;
241 dev_err(&card->
dev,
"could not register (err=%d)\n", error);
245 pnp_interface_attach_card(card);
264 card_probe(card, drv);
295 dev->
dev.parent = &card->
dev;
341 if (from->
card != card)
345 while (pos != &card->
devices) {
356 dev->
dev.driver = &drv->
link.driver;
378 drv->
link.remove = &card_remove;
380 drv->
link.remove = &card_remove_first;
393 return link->
driver->suspend(link, state);
396 static int card_resume(
struct pnp_dev *dev)
403 link->
driver->resume(link);
420 drv->
link.remove = &card_remove_first;
435 card_probe(card, drv);