diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 11:24:46 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-28 12:03:14 -0500 |
commit | 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (patch) | |
tree | 2bf23e13308ef683302ff5a92af0ae8bc37c1b60 /drivers/char/pcmcia | |
parent | dd2e5a156525f11754d9b1e0583f6bb49c253d62 (diff) |
pcmcia: rework the irq_req_t typedef
Most of the irq_req_t typedef'd struct can be re-worked quite
easily:
(1) IRQInfo2 was unused in any case, so drop it.
(2) IRQInfo1 was used write-only, so drop it.
(3) Instance (private data to be passed to the IRQ handler):
Most PCMCIA drivers using pcmcia_request_irq() to actually
register an IRQ handler set the "dev_id" to the same pointer
as the "priv" pointer in struct pcmcia_device. Modify the two
exceptions (ipwireless, ibmtr_cs) to also work this waym and
set the IRQ handler's "dev_id" to p_dev->priv unconditionally.
(4) Handler is to be of type irq_handler_t.
(5) Handler != NULL already tells whether an IRQ handler is present.
Therefore, we do not need the IRQ_HANDLER_PRESENT flag in
irq_req_t.Attributes.
CC: netdev@vger.kernel.org
CC: linux-bluetooth@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: Jaroslav Kysela <perex@perex.cz>
CC: Jiri Kosina <jkosina@suse.cz>
CC: Karsten Keil <isdn@linux-pingi.de>
for the Bluetooth parts: Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r-- | drivers/char/pcmcia/ipwireless/hardware.c | 8 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/main.c | 6 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 3 |
3 files changed, 5 insertions, 12 deletions
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c index 4c1820cad712..99cffdab1056 100644 --- a/drivers/char/pcmcia/ipwireless/hardware.c +++ b/drivers/char/pcmcia/ipwireless/hardware.c | |||
@@ -1213,12 +1213,12 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, | |||
1213 | 1213 | ||
1214 | irqreturn_t ipwireless_interrupt(int irq, void *dev_id) | 1214 | irqreturn_t ipwireless_interrupt(int irq, void *dev_id) |
1215 | { | 1215 | { |
1216 | struct ipw_hardware *hw = dev_id; | 1216 | struct ipw_dev *ipw = dev_id; |
1217 | 1217 | ||
1218 | if (hw->hw_version == HW_VERSION_1) | 1218 | if (ipw->hardware->hw_version == HW_VERSION_1) |
1219 | return ipwireless_handle_v1_interrupt(irq, hw); | 1219 | return ipwireless_handle_v1_interrupt(irq, ipw->hardware); |
1220 | else | 1220 | else |
1221 | return ipwireless_handle_v2_v3_interrupt(irq, hw); | 1221 | return ipwireless_handle_v2_v3_interrupt(irq, ipw->hardware); |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | static void flush_packets_to_hw(struct ipw_hardware *hw) | 1224 | static void flush_packets_to_hw(struct ipw_hardware *hw) |
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c index 082146a26c87..dff24dae1485 100644 --- a/drivers/char/pcmcia/ipwireless/main.c +++ b/drivers/char/pcmcia/ipwireless/main.c | |||
@@ -93,8 +93,6 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
93 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | 93 | p_dev->io.NumPorts1 = cfg->io.win[0].len; |
94 | p_dev->io.IOAddrLines = 16; | 94 | p_dev->io.IOAddrLines = 16; |
95 | 95 | ||
96 | p_dev->irq.IRQInfo1 = cfg->irq.IRQInfo1; | ||
97 | |||
98 | /* 0x40 causes it to generate level mode interrupts. */ | 96 | /* 0x40 causes it to generate level mode interrupts. */ |
99 | /* 0x04 enables IREQ pin. */ | 97 | /* 0x04 enables IREQ pin. */ |
100 | p_dev->conf.ConfigIndex = cfg->index | 0x44; | 98 | p_dev->conf.ConfigIndex = cfg->index | 0x44; |
@@ -197,9 +195,8 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
197 | link->conf.Attributes = CONF_ENABLE_IRQ; | 195 | link->conf.Attributes = CONF_ENABLE_IRQ; |
198 | link->conf.IntType = INT_MEMORY_AND_IO; | 196 | link->conf.IntType = INT_MEMORY_AND_IO; |
199 | 197 | ||
200 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; | 198 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
201 | link->irq.Handler = ipwireless_interrupt; | 199 | link->irq.Handler = ipwireless_interrupt; |
202 | link->irq.Instance = ipw->hardware; | ||
203 | 200 | ||
204 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); | 201 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); |
205 | 202 | ||
@@ -315,7 +312,6 @@ static int ipwireless_attach(struct pcmcia_device *link) | |||
315 | 312 | ||
316 | ipw->link = link; | 313 | ipw->link = link; |
317 | link->priv = ipw; | 314 | link->priv = ipw; |
318 | link->irq.Instance = ipw; | ||
319 | 315 | ||
320 | /* Link this device into our device list. */ | 316 | /* Link this device into our device list. */ |
321 | link->dev_node = &ipw->nodes[0]; | 317 | link->dev_node = &ipw->nodes[0]; |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 09b2590adb8b..c31a0d913d37 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -554,7 +554,6 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
554 | 554 | ||
555 | /* Interrupt setup */ | 555 | /* Interrupt setup */ |
556 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; | 556 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
557 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
558 | link->irq.Handler = NULL; | 557 | link->irq.Handler = NULL; |
559 | 558 | ||
560 | link->conf.Attributes = 0; | 559 | link->conf.Attributes = 0; |
@@ -609,9 +608,7 @@ static int mgslpc_config(struct pcmcia_device *link) | |||
609 | link->conf.ConfigIndex = 8; | 608 | link->conf.ConfigIndex = 8; |
610 | link->conf.Present = PRESENT_OPTION; | 609 | link->conf.Present = PRESENT_OPTION; |
611 | 610 | ||
612 | link->irq.Attributes |= IRQ_HANDLE_PRESENT; | ||
613 | link->irq.Handler = mgslpc_isr; | 611 | link->irq.Handler = mgslpc_isr; |
614 | link->irq.Instance = info; | ||
615 | 612 | ||
616 | ret = pcmcia_request_irq(link, &link->irq); | 613 | ret = pcmcia_request_irq(link, &link->irq); |
617 | if (ret) | 614 | if (ret) |