From c1ac02280d76de7aba8a9d43638d0f7d1fd0f820 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 14 Jun 2008 18:51:06 +0200 Subject: pcmcia: check for pointer instead of pointer address Bug noted by Michael Buesch: checking for the pointer address is always true. This didn't matter much, for the very first check in pcmcia_release_window() was for the pointer pointing to something, and the return value is ignored here. Nonetheless, fix it. CC: Michael Buesch Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pcmcia/pcmcia_resource.c') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 1d128fbd1a9..c8f77b889d4 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -966,7 +966,7 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) { pcmcia_release_configuration(p_dev); pcmcia_release_io(p_dev, &p_dev->io); pcmcia_release_irq(p_dev, &p_dev->irq); - if (&p_dev->win) + if (p_dev->win) pcmcia_release_window(p_dev->win); } EXPORT_SYMBOL(pcmcia_disable_device); -- cgit v1.2.3 From 635416ef393e8cec5a89fc6c1de710ee9596a51e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 16 Jun 2008 14:35:15 +0200 Subject: pcmcia: irq probe can be done without risking an IRQ storm Nowdays you can ask for an IRQ to be allocated but not enabled, when PCMCIA was written this was not true and this feature is thus not used [linux@dominikbrodowski.net: add comment and ifdef to avoid compilation breakage at least on alpha] Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/pcmcia/pcmcia_resource.c') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index c8f77b889d4..78af5941593 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -812,6 +812,15 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) type = IRQF_SHARED; #ifdef CONFIG_PCMCIA_PROBE + +#ifdef IRQ_NOAUTOEN + /* if the underlying IRQ infrastructure allows for it, only allocate + * the IRQ, but do not enable it + */ + if (!(req->Attributes & IRQ_HANDLE_PRESENT)) + type |= IRQ_NOAUTOEN; +#endif /* IRQ_NOAUTOEN */ + if (s->irq.AssignedIRQ != 0) { /* If the interrupt is already assigned, it must be the same */ irq = s->irq.AssignedIRQ; -- cgit v1.2.3 From ae49ec9258b1ba0456f5d2e9024d0e4742a0188b Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 19 Jun 2008 20:49:41 +0200 Subject: pcmcia: remove unused bulkmem.h The code in include/pcmcia/bulkmem.h was only kept for compatibility reasons. Therefore, move the remaining region_info_t definition to ds.h [linux@dominikbrodowski.net: do not modify the IOCTL, move definition to ds.h, and update changelog] Signed-off-by: Magnus Damm Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/pcmcia/pcmcia_resource.c') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 78af5941593..2d3e3fe66ee 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 6351a71cfae2839cf6e63329d3d85eb46a4bc2c7 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Thu, 17 Apr 2008 12:36:54 +0300 Subject: pcmcia: kill IN_CARD_SERVICES IN_CARD_SERVICES was #define'd but not used, so let's remove it. Signed-off-by: Adrian Bunk Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/pcmcia/pcmcia_resource.c') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 2d3e3fe66ee..cb6b5da3f29 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -21,7 +21,6 @@ #include #include -#define IN_CARD_SERVICES #include #include #include -- cgit v1.2.3 From 4aeba0134f1e54cfd881e118b039ab6ed8b99126 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 20 Jun 2008 13:24:31 +0200 Subject: pcmcia: (re)move {pcmcia,pccard}_get_status Except for one debug message in a driver marked BROKEN, pcmcia_get_status is only used by the ioctl. Therefore, move it to pcmcia_ioctl.c and unexport it. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/pcmcia_resource.c | 68 ---------------------------------------- 1 file changed, 68 deletions(-) (limited to 'drivers/pcmcia/pcmcia_resource.c') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index cb6b5da3f29..4884a18cf9e 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -309,74 +309,6 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, EXPORT_SYMBOL(pcmcia_get_window); -/** pccard_get_status - * - * Get the current socket state bits. We don't support the latched - * SocketState yet: I haven't seen any point for it. - */ - -int pccard_get_status(struct pcmcia_socket *s, struct pcmcia_device *p_dev, - cs_status_t *status) -{ - config_t *c; - int val; - - s->ops->get_status(s, &val); - status->CardState = status->SocketState = 0; - status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0; - status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0; - status->CardState |= (val & SS_3VCARD) ? CS_EVENT_3VCARD : 0; - status->CardState |= (val & SS_XVCARD) ? CS_EVENT_XVCARD : 0; - if (s->state & SOCKET_SUSPEND) - status->CardState |= CS_EVENT_PM_SUSPEND; - if (!(s->state & SOCKET_PRESENT)) - return CS_NO_CARD; - - c = (p_dev) ? p_dev->function_config : NULL; - - if ((c != NULL) && (c->state & CONFIG_LOCKED) && - (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) { - u_char reg; - if (c->CardValues & PRESENT_PIN_REPLACE) { - pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, ®); - status->CardState |= - (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0; - status->CardState |= - (reg & PRR_READY_STATUS) ? CS_EVENT_READY_CHANGE : 0; - status->CardState |= - (reg & PRR_BVD2_STATUS) ? CS_EVENT_BATTERY_LOW : 0; - status->CardState |= - (reg & PRR_BVD1_STATUS) ? CS_EVENT_BATTERY_DEAD : 0; - } else { - /* No PRR? Then assume we're always ready */ - status->CardState |= CS_EVENT_READY_CHANGE; - } - if (c->CardValues & PRESENT_EXT_STATUS) { - pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, ®); - status->CardState |= - (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0; - } - return CS_SUCCESS; - } - status->CardState |= - (val & SS_WRPROT) ? CS_EVENT_WRITE_PROTECT : 0; - status->CardState |= - (val & SS_BATDEAD) ? CS_EVENT_BATTERY_DEAD : 0; - status->CardState |= - (val & SS_BATWARN) ? CS_EVENT_BATTERY_LOW : 0; - status->CardState |= - (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0; - return CS_SUCCESS; -} /* pccard_get_status */ - -int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status) -{ - return pccard_get_status(p_dev->socket, p_dev, status); -} -EXPORT_SYMBOL(pcmcia_get_status); - - - /** pcmcia_get_mem_page * * Change the card address of an already open memory window. -- cgit v1.2.3