diff options
Diffstat (limited to 'drivers/usb/host/sl811_cs.c')
-rw-r--r-- | drivers/usb/host/sl811_cs.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index 8e61faa120fc..bfa8b213e137 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c | |||
@@ -71,7 +71,7 @@ typedef struct local_info_t { | |||
71 | dev_node_t node; | 71 | dev_node_t node; |
72 | } local_info_t; | 72 | } local_info_t; |
73 | 73 | ||
74 | static void sl811_cs_release(dev_link_t * link); | 74 | static void sl811_cs_release(struct pcmcia_device * link); |
75 | 75 | ||
76 | /*====================================================================*/ | 76 | /*====================================================================*/ |
77 | 77 | ||
@@ -138,10 +138,8 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq) | |||
138 | 138 | ||
139 | /*====================================================================*/ | 139 | /*====================================================================*/ |
140 | 140 | ||
141 | static void sl811_cs_detach(struct pcmcia_device *p_dev) | 141 | static void sl811_cs_detach(struct pcmcia_device *link) |
142 | { | 142 | { |
143 | dev_link_t *link = dev_to_instance(p_dev); | ||
144 | |||
145 | DBG(0, "sl811_cs_detach(0x%p)\n", link); | 143 | DBG(0, "sl811_cs_detach(0x%p)\n", link); |
146 | 144 | ||
147 | link->state &= ~DEV_PRESENT; | 145 | link->state &= ~DEV_PRESENT; |
@@ -152,18 +150,17 @@ static void sl811_cs_detach(struct pcmcia_device *p_dev) | |||
152 | kfree(link->priv); | 150 | kfree(link->priv); |
153 | } | 151 | } |
154 | 152 | ||
155 | static void sl811_cs_release(dev_link_t * link) | 153 | static void sl811_cs_release(struct pcmcia_device * link) |
156 | { | 154 | { |
157 | DBG(0, "sl811_cs_release(0x%p)\n", link); | 155 | DBG(0, "sl811_cs_release(0x%p)\n", link); |
158 | 156 | ||
159 | pcmcia_disable_device(link->handle); | 157 | pcmcia_disable_device(link); |
160 | platform_device_unregister(&platform_dev); | 158 | platform_device_unregister(&platform_dev); |
161 | } | 159 | } |
162 | 160 | ||
163 | static void sl811_cs_config(dev_link_t *link) | 161 | static void sl811_cs_config(struct pcmcia_device *link) |
164 | { | 162 | { |
165 | client_handle_t handle = link->handle; | 163 | struct device *parent = &handle_to_dev(link); |
166 | struct device *parent = &handle_to_dev(handle); | ||
167 | local_info_t *dev = link->priv; | 164 | local_info_t *dev = link->priv; |
168 | tuple_t tuple; | 165 | tuple_t tuple; |
169 | cisparse_t parse; | 166 | cisparse_t parse; |
@@ -179,9 +176,9 @@ static void sl811_cs_config(dev_link_t *link) | |||
179 | tuple.TupleData = buf; | 176 | tuple.TupleData = buf; |
180 | tuple.TupleDataMax = sizeof(buf); | 177 | tuple.TupleDataMax = sizeof(buf); |
181 | tuple.TupleOffset = 0; | 178 | tuple.TupleOffset = 0; |
182 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 179 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
183 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); | 180 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
184 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); | 181 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); |
185 | link->conf.ConfigBase = parse.config.base; | 182 | link->conf.ConfigBase = parse.config.base; |
186 | link->conf.Present = parse.config.rmask[0]; | 183 | link->conf.Present = parse.config.rmask[0]; |
187 | 184 | ||
@@ -190,15 +187,15 @@ static void sl811_cs_config(dev_link_t *link) | |||
190 | 187 | ||
191 | /* Look up the current Vcc */ | 188 | /* Look up the current Vcc */ |
192 | CS_CHECK(GetConfigurationInfo, | 189 | CS_CHECK(GetConfigurationInfo, |
193 | pcmcia_get_configuration_info(handle, &conf)); | 190 | pcmcia_get_configuration_info(link, &conf)); |
194 | 191 | ||
195 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 192 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
196 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 193 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
197 | while (1) { | 194 | while (1) { |
198 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); | 195 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); |
199 | 196 | ||
200 | if (pcmcia_get_tuple_data(handle, &tuple) != 0 | 197 | if (pcmcia_get_tuple_data(link, &tuple) != 0 |
201 | || pcmcia_parse_tuple(handle, &tuple, &parse) | 198 | || pcmcia_parse_tuple(link, &tuple, &parse) |
202 | != 0) | 199 | != 0) |
203 | goto next_entry; | 200 | goto next_entry; |
204 | 201 | ||
@@ -244,14 +241,14 @@ static void sl811_cs_config(dev_link_t *link) | |||
244 | link->io.BasePort1 = io->win[0].base; | 241 | link->io.BasePort1 = io->win[0].base; |
245 | link->io.NumPorts1 = io->win[0].len; | 242 | link->io.NumPorts1 = io->win[0].len; |
246 | 243 | ||
247 | if (pcmcia_request_io(link->handle, &link->io) != 0) | 244 | if (pcmcia_request_io(link, &link->io) != 0) |
248 | goto next_entry; | 245 | goto next_entry; |
249 | } | 246 | } |
250 | break; | 247 | break; |
251 | 248 | ||
252 | next_entry: | 249 | next_entry: |
253 | pcmcia_disable_device(handle); | 250 | pcmcia_disable_device(link); |
254 | last_ret = pcmcia_get_next_tuple(handle, &tuple); | 251 | last_ret = pcmcia_get_next_tuple(link, &tuple); |
255 | } | 252 | } |
256 | 253 | ||
257 | /* require an IRQ and two registers */ | 254 | /* require an IRQ and two registers */ |
@@ -259,12 +256,12 @@ next_entry: | |||
259 | goto cs_failed; | 256 | goto cs_failed; |
260 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 257 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
261 | CS_CHECK(RequestIRQ, | 258 | CS_CHECK(RequestIRQ, |
262 | pcmcia_request_irq(link->handle, &link->irq)); | 259 | pcmcia_request_irq(link, &link->irq)); |
263 | else | 260 | else |
264 | goto cs_failed; | 261 | goto cs_failed; |
265 | 262 | ||
266 | CS_CHECK(RequestConfiguration, | 263 | CS_CHECK(RequestConfiguration, |
267 | pcmcia_request_configuration(link->handle, &link->conf)); | 264 | pcmcia_request_configuration(link, &link->conf)); |
268 | 265 | ||
269 | sprintf(dev->node.dev_name, driver_name); | 266 | sprintf(dev->node.dev_name, driver_name); |
270 | dev->node.major = dev->node.minor = 0; | 267 | dev->node.major = dev->node.minor = 0; |
@@ -285,22 +282,21 @@ next_entry: | |||
285 | < 0) { | 282 | < 0) { |
286 | cs_failed: | 283 | cs_failed: |
287 | printk("sl811_cs_config failed\n"); | 284 | printk("sl811_cs_config failed\n"); |
288 | cs_error(link->handle, last_fn, last_ret); | 285 | cs_error(link, last_fn, last_ret); |
289 | sl811_cs_release(link); | 286 | sl811_cs_release(link); |
290 | link->state &= ~DEV_CONFIG_PENDING; | 287 | link->state &= ~DEV_CONFIG_PENDING; |
291 | } | 288 | } |
292 | } | 289 | } |
293 | 290 | ||
294 | static int sl811_cs_attach(struct pcmcia_device *p_dev) | 291 | static int sl811_cs_attach(struct pcmcia_device *link) |
295 | { | 292 | { |
296 | local_info_t *local; | 293 | local_info_t *local; |
297 | dev_link_t *link = dev_to_instance(p_dev); | ||
298 | 294 | ||
299 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); | 295 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); |
300 | if (!local) | 296 | if (!local) |
301 | return -ENOMEM; | 297 | return -ENOMEM; |
302 | memset(local, 0, sizeof(local_info_t)); | 298 | memset(local, 0, sizeof(local_info_t)); |
303 | local->p_dev = p_dev; | 299 | local->p_dev = link; |
304 | link->priv = local; | 300 | link->priv = local; |
305 | 301 | ||
306 | /* Initialize */ | 302 | /* Initialize */ |