aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport/parport_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parport/parport_cs.c')
-rw-r--r--drivers/parport/parport_cs.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 8fdfa4f537a6..7dd370fa3439 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);
@@ -114,7 +106,6 @@ static int parport_probe(struct pcmcia_device *link)
114 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
115 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 107 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
116 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 108 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
117 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
118 link->conf.Attributes = CONF_ENABLE_IRQ; 109 link->conf.Attributes = CONF_ENABLE_IRQ;
119 link->conf.IntType = INT_MEMORY_AND_IO; 110 link->conf.IntType = INT_MEMORY_AND_IO;
120 111
@@ -132,7 +123,7 @@ static int parport_probe(struct pcmcia_device *link)
132 123
133static void parport_detach(struct pcmcia_device *link) 124static void parport_detach(struct pcmcia_device *link)
134{ 125{
135 DEBUG(0, "parport_detach(0x%p)\n", link); 126 dev_dbg(&link->dev, "parport_detach\n");
136 127
137 parport_cs_release(link); 128 parport_cs_release(link);
138 129
@@ -147,9 +138,6 @@ static void parport_detach(struct pcmcia_device *link)
147 138
148======================================================================*/ 139======================================================================*/
149 140
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, 141static int parport_config_check(struct pcmcia_device *p_dev,
154 cistpl_cftable_entry_t *cfg, 142 cistpl_cftable_entry_t *cfg,
155 cistpl_cftable_entry_t *dflt, 143 cistpl_cftable_entry_t *dflt,
@@ -178,18 +166,20 @@ static int parport_config(struct pcmcia_device *link)
178{ 166{
179 parport_info_t *info = link->priv; 167 parport_info_t *info = link->priv;
180 struct parport *p; 168 struct parport *p;
181 int last_ret, last_fn; 169 int ret;
182 170
183 DEBUG(0, "parport_config(0x%p)\n", link); 171 dev_dbg(&link->dev, "parport_config\n");
184 172
185 last_ret = pcmcia_loop_config(link, parport_config_check, NULL); 173 ret = pcmcia_loop_config(link, parport_config_check, NULL);
186 if (last_ret) { 174 if (ret)
187 cs_error(link, RequestIO, last_ret);
188 goto failed; 175 goto failed;
189 }
190 176
191 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 177 ret = pcmcia_request_irq(link, &link->irq);
192 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 178 if (ret)
179 goto failed;
180 ret = pcmcia_request_configuration(link, &link->conf);
181 if (ret)
182 goto failed;
193 183
194 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2, 184 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2,
195 link->irq.AssignedIRQ, PARPORT_DMA_NONE, 185 link->irq.AssignedIRQ, PARPORT_DMA_NONE,
@@ -213,8 +203,6 @@ static int parport_config(struct pcmcia_device *link)
213 203
214 return 0; 204 return 0;
215 205
216cs_failed:
217 cs_error(link, last_fn, last_ret);
218failed: 206failed:
219 parport_cs_release(link); 207 parport_cs_release(link);
220 return -ENODEV; 208 return -ENODEV;
@@ -232,7 +220,7 @@ static void parport_cs_release(struct pcmcia_device *link)
232{ 220{
233 parport_info_t *info = link->priv; 221 parport_info_t *info = link->priv;
234 222
235 DEBUG(0, "parport_release(0x%p)\n", link); 223 dev_dbg(&link->dev, "parport_release\n");
236 224
237 if (info->ndev) { 225 if (info->ndev) {
238 struct parport *p = info->port; 226 struct parport *p = info->port;