aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/cm4040_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/cm4040_cs.c')
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 8334226e103..6ccca8cbabc 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -514,7 +514,7 @@ static void cm4040_reader_release(struct pcmcia_device *link)
514 return; 514 return;
515} 515}
516 516
517static void reader_config(struct pcmcia_device *link, int devno) 517static int reader_config(struct pcmcia_device *link, int devno)
518{ 518{
519 struct reader_dev *dev; 519 struct reader_dev *dev;
520 tuple_t tuple; 520 tuple_t tuple;
@@ -610,13 +610,14 @@ static void reader_config(struct pcmcia_device *link, int devno)
610 link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); 610 link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
611 DEBUGP(2, dev, "<- reader_config (succ)\n"); 611 DEBUGP(2, dev, "<- reader_config (succ)\n");
612 612
613 return; 613 return 0;
614 614
615cs_failed: 615cs_failed:
616 cs_error(link, fail_fn, fail_rc); 616 cs_error(link, fail_fn, fail_rc);
617cs_release: 617cs_release:
618 reader_release(link); 618 reader_release(link);
619 link->state &= ~DEV_CONFIG_PENDING; 619 link->state &= ~DEV_CONFIG_PENDING;
620 return -ENODEV;
620} 621}
621 622
622static void reader_release(struct pcmcia_device *link) 623static void reader_release(struct pcmcia_device *link)
@@ -625,10 +626,10 @@ static void reader_release(struct pcmcia_device *link)
625 pcmcia_disable_device(link); 626 pcmcia_disable_device(link);
626} 627}
627 628
628static int reader_attach(struct pcmcia_device *link) 629static int reader_probe(struct pcmcia_device *link)
629{ 630{
630 struct reader_dev *dev; 631 struct reader_dev *dev;
631 int i; 632 int i, ret;
632 633
633 for (i = 0; i < CM_MAX_DEV; i++) { 634 for (i = 0; i < CM_MAX_DEV; i++) {
634 if (dev_table[i] == NULL) 635 if (dev_table[i] == NULL)
@@ -659,7 +660,9 @@ static int reader_attach(struct pcmcia_device *link)
659 dev->poll_timer.function = &cm4040_do_poll; 660 dev->poll_timer.function = &cm4040_do_poll;
660 661
661 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 662 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
662 reader_config(link, i); 663 ret = reader_config(link, i);
664 if (ret)
665 return ret;
663 666
664 class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, 667 class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
665 "cmx%d", i); 668 "cmx%d", i);
@@ -715,7 +718,7 @@ static struct pcmcia_driver reader_driver = {
715 .drv = { 718 .drv = {
716 .name = "cm4040_cs", 719 .name = "cm4040_cs",
717 }, 720 },
718 .probe = reader_attach, 721 .probe = reader_probe,
719 .remove = reader_detach, 722 .remove = reader_detach,
720 .id_table = cm4040_ids, 723 .id_table = cm4040_ids,
721}; 724};