aboutsummaryrefslogtreecommitdiff
path: root/drivers/parport
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-10-19 01:42:14 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-23 19:53:15 -0400
commit3f2e40df0e1d7694224c3083b0bebd129039a40a (patch)
tree3d0d8c2a9dd1f873e5638a132abc5d40c6ff583b /drivers/parport
parent01e7ae8c13bb06a2ce622ebace33bb7e28ef596c (diff)
[PARPORT] Consolidate code copies into a single generic irq handler
Several arches used the exact same code for their parport irq handling. Make that code generic, in parport_irq_handler(). Also, s/__inline__/inline/ in include/linux/parport.h. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/parport_amiga.c9
-rw-r--r--drivers/parport/parport_atari.c9
-rw-r--r--drivers/parport/parport_ax88796.c10
-rw-r--r--drivers/parport/parport_gsc.c8
-rw-r--r--drivers/parport/parport_ip32.c6
-rw-r--r--drivers/parport/parport_pc.c9
-rw-r--r--drivers/parport/parport_sunbpp.c8
-rw-r--r--drivers/parport/share.c10
8 files changed, 20 insertions, 49 deletions
diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c
index a0afaee5ebe..1586e1caa2f 100644
--- a/drivers/parport/parport_amiga.c
+++ b/drivers/parport/parport_amiga.c
@@ -137,13 +137,6 @@ static unsigned char amiga_read_status(struct parport *p)
return status;
}
-/* as this ports irq handling is already done, we use a generic funktion */
-static irqreturn_t amiga_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, (struct parport *) dev_id);
- return IRQ_HANDLED;
-}
-
static void amiga_enable_irq(struct parport *p)
{
enable_irq(IRQ_AMIGA_CIAA_FLG);
@@ -255,7 +248,7 @@ static int __init parport_amiga_init(void)
if (!p)
goto out_port;
- err = request_irq(IRQ_AMIGA_CIAA_FLG, amiga_interrupt, 0, p->name, p);
+ err = request_irq(IRQ_AMIGA_CIAA_FLG, parport_irq_handler, 0, p->name, p);
if (err)
goto out_irq;
diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c
index 6ea9929b8c7..ad4cdd25613 100644
--- a/drivers/parport/parport_atari.c
+++ b/drivers/parport/parport_atari.c
@@ -103,13 +103,6 @@ parport_atari_restore_state(struct parport *p, struct parport_state *s)
{
}
-static irqreturn_t
-parport_atari_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, (struct parport *) dev_id);
- return IRQ_HANDLED;
-}
-
static void
parport_atari_enable_irq(struct parport *p)
{
@@ -208,7 +201,7 @@ static int __init parport_atari_init(void)
&parport_atari_ops);
if (!p)
return -ENODEV;
- if (request_irq(IRQ_MFP_BUSY, parport_atari_interrupt,
+ if (request_irq(IRQ_MFP_BUSY, parport_irq_handler,
IRQ_TYPE_SLOW, p->name, p)) {
parport_put_port (p);
return -ENODEV;
diff --git a/drivers/parport/parport_ax88796.c b/drivers/parport/parport_ax88796.c
index 74f4e9742c6..4ec220b2eae 100644
--- a/drivers/parport/parport_ax88796.c
+++ b/drivers/parport/parport_ax88796.c
@@ -232,14 +232,6 @@ parport_ax88796_restore_state(struct parport *p, struct parport_state *s)
writeb(s->u.ax88796.cpr, dd->spp_cpr);
}
-static irqreturn_t
-parport_ax88796_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, dev_id);
- return IRQ_HANDLED;
-}
-
-
static struct parport_operations parport_ax88796_ops = {
.write_data = parport_ax88796_write_data,
.read_data = parport_ax88796_read_data,
@@ -344,7 +336,7 @@ static int parport_ax88796_probe(struct platform_device *pdev)
if (irq >= 0) {
/* request irq */
- ret = request_irq(irq, parport_ax88796_interrupt,
+ ret = request_irq(irq, parport_irq_handler,
IRQF_TRIGGER_FALLING, pdev->name, pp);
if (ret < 0)
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index 43652ba523e..0e77ae2b71a 100644
--- a/drivers/parport/parport_gsc.c
+++ b/drivers/parport/parport_gsc.c
@@ -80,12 +80,6 @@ static int clear_epp_timeout(struct parport *pb)
* of these are in parport_gsc.h.
*/
-static irqreturn_t parport_gsc_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, (struct parport *) dev_id);
- return IRQ_HANDLED;
-}
-
void parport_gsc_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.pc.ctr = 0xc | (dev->irq_func ? 0x10 : 0x0);
@@ -324,7 +318,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
printk("]\n");
if (p->irq != PARPORT_IRQ_NONE) {
- if (request_irq (p->irq, parport_gsc_interrupt,
+ if (request_irq (p->irq, parport_irq_handler,
0, p->name, p)) {
printk (KERN_WARNING "%s: irq %d in use, "
"resorting to polled operation\n",
diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index ec44efdbb84..6d58bf895b1 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -778,14 +778,16 @@ static irqreturn_t parport_ip32_interrupt(int irq, void *dev_id)
struct parport * const p = dev_id;
struct parport_ip32_private * const priv = p->physport->private_data;
enum parport_ip32_irq_mode irq_mode = priv->irq_mode;
+
switch (irq_mode) {
case PARPORT_IP32_IRQ_FWD:
- parport_generic_irq(irq, p);
- break;
+ return parport_irq_handler(irq, dev_id);
+
case PARPORT_IP32_IRQ_HERE:
parport_ip32_wakeup(p);
break;
}
+
return IRQ_HANDLED;
}
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index e2be8400110..e9743d3efaf 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -272,13 +272,6 @@ static int clear_epp_timeout(struct parport *pb)
* of these are in parport_pc.h.
*/
-static irqreturn_t parport_pc_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, (struct parport *) dev_id);
- /* FIXME! Was it really ours? */
- return IRQ_HANDLED;
-}
-
static void parport_pc_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.pc.ctr = 0xc;
@@ -2301,7 +2294,7 @@ struct parport *parport_pc_probe_port (unsigned long int base,
EPP_res = NULL;
}
if (p->irq != PARPORT_IRQ_NONE) {
- if (request_irq (p->irq, parport_pc_interrupt,
+ if (request_irq (p->irq, parport_irq_handler,
0, p->name, p)) {
printk (KERN_WARNING "%s: irq %d in use, "
"resorting to polled operation\n",
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index d27019c2f86..9d595aa91e4 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -46,12 +46,6 @@
#define dprintk(x)
#endif
-static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id)
-{
- parport_generic_irq(irq, (struct parport *) dev_id);
- return IRQ_HANDLED;
-}
-
static void parport_sunbpp_disable_irq(struct parport *p)
{
struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base;
@@ -324,7 +318,7 @@ static int __devinit init_one_port(struct sbus_dev *sdev)
p->size = size;
p->dev = &sdev->ofdev.dev;
- if ((err = request_irq(p->irq, parport_sunbpp_interrupt,
+ if ((err = request_irq(p->irq, parport_irq_handler,
IRQF_SHARED, p->name, p)) != 0) {
goto out_put_port;
}
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index cd66442acfe..414c52a5883 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -995,6 +995,15 @@ void parport_release(struct pardevice *dev)
}
}
+irqreturn_t parport_irq_handler(int irq, void *dev_id)
+{
+ struct parport *port = dev_id;
+
+ parport_generic_irq(irq, port);
+
+ return IRQ_HANDLED;
+}
+
/* Exported symbols for modules. */
EXPORT_SYMBOL(parport_claim);
@@ -1011,5 +1020,6 @@ EXPORT_SYMBOL(parport_get_port);
EXPORT_SYMBOL(parport_put_port);
EXPORT_SYMBOL(parport_find_number);
EXPORT_SYMBOL(parport_find_base);
+EXPORT_SYMBOL(parport_irq_handler);
MODULE_LICENSE("GPL");