aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-24 09:55:39 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:05 -0500
commit9b44de2015ff4a2ed1d56efedfcc72b917d356a6 (patch)
tree63460e0cf95d4bbea0111d153247c3298ac4ff3d /drivers/parport
parent7c5af6ffd69bb2bb3c86b374153627529d67598c (diff)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_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: linux-mtd@lists.infradead.org CC: linux-usb@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/parport_cs.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 8fdfa4f537a6..e56a4dea6717 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -67,14 +67,6 @@ MODULE_LICENSE("Dual MPL/GPL");
67 67
68INT_MODULE_PARM(epp_mode, 1); 68INT_MODULE_PARM(epp_mode, 1);
69 69
70#ifdef PCMCIA_DEBUG
71INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
72#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
73static char *version =
74"parport_cs.c 1.29 2002/10/11 06:57:41 (David Hinds)";
75#else
76#define DEBUG(n, args...)
77#endif
78 70
79/*====================================================================*/ 71/*====================================================================*/
80 72
@@ -103,7 +95,7 @@ static int parport_probe(struct pcmcia_device *link)
103{ 95{
104 parport_info_t *info; 96 parport_info_t *info;
105 97
106 DEBUG(0, "parport_attach()\n"); 98 dev_dbg(&link->dev, "parport_attach()\n");
107 99
108 /* Create new parport device */ 100 /* Create new parport device */
109 info = kzalloc(sizeof(*info), GFP_KERNEL); 101 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -132,7 +124,7 @@ static int parport_probe(struct pcmcia_device *link)
132 124
133static void parport_detach(struct pcmcia_device *link) 125static void parport_detach(struct pcmcia_device *link)
134{ 126{
135 DEBUG(0, "parport_detach(0x%p)\n", link); 127 dev_dbg(&link->dev, "parport_detach\n");
136 128
137 parport_cs_release(link); 129 parport_cs_release(link);
138 130
@@ -147,9 +139,6 @@ static void parport_detach(struct pcmcia_device *link)
147 139
148======================================================================*/ 140======================================================================*/
149 141
150#define CS_CHECK(fn, ret) \
151do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
152
153static int parport_config_check(struct pcmcia_device *p_dev, 142static int parport_config_check(struct pcmcia_device *p_dev,
154 cistpl_cftable_entry_t *cfg, 143 cistpl_cftable_entry_t *cfg,
155 cistpl_cftable_entry_t *dflt, 144 cistpl_cftable_entry_t *dflt,
@@ -178,18 +167,20 @@ static int parport_config(struct pcmcia_device *link)
178{ 167{
179 parport_info_t *info = link->priv; 168 parport_info_t *info = link->priv;
180 struct parport *p; 169 struct parport *p;
181 int last_ret, last_fn; 170 int ret;
182 171
183 DEBUG(0, "parport_config(0x%p)\n", link); 172 dev_dbg(&link->dev, "parport_config\n");
184 173
185 last_ret = pcmcia_loop_config(link, parport_config_check, NULL); 174 ret = pcmcia_loop_config(link, parport_config_check, NULL);
186 if (last_ret) { 175 if (ret)
187 cs_error(link, RequestIO, last_ret);
188 goto failed; 176 goto failed;
189 }
190 177
191 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 178 ret = pcmcia_request_irq(link, &link->irq);
192 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 179 if (ret)
180 goto failed;
181 ret = pcmcia_request_configuration(link, &link->conf);
182 if (ret)
183 goto failed;
193 184
194 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2, 185 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2,
195 link->irq.AssignedIRQ, PARPORT_DMA_NONE, 186 link->irq.AssignedIRQ, PARPORT_DMA_NONE,
@@ -213,8 +204,6 @@ static int parport_config(struct pcmcia_device *link)
213 204
214 return 0; 205 return 0;
215 206
216cs_failed:
217 cs_error(link, last_fn, last_ret);
218failed: 207failed:
219 parport_cs_release(link); 208 parport_cs_release(link);
220 return -ENODEV; 209 return -ENODEV;
@@ -232,7 +221,7 @@ static void parport_cs_release(struct pcmcia_device *link)
232{ 221{
233 parport_info_t *info = link->priv; 222 parport_info_t *info = link->priv;
234 223
235 DEBUG(0, "parport_release(0x%p)\n", link); 224 dev_dbg(&link->dev, "parport_release\n");
236 225
237 if (info->ndev) { 226 if (info->ndev) {
238 struct parport *p = info->port; 227 struct parport *p = info->port;