aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/pcmcia_ioctl.c')
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 7631faa0cadd..ef0c5f133691 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -301,7 +301,9 @@ static int pccard_get_status(struct pcmcia_socket *s,
301 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) { 301 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) {
302 u_char reg; 302 u_char reg;
303 if (c->CardValues & PRESENT_PIN_REPLACE) { 303 if (c->CardValues & PRESENT_PIN_REPLACE) {
304 mutex_lock(&s->ops_mutex);
304 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg); 305 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg);
306 mutex_unlock(&s->ops_mutex);
305 status->CardState |= 307 status->CardState |=
306 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0; 308 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0;
307 status->CardState |= 309 status->CardState |=
@@ -315,7 +317,9 @@ static int pccard_get_status(struct pcmcia_socket *s,
315 status->CardState |= CS_EVENT_READY_CHANGE; 317 status->CardState |= CS_EVENT_READY_CHANGE;
316 } 318 }
317 if (c->CardValues & PRESENT_EXT_STATUS) { 319 if (c->CardValues & PRESENT_EXT_STATUS) {
320 mutex_lock(&s->ops_mutex);
318 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg); 321 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg);
322 mutex_unlock(&s->ops_mutex);
319 status->CardState |= 323 status->CardState |=
320 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; 324 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0;
321 } 325 }
@@ -351,7 +355,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
351 if (s->state & SOCKET_CARDBUS_CONFIG) { 355 if (s->state & SOCKET_CARDBUS_CONFIG) {
352 config->Attributes = CONF_VALID_CLIENT; 356 config->Attributes = CONF_VALID_CLIENT;
353 config->IntType = INT_CARDBUS; 357 config->IntType = INT_CARDBUS;
354 config->AssignedIRQ = s->irq.AssignedIRQ; 358 config->AssignedIRQ = s->pcmcia_irq;
355 if (config->AssignedIRQ) 359 if (config->AssignedIRQ)
356 config->Attributes |= CONF_ENABLE_IRQ; 360 config->Attributes |= CONF_ENABLE_IRQ;
357 if (s->io[0].res) { 361 if (s->io[0].res) {
@@ -391,7 +395,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
391 config->ExtStatus = c->ExtStatus; 395 config->ExtStatus = c->ExtStatus;
392 config->Present = config->CardValues = c->CardValues; 396 config->Present = config->CardValues = c->CardValues;
393 config->IRQAttributes = c->irq.Attributes; 397 config->IRQAttributes = c->irq.Attributes;
394 config->AssignedIRQ = s->irq.AssignedIRQ; 398 config->AssignedIRQ = s->pcmcia_irq;
395 config->BasePort1 = c->io.BasePort1; 399 config->BasePort1 = c->io.BasePort1;
396 config->NumPorts1 = c->io.NumPorts1; 400 config->NumPorts1 = c->io.NumPorts1;
397 config->Attributes1 = c->io.Attributes1; 401 config->Attributes1 = c->io.Attributes1;
@@ -571,7 +575,6 @@ static struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s)
571 575
572static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int first) 576static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int first)
573{ 577{
574 dev_node_t *node;
575 struct pcmcia_device *p_dev; 578 struct pcmcia_device *p_dev;
576 struct pcmcia_driver *p_drv; 579 struct pcmcia_driver *p_drv;
577 int ret = 0; 580 int ret = 0;
@@ -633,21 +636,13 @@ static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int
633 goto err_put; 636 goto err_put;
634 } 637 }
635 638
636 if (first) 639 if (!first) {
637 node = p_dev->dev_node;
638 else
639 for (node = p_dev->dev_node; node; node = node->next)
640 if (node == bind_info->next)
641 break;
642 if (!node) {
643 ret = -ENODEV; 640 ret = -ENODEV;
644 goto err_put; 641 goto err_put;
645 } 642 }
646 643
647 strlcpy(bind_info->name, node->dev_name, DEV_NAME_LEN); 644 strlcpy(bind_info->name, dev_name(&p_dev->dev), DEV_NAME_LEN);
648 bind_info->major = node->major; 645 bind_info->next = NULL;
649 bind_info->minor = node->minor;
650 bind_info->next = node->next;
651 646
652 err_put: 647 err_put:
653 pcmcia_put_dev(p_dev); 648 pcmcia_put_dev(p_dev);