diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-04-05 04:55:58 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-04-05 04:55:58 +0000 |
commit | 74a9f2e1b4d3ab45a9f72cb5b556c9f521524ab3 (patch) | |
tree | 7c4cdb103ab1b388c9852a88bd6fb1e73eba0b5c /drivers/parport | |
parent | ee6374c8b0d333c08061c6a97bc77090d7461225 (diff) |
Merge with Linux 2.4.3.
Note that mingetty does no longer work with serial console, you have to
switch to another getty like getty_ps. This commit also includes a
fix for a setitimer bug which did prevent getty_ps from working on
older kernels.
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/ChangeLog | 19 | ||||
-rw-r--r-- | drivers/parport/ieee1284_ops.c | 4 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 62 | ||||
-rw-r--r-- | drivers/parport/parport_pc.c | 17 | ||||
-rw-r--r-- | drivers/parport/share.c | 8 |
5 files changed, 61 insertions, 49 deletions
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog index 830c594d7..07a0241a7 100644 --- a/drivers/parport/ChangeLog +++ b/drivers/parport/ChangeLog @@ -1,3 +1,22 @@ +2001-03-02 Tim Waugh <twaugh@redhat.com> + + * ieee1284_ops.c (parport_ieee1284_read_nibble): Reset nAutoFd + on timeout. Matches 2.2.x behaviour. + +2001-03-02 Andrew Morton <andrewm@uow.edu.au> + + * parport_pc.c (registered_parport): New static variable. + (parport_pc_find_ports): Set it when we register PCI driver. + (init_module): Unregister PCI driver if necessary when we + fail. + +2001-03-02 Tim Waugh <twaugh@redhat.com> + + * ieee1284_ops.c (parport_ieee1284_write_compat): Don't use + down_trylock to reset the IRQ count. Don't even use sema_init, + because it's not even necessary to reset the count. I can't + remember why we ever did. + 2001-01-04 Peter Osterlund <peter.osterlund@mailbox.swipnet.se> * ieee1284.c (parport_negotiate): Fix missing printk argument. diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index cf5c5fb03..86a74b72f 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -50,9 +50,6 @@ size_t parport_ieee1284_write_compat (struct parport *port, if (port->irq != PARPORT_IRQ_NONE) { parport_enable_irq (port); no_irq = 0; - - /* Clear out previous irqs. */ - while (!down_trylock (&port->physport->ieee1284.irq)); } port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; @@ -192,6 +189,7 @@ size_t parport_ieee1284_read_nibble (struct parport *port, DPRINTK (KERN_DEBUG "%s: Nibble timeout at event 9 (%d bytes)\n", port->name, i/2); + parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); break; } diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 6210a524d..e44900e30 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -19,6 +19,8 @@ * Andrea Arcangeli */ +#undef DEBUG /* undef for production */ + #include <linux/module.h> #include <linux/init.h> #include <linux/sched.h> @@ -42,13 +44,9 @@ #include <asm/parport_gsc.h> -#undef DEBUG /* undef for production */ - -#ifdef DEBUG -#define DPRINTK printk -#else -#define DPRINTK(stuff...) -#endif +MODULE_AUTHOR("Helge Deller <deller@gmx.de>"); +MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver"); +MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port"); /* @@ -83,25 +81,18 @@ static int clear_epp_timeout(struct parport *pb) static void parport_gsc_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - DPRINTK(__FILE__ ": got IRQ\n"); parport_generic_irq(irq, (struct parport *) dev_id, regs); } void parport_gsc_write_data(struct parport *p, unsigned char d) { - DPRINTK(__FILE__ ": write (0x%02x) %c \n", d, d); parport_writeb (d, DATA (p)); } unsigned char parport_gsc_read_data(struct parport *p) { -#ifdef DEBUG unsigned char c = parport_readb (DATA (p)); - DPRINTK(__FILE__ ": read (0x%02x) %c\n", c,c); return c; -#else - return parport_readb (DATA (p)); -#endif } void parport_gsc_write_control(struct parport *p, unsigned char d) @@ -113,8 +104,8 @@ void parport_gsc_write_control(struct parport *p, unsigned char d) /* Take this out when drivers have adapted to the newer interface. */ if (d & 0x20) { - printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n", - p->name, p->cad->name); + pr_debug("%s (%s): use data_reverse for this!\n", + p->name, p->cad->name); parport_gsc_data_reverse (p); } @@ -141,7 +132,7 @@ unsigned char parport_gsc_frob_control (struct parport *p, unsigned char mask, /* Take this out when drivers have adapted to the newer interface. */ if (mask & 0x20) { - printk (KERN_DEBUG "%s (%s): use data_%s for this!\n", + pr_debug("%s (%s): use data_%s for this!\n", p->name, p->cad->name, (val & 0x20) ? "reverse" : "forward"); if (val & 0x20) @@ -199,16 +190,12 @@ void parport_gsc_restore_state(struct parport *p, struct parport_state *s) void parport_gsc_inc_use_count(void) { -#ifdef MODULE MOD_INC_USE_COUNT; -#endif } void parport_gsc_dec_use_count(void) { -#ifdef MODULE MOD_DEC_USE_COUNT; -#endif } @@ -360,8 +347,12 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, struct parport tmp; struct parport *p = &tmp; +#if 1 +#warning Take this out when region handling works again, <deller@gmx,de> +#else if (check_region(base, 3)) return NULL; +#endif priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); if (!priv) { @@ -474,8 +465,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, static int __initdata parport_count; -static int __init -parport_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +static int __init parport_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) { unsigned long port; int irq; @@ -515,32 +505,22 @@ static struct pa_iodc_driver parport_drivers_for[] __initdata = { { 0 } }; -int __init -parport_gsc_init ( void ) +int __init parport_gsc_init(void) { parport_count = 0; register_driver(parport_drivers_for); - return parport_count; + return 0; } -/* Exported symbols. */ -EXPORT_NO_SYMBOLS; - -#ifdef MODULE - -MODULE_AUTHOR("Helge Deller <deller@gmx.de>"); -MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver"); -MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port"); - -int init_module(void) +static int __init parport_gsc_init_module(void) { - return !parport_gsc_init (); + return !parport_gsc_init(); } -void cleanup_module(void) +static void __exit parport_gsc_exit_module(void) { struct parport *p = parport_enumerate(), *tmp; while (p) { @@ -569,4 +549,8 @@ void cleanup_module(void) p = tmp; } } -#endif + +EXPORT_NO_SYMBOLS; + +module_init(parport_gsc_init_module); +module_exit(parport_gsc_exit_module); diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 2bd9e7e76..169e505e2 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -89,6 +89,7 @@ static struct superio_struct { /* For Super-IO chips autodetection */ } superios[NR_SUPERIOS] __devinitdata = { {0,},}; static int user_specified __devinitdata = 0; +static int registered_parport; /* frob_control, but for ECR */ static void frob_econtrol (struct parport *pb, unsigned char m, @@ -1690,11 +1691,6 @@ static int __devinit parport_ECP_supported(struct parport *pb) config & 0x80 ? "Level" : "Pulses"); configb = inb (CONFIGB (pb)); - if (!(configb & 0x40)) { - printk (KERN_WARNING "0x%lx: possible IRQ conflict!\n", - pb->base); - pb->irq = PARPORT_IRQ_NONE; - } printk (KERN_DEBUG "0x%lx: ECP port cfgA=0x%02x cfgB=0x%02x\n", pb->base, config, configb); printk (KERN_DEBUG "0x%lx: ECP settings irq=", pb->base); @@ -2605,8 +2601,10 @@ static int __init parport_pc_find_ports (int autoirq, int autodma) count += parport_pc_find_nonpci_ports (autoirq, autodma); r = pci_register_driver (&parport_pc_pci_driver); - if (r > 0) + if (r >= 0) { + registered_parport = 1; count += r; + } return count; } @@ -2667,6 +2665,7 @@ int init_module(void) /* Work out how many ports we have, then get parport_share to parse the irq values. */ unsigned int i; + int ret; for (i = 0; i < PARPORT_PC_MAX_PORTS && io[i]; i++); if (i) { if (parport_parse_irqs(i, irq, irqval)) return 1; @@ -2691,7 +2690,11 @@ int init_module(void) } } - return !parport_pc_init (io, io_hi, irqval, dmaval); + ret = !parport_pc_init (io, io_hi, irqval, dmaval); + if (ret && registered_parport) + pci_unregister_driver (&parport_pc_pci_driver); + + return ret; } void cleanup_module(void) diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 03c0f5c07..d9a7d28a8 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -810,6 +810,10 @@ void parport_unregister_device(struct pardevice *dev) struct parport *parport_find_number (int number) { struct parport *port, *result = NULL; + + if (!portlist) + get_lowlevel_driver (); + spin_lock (&parportlist_lock); for (port = portlist; port; port = port->next) if (port->number == number) { @@ -835,6 +839,10 @@ struct parport *parport_find_number (int number) struct parport *parport_find_base (unsigned long base) { struct parport *port, *result = NULL; + + if (!portlist) + get_lowlevel_driver (); + spin_lock (&parportlist_lock); for (port = portlist; port; port = port->next) if (port->base == base) { |