diff options
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/daisy.c | 42 | ||||
-rw-r--r-- | drivers/parport/ieee1284.c | 2 | ||||
-rw-r--r-- | drivers/parport/parport_amiga.c | 9 | ||||
-rw-r--r-- | drivers/parport/parport_atari.c | 9 | ||||
-rw-r--r-- | drivers/parport/parport_ax88796.c | 10 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 8 | ||||
-rw-r--r-- | drivers/parport/parport_ip32.c | 6 | ||||
-rw-r--r-- | drivers/parport/parport_mfc3.c | 2 | ||||
-rw-r--r-- | drivers/parport/parport_pc.c | 9 | ||||
-rw-r--r-- | drivers/parport/parport_sunbpp.c | 8 | ||||
-rw-r--r-- | drivers/parport/probe.c | 3 | ||||
-rw-r--r-- | drivers/parport/procfs.c | 38 | ||||
-rw-r--r-- | drivers/parport/share.c | 12 |
13 files changed, 31 insertions, 127 deletions
diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index ff9f3445353..3c8f06c3a5a 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -199,11 +199,6 @@ void parport_daisy_fini(struct parport *port) * parport_open - find a device by canonical device number * @devnum: canonical device number * @name: name to associate with the device - * @pf: preemption callback - * @kf: kick callback - * @irqf: interrupt handler - * @flags: registration flags - * @handle: driver data * * This function is similar to parport_register_device(), except * that it locates a device by its number rather than by the port @@ -214,10 +209,7 @@ void parport_daisy_fini(struct parport *port) * for parport_register_device(). **/ -struct pardevice *parport_open(int devnum, const char *name, - int (*pf) (void *), void (*kf) (void *), - void (*irqf) (int, void *), - int flags, void *handle) +struct pardevice *parport_open(int devnum, const char *name) { struct daisydev *p = topology; struct parport *port; @@ -237,8 +229,7 @@ struct pardevice *parport_open(int devnum, const char *name, port = parport_get_port(p->port); spin_unlock(&topology_lock); - dev = parport_register_device(port, name, pf, kf, - irqf, flags, handle); + dev = parport_register_device(port, name, NULL, NULL, NULL, 0, NULL); parport_put_port(port); if (!dev) return NULL; @@ -275,35 +266,6 @@ void parport_close(struct pardevice *dev) parport_unregister_device(dev); } -/** - * parport_device_num - convert device coordinates - * @parport: parallel port number - * @mux: multiplexor port number (-1 for no multiplexor) - * @daisy: daisy chain address (-1 for no daisy chain address) - * - * This tries to locate a device on the given parallel port, - * multiplexor port and daisy chain address, and returns its - * device number or %-ENXIO if no device with those coordinates - * exists. - **/ - -int parport_device_num(int parport, int mux, int daisy) -{ - int res = -ENXIO; - struct daisydev *dev; - - spin_lock(&topology_lock); - dev = topology; - while (dev && dev->port->portnum != parport && - dev->port->muxport != mux && dev->daisy != daisy) - dev = dev->next; - if (dev) - res = dev->devnum; - spin_unlock(&topology_lock); - - return res; -} - /* Send a daisy-chain-style CPP command packet. */ static int cpp_daisy(struct parport *port, int cmd) { diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index 5accaa7bde3..54a6ef72906 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -571,7 +571,7 @@ static int parport_ieee1284_ack_data_avail (struct parport *port) #endif /* IEEE1284 support */ /* Handle an interrupt. */ -void parport_ieee1284_interrupt (int which, void *handle) +void parport_ieee1284_interrupt (void *handle) { struct parport *port = handle; parport_ieee1284_wakeup (port); 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_mfc3.c b/drivers/parport/parport_mfc3.c index 77726fc4976..6dec9ba5ed2 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -219,7 +219,7 @@ static irqreturn_t mfc3_interrupt(int irq, void *dev_id) if (this_port[i] != NULL) if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */ dummy = pia(this_port[i])->pprb; /* clear irq bit */ - parport_generic_irq(irq, this_port[i]); + parport_generic_irq(this_port[i]); } 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/probe.c b/drivers/parport/probe.c index ea83b70e0de..853a15f44f8 100644 --- a/drivers/parport/probe.c +++ b/drivers/parport/probe.c @@ -255,8 +255,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, ssize_t parport_device_id (int devnum, char *buffer, size_t count) { ssize_t retval = -ENXIO; - struct pardevice *dev = parport_open (devnum, "Device ID probe", - NULL, NULL, NULL, 0, NULL); + struct pardevice *dev = parport_open (devnum, "Device ID probe"); if (!dev) return -ENXIO; diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index bdbdab9285c..ed82e41210d 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -237,7 +237,7 @@ static int do_hardware_modes (ctl_table *table, int write, #define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \ .mode = 0555, .child = CHILD } #define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } -#define PARPORT_DEVICES_ROOT_DIR { .ctl_name = DEV_PARPORT_DEVICES, .procname = "devices", \ +#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ .mode = 0555, .child = NULL } static const unsigned long parport_min_timeslice_value = @@ -266,7 +266,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .sysctl_header = NULL, { { - .ctl_name = DEV_PARPORT_SPINTIME, .procname = "spintime", .data = NULL, .maxlen = sizeof(int), @@ -276,7 +275,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .extra2 = (void*) &parport_max_spintime_value }, { - .ctl_name = DEV_PARPORT_BASE_ADDR, .procname = "base-addr", .data = NULL, .maxlen = 0, @@ -284,7 +282,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_hardware_base_addr }, { - .ctl_name = DEV_PARPORT_IRQ, .procname = "irq", .data = NULL, .maxlen = 0, @@ -292,7 +289,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_hardware_irq }, { - .ctl_name = DEV_PARPORT_DMA, .procname = "dma", .data = NULL, .maxlen = 0, @@ -300,7 +296,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_hardware_dma }, { - .ctl_name = DEV_PARPORT_MODES, .procname = "modes", .data = NULL, .maxlen = 0, @@ -310,7 +305,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { PARPORT_DEVICES_ROOT_DIR, #ifdef CONFIG_PARPORT_1284 { - .ctl_name = DEV_PARPORT_AUTOPROBE, .procname = "autoprobe", .data = NULL, .maxlen = 0, @@ -318,7 +312,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_autoprobe }, { - .ctl_name = DEV_PARPORT_AUTOPROBE + 1, .procname = "autoprobe0", .data = NULL, .maxlen = 0, @@ -326,7 +319,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_autoprobe }, { - .ctl_name = DEV_PARPORT_AUTOPROBE + 2, .procname = "autoprobe1", .data = NULL, .maxlen = 0, @@ -334,7 +326,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_autoprobe }, { - .ctl_name = DEV_PARPORT_AUTOPROBE + 3, .procname = "autoprobe2", .data = NULL, .maxlen = 0, @@ -342,7 +333,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { .proc_handler = &do_autoprobe }, { - .ctl_name = DEV_PARPORT_AUTOPROBE + 4, .procname = "autoprobe3", .data = NULL, .maxlen = 0, @@ -354,7 +344,6 @@ static const struct parport_sysctl_table parport_sysctl_template = { }, { { - .ctl_name = DEV_PARPORT_DEVICES_ACTIVE, .procname = "active", .data = NULL, .maxlen = 0, @@ -393,7 +382,6 @@ parport_device_sysctl_template = { .sysctl_header = NULL, { { - .ctl_name = DEV_PARPORT_DEVICE_TIMESLICE, .procname = "timeslice", .data = NULL, .maxlen = sizeof(int), @@ -449,7 +437,6 @@ parport_default_sysctl_table = { .sysctl_header = NULL, { { - .ctl_name = DEV_PARPORT_DEFAULT_TIMESLICE, .procname = "timeslice", .data = &parport_default_timeslice, .maxlen = sizeof(parport_default_timeslice), @@ -459,7 +446,6 @@ parport_default_sysctl_table = { .extra2 = (void*) &parport_max_timeslice_value }, { - .ctl_name = DEV_PARPORT_DEFAULT_SPINTIME, .procname = "spintime", .data = &parport_default_spintime, .maxlen = sizeof(parport_default_spintime), @@ -502,7 +488,7 @@ int parport_proc_register(struct parport *port) t->device_dir[0].extra1 = port; - for (i = 0; i < 8; i++) + for (i = 0; i < 5; i++) t->vars[i].extra1 = port; t->vars[0].data = &port->spintime; @@ -512,7 +498,7 @@ int parport_proc_register(struct parport *port) t->vars[6 + i].extra2 = &port->probe_info[i]; t->port_dir[0].procname = port->name; - t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */ + t->port_dir[0].ctl_name = 0; t->port_dir[0].child = t->vars; t->parport_dir[0].child = t->port_dir; @@ -551,26 +537,12 @@ int parport_device_proc_register(struct pardevice *device) t->dev_dir[0].child = t->parport_dir; t->parport_dir[0].child = t->port_dir; t->port_dir[0].procname = port->name; - t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */ + t->port_dir[0].ctl_name = 0; t->port_dir[0].child = t->devices_root_dir; t->devices_root_dir[0].child = t->device_dir; -#ifdef CONFIG_PARPORT_1284 - - t->device_dir[0].ctl_name = - parport_device_num(port->number, port->muxport, - device->daisy) - + 1; /* nb 0 isn't legal here */ - -#else /* No IEEE 1284 support */ - - /* parport_device_num isn't available. */ - t->device_dir[0].ctl_name = 1; - -#endif /* IEEE 1284 support or not */ - + t->device_dir[0].ctl_name = 0; t->device_dir[0].procname = device->name; - t->device_dir[0].extra1 = device; t->device_dir[0].child = t->vars; t->vars[0].data = &device->timeslice; diff --git a/drivers/parport/share.c b/drivers/parport/share.c index cd66442acfe..a8a62bbbb57 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -524,7 +524,7 @@ void parport_remove_port(struct parport *port) struct pardevice * parport_register_device(struct parport *port, const char *name, int (*pf)(void *), void (*kf)(void *), - void (*irq_func)(int, void *), + void (*irq_func)(void *), int flags, void *handle) { struct pardevice *tmp; @@ -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(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"); |