summaryrefslogtreecommitdiff
path: root/drivers/char/pcmcia/synclink_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-24 15:47:29 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 08:29:48 +0100
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)
/* Card has been inserted.
*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
@@ -598,15 +595,14 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
static int mgslpc_config(struct pcmcia_device *link)
{
MGSLPC_INFO *info = link->priv;
- int last_fn = RequestIO;
- int last_ret;
+ int ret;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_config(0x%p)\n", link);
- last_ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL);
- if (last_ret != 0)
- goto cs_failed;
+ ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL);
+ if (ret != 0)
+ goto failed;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@@ -616,9 +612,13 @@ static int mgslpc_config(struct pcmcia_device *link)
link->irq.Attributes |= IRQ_HANDLE_PRESENT;
link->irq.Handler = mgslpc_isr;
link->irq.Instance = info;
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
info->io_base = link->io.BasePort1;
info->irq_level = link->irq.AssignedIRQ;
@@ -638,8 +638,7 @@ static int mgslpc_config(struct pcmcia_device *link)
printk("\n");
return 0;
-cs_failed:
- cs_error(link, last_fn, last_ret);
+failed:
mgslpc_release((u_long)link);
return -ENODEV;
}