aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/synclink_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-24 09:47:29 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:29:48 -0500
commitcbf624f0e18c4a05219855663a3e5f9fe8f2d876 (patch)
tree8aac18761959b45a29faaca79926966b46ac57d1 /drivers/char/pcmcia/synclink_cs.c
parent9ac3e58ceff0b7b8b981c09c38a28742270eea12 (diff)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (char)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG. Only some rare extra debug checks in cm4000_cs.c cm4040_cs.c are now hidden behind a "#ifdef CM4000_DEBUG" or "#ifdef CM4040_DEBUG". Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors. CC: Harald Welte <laforge@gnumonks.org> CC: Jiri Kosina <jkosina@suse.cz> CC: David Sterba <dsterba@suse.cz> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia/synclink_cs.c')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 429b7313119b..09b2590adb8b 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -572,9 +572,6 @@ static int mgslpc_probe(struct pcmcia_device *link)
572/* Card has been inserted. 572/* Card has been inserted.
573 */ 573 */
574 574
575#define CS_CHECK(fn, ret) \
576do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
577
578static int mgslpc_ioprobe(struct pcmcia_device *p_dev, 575static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
579 cistpl_cftable_entry_t *cfg, 576 cistpl_cftable_entry_t *cfg,
580 cistpl_cftable_entry_t *dflt, 577 cistpl_cftable_entry_t *dflt,
@@ -598,15 +595,14 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
598static int mgslpc_config(struct pcmcia_device *link) 595static int mgslpc_config(struct pcmcia_device *link)
599{ 596{
600 MGSLPC_INFO *info = link->priv; 597 MGSLPC_INFO *info = link->priv;
601 int last_fn = RequestIO; 598 int ret;
602 int last_ret;
603 599
604 if (debug_level >= DEBUG_LEVEL_INFO) 600 if (debug_level >= DEBUG_LEVEL_INFO)
605 printk("mgslpc_config(0x%p)\n", link); 601 printk("mgslpc_config(0x%p)\n", link);
606 602
607 last_ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL); 603 ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL);
608 if (last_ret != 0) 604 if (ret != 0)
609 goto cs_failed; 605 goto failed;
610 606
611 link->conf.Attributes = CONF_ENABLE_IRQ; 607 link->conf.Attributes = CONF_ENABLE_IRQ;
612 link->conf.IntType = INT_MEMORY_AND_IO; 608 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -616,9 +612,13 @@ static int mgslpc_config(struct pcmcia_device *link)
616 link->irq.Attributes |= IRQ_HANDLE_PRESENT; 612 link->irq.Attributes |= IRQ_HANDLE_PRESENT;
617 link->irq.Handler = mgslpc_isr; 613 link->irq.Handler = mgslpc_isr;
618 link->irq.Instance = info; 614 link->irq.Instance = info;
619 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
620 615
621 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 616 ret = pcmcia_request_irq(link, &link->irq);
617 if (ret)
618 goto failed;
619 ret = pcmcia_request_configuration(link, &link->conf);
620 if (ret)
621 goto failed;
622 622
623 info->io_base = link->io.BasePort1; 623 info->io_base = link->io.BasePort1;
624 info->irq_level = link->irq.AssignedIRQ; 624 info->irq_level = link->irq.AssignedIRQ;
@@ -638,8 +638,7 @@ static int mgslpc_config(struct pcmcia_device *link)
638 printk("\n"); 638 printk("\n");
639 return 0; 639 return 0;
640 640
641cs_failed: 641failed:
642 cs_error(link, last_fn, last_ret);
643 mgslpc_release((u_long)link); 642 mgslpc_release((u_long)link);
644 return -ENODEV; 643 return -ENODEV;
645} 644}