aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/synclink_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/synclink_cs.c')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 9bfd90e5d6b7..ef7a81314f0c 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -484,7 +484,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout);
484 484
485/* PCMCIA prototypes */ 485/* PCMCIA prototypes */
486 486
487static void mgslpc_config(struct pcmcia_device *link); 487static int mgslpc_config(struct pcmcia_device *link);
488static void mgslpc_release(u_long arg); 488static void mgslpc_release(u_long arg);
489static void mgslpc_detach(struct pcmcia_device *p_dev); 489static void mgslpc_detach(struct pcmcia_device *p_dev);
490 490
@@ -533,9 +533,10 @@ static void ldisc_receive_buf(struct tty_struct *tty,
533 } 533 }
534} 534}
535 535
536static int mgslpc_attach(struct pcmcia_device *link) 536static int mgslpc_probe(struct pcmcia_device *link)
537{ 537{
538 MGSLPC_INFO *info; 538 MGSLPC_INFO *info;
539 int ret;
539 540
540 if (debug_level >= DEBUG_LEVEL_INFO) 541 if (debug_level >= DEBUG_LEVEL_INFO)
541 printk("mgslpc_attach\n"); 542 printk("mgslpc_attach\n");
@@ -578,7 +579,9 @@ static int mgslpc_attach(struct pcmcia_device *link)
578 link->conf.IntType = INT_MEMORY_AND_IO; 579 link->conf.IntType = INT_MEMORY_AND_IO;
579 580
580 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 581 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
581 mgslpc_config(link); 582 ret = mgslpc_config(link);
583 if (ret)
584 return ret;
582 585
583 mgslpc_add_device(info); 586 mgslpc_add_device(info);
584 587
@@ -591,7 +594,7 @@ static int mgslpc_attach(struct pcmcia_device *link)
591#define CS_CHECK(fn, ret) \ 594#define CS_CHECK(fn, ret) \
592do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 595do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
593 596
594static void mgslpc_config(struct pcmcia_device *link) 597static int mgslpc_config(struct pcmcia_device *link)
595{ 598{
596 MGSLPC_INFO *info = link->priv; 599 MGSLPC_INFO *info = link->priv;
597 tuple_t tuple; 600 tuple_t tuple;
@@ -680,11 +683,12 @@ static void mgslpc_config(struct pcmcia_device *link)
680 printk("\n"); 683 printk("\n");
681 684
682 link->state &= ~DEV_CONFIG_PENDING; 685 link->state &= ~DEV_CONFIG_PENDING;
683 return; 686 return 0;
684 687
685cs_failed: 688cs_failed:
686 cs_error(link, last_fn, last_ret); 689 cs_error(link, last_fn, last_ret);
687 mgslpc_release((u_long)link); 690 mgslpc_release((u_long)link);
691 return -ENODEV;
688} 692}
689 693
690/* Card has been removed. 694/* Card has been removed.
@@ -3003,7 +3007,7 @@ static struct pcmcia_driver mgslpc_driver = {
3003 .drv = { 3007 .drv = {
3004 .name = "synclink_cs", 3008 .name = "synclink_cs",
3005 }, 3009 },
3006 .probe = mgslpc_attach, 3010 .probe = mgslpc_probe,
3007 .remove = mgslpc_detach, 3011 .remove = mgslpc_detach,
3008 .id_table = mgslpc_ids, 3012 .id_table = mgslpc_ids,
3009 .suspend = mgslpc_suspend, 3013 .suspend = mgslpc_suspend,