Commit e63fd952 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] parport: clean up parport_announce_port and friends

	parport_announce_port() was always called right after
parport_proc_register().  Call shifted into parport_announce_port().
Similar for parport_remove_port() and parport_proc_unregister().
parent ae748b8a
...@@ -262,8 +262,6 @@ static int __init parport_amiga_init(void) ...@@ -262,8 +262,6 @@ static int __init parport_amiga_init(void)
this_port = p; this_port = p;
printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name); printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name);
/* XXX: set operating mode */ /* XXX: set operating mode */
parport_proc_register(p);
parport_announce_port(p); parport_announce_port(p);
return 0; return 0;
...@@ -281,7 +279,6 @@ static void __exit parport_amiga_exit(void) ...@@ -281,7 +279,6 @@ static void __exit parport_amiga_exit(void)
parport_remove_port(this_port); parport_remove_port(this_port);
if (this_port->irq != PARPORT_IRQ_NONE) if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_AMIGA_CIAA_FLG, this_port); free_irq(IRQ_AMIGA_CIAA_FLG, this_port);
parport_proc_unregister(this_port);
parport_put_port(this_port); parport_put_port(this_port);
release_mem_region(CIAA_PHYSADDR-1+0x100, 0x100); release_mem_region(CIAA_PHYSADDR-1+0x100, 0x100);
} }
......
...@@ -129,7 +129,6 @@ static int parport_arc_init(void) ...@@ -129,7 +129,6 @@ static int parport_arc_init(void)
printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n", printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n",
p->irq); p->irq);
parport_proc_register(p);
/* Tell the high-level drivers about the port. */ /* Tell the high-level drivers about the port. */
parport_announce_port (p); parport_announce_port (p);
......
...@@ -216,8 +216,6 @@ static int __init parport_atari_init(void) ...@@ -216,8 +216,6 @@ static int __init parport_atari_init(void)
this_port = p; this_port = p;
printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name); printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name);
parport_proc_register(p);
parport_announce_port (p); parport_announce_port (p);
return 0; return 0;
...@@ -230,7 +228,6 @@ static void __exit parport_atari_exit(void) ...@@ -230,7 +228,6 @@ static void __exit parport_atari_exit(void)
parport_remove_port(this_port); parport_remove_port(this_port);
if (this_port->irq != PARPORT_IRQ_NONE) if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_MFP_BUSY, this_port); free_irq(IRQ_MFP_BUSY, this_port);
parport_proc_unregister(this_port);
parport_put_port(this_port); parport_put_port(this_port);
} }
......
...@@ -412,7 +412,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, ...@@ -412,7 +412,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
} }
#undef printmode #undef printmode
printk("]\n"); printk("]\n");
parport_proc_register(p);
if (p->irq != PARPORT_IRQ_NONE) { if (p->irq != PARPORT_IRQ_NONE) {
if (request_irq (p->irq, parport_gsc_interrupt, if (request_irq (p->irq, parport_gsc_interrupt,
...@@ -488,7 +487,6 @@ static void __devexit parport_remove_chip(struct parisc_device *dev) ...@@ -488,7 +487,6 @@ static void __devexit parport_remove_chip(struct parisc_device *dev)
free_dma(p->dma); free_dma(p->dma);
if (p->irq != PARPORT_IRQ_NONE) if (p->irq != PARPORT_IRQ_NONE)
free_irq(p->irq, p); free_irq(p->irq, p);
parport_proc_unregister(p);
if (priv->dma_buf) if (priv->dma_buf)
pci_free_consistent(priv->dev, PAGE_SIZE, pci_free_consistent(priv->dev, PAGE_SIZE,
priv->dma_buf, priv->dma_buf,
......
...@@ -360,7 +360,6 @@ static int __init parport_mfc3_init(void) ...@@ -360,7 +360,6 @@ static int __init parport_mfc3_init(void)
this_port[pias++] = p; this_port[pias++] = p;
printk(KERN_INFO "%s: Multiface III port using irq\n", p->name); printk(KERN_INFO "%s: Multiface III port using irq\n", p->name);
/* XXX: set operating mode */ /* XXX: set operating mode */
parport_proc_register(p);
p->private_data = (void *)piabase; p->private_data = (void *)piabase;
parport_announce_port (p); parport_announce_port (p);
...@@ -386,7 +385,6 @@ static void __exit parport_mfc3_exit(void) ...@@ -386,7 +385,6 @@ static void __exit parport_mfc3_exit(void)
if (!this_port[i]) if (!this_port[i])
continue; continue;
parport_remove_port(this_port[i]); parport_remove_port(this_port[i]);
parport_proc_unregister(this_port[i]);
if (!this_port[i]->irq != PARPORT_IRQ_NONE) { if (!this_port[i]->irq != PARPORT_IRQ_NONE) {
if (--use_cnt == 0) if (--use_cnt == 0)
free_irq(IRQ_AMIGA_PORTS, &pp_mfc3_ops); free_irq(IRQ_AMIGA_PORTS, &pp_mfc3_ops);
......
...@@ -2236,7 +2236,6 @@ struct parport *parport_pc_probe_port (unsigned long int base, ...@@ -2236,7 +2236,6 @@ struct parport *parport_pc_probe_port (unsigned long int base,
printk("]\n"); printk("]\n");
if (probedirq != PARPORT_IRQ_NONE) if (probedirq != PARPORT_IRQ_NONE)
printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq); printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq);
parport_proc_register(p);
/* If No ECP release the ports grabbed above. */ /* If No ECP release the ports grabbed above. */
if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) { if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) {
...@@ -2326,7 +2325,6 @@ void parport_pc_unregister_port (struct parport *p) ...@@ -2326,7 +2325,6 @@ void parport_pc_unregister_port (struct parport *p)
#endif /* CONFIG_PARPORT_PC_FIFO */ #endif /* CONFIG_PARPORT_PC_FIFO */
struct parport_operations *ops = p->ops; struct parport_operations *ops = p->ops;
parport_remove_port(p); parport_remove_port(p);
parport_proc_unregister(p);
if (p->dma != PARPORT_DMA_NONE) if (p->dma != PARPORT_DMA_NONE)
free_dma(p->dma); free_dma(p->dma);
if (p->irq != PARPORT_IRQ_NONE) if (p->irq != PARPORT_IRQ_NONE)
......
...@@ -343,7 +343,6 @@ static int __init init_one_port(struct sbus_dev *sdev) ...@@ -343,7 +343,6 @@ static int __init init_one_port(struct sbus_dev *sdev)
sbus_writeb(value_tcr, &regs->p_tcr); sbus_writeb(value_tcr, &regs->p_tcr);
printk(KERN_INFO "%s: sunbpp at 0x%lx\n", p->name, p->base); printk(KERN_INFO "%s: sunbpp at 0x%lx\n", p->name, p->base);
parport_proc_register(p);
parport_announce_port (p); parport_announce_port (p);
return 1; return 1;
...@@ -374,7 +373,6 @@ static void __exit parport_sunbpp_exit(void) ...@@ -374,7 +373,6 @@ static void __exit parport_sunbpp_exit(void)
if (1/*p->modes & PARPORT_MODE_PCSPP*/) { if (1/*p->modes & PARPORT_MODE_PCSPP*/) {
struct parport_operations *ops = p->ops; struct parport_operations *ops = p->ops;
parport_remove_port(p); parport_remove_port(p);
parport_proc_unregister(p);
if (p->irq != PARPORT_IRQ_NONE) { if (p->irq != PARPORT_IRQ_NONE) {
parport_sunbpp_disable_irq(p); parport_sunbpp_disable_irq(p);
......
...@@ -530,8 +530,6 @@ static void __exit parport_default_proc_unregister (void) ...@@ -530,8 +530,6 @@ static void __exit parport_default_proc_unregister (void)
} }
#endif #endif
EXPORT_SYMBOL(parport_proc_register);
EXPORT_SYMBOL(parport_proc_unregister);
EXPORT_SYMBOL(parport_device_proc_register); EXPORT_SYMBOL(parport_device_proc_register);
EXPORT_SYMBOL(parport_device_proc_unregister); EXPORT_SYMBOL(parport_device_proc_unregister);
......
...@@ -420,6 +420,7 @@ void parport_announce_port (struct parport *port) ...@@ -420,6 +420,7 @@ void parport_announce_port (struct parport *port)
parport_daisy_init(port); parport_daisy_init(port);
#endif #endif
parport_proc_register(port);
down(&registration_lock); down(&registration_lock);
/* We are locked against anyone else performing alterations, but /* We are locked against anyone else performing alterations, but
* because of parport_enumerate people can still _read_ the list * because of parport_enumerate people can still _read_ the list
...@@ -528,6 +529,8 @@ void parport_remove_port(struct parport *port) ...@@ -528,6 +529,8 @@ void parport_remove_port(struct parport *port)
up(&registration_lock); up(&registration_lock);
parport_proc_unregister(port);
/* Yes, parport_enumerate _is_ unsafe. Don't use it. */ /* Yes, parport_enumerate _is_ unsafe. Don't use it. */
for (i = 1; i < 3; i++) { for (i = 1; i < 3; i++) {
struct parport *slave = port->slaves[i-1]; struct parport *slave = port->slaves[i-1];
......
...@@ -592,7 +592,6 @@ static int uss720_probe(struct usb_interface *intf, ...@@ -592,7 +592,6 @@ static int uss720_probe(struct usb_interface *intf,
goto probe_abort_port; goto probe_abort_port;
} }
#endif #endif
parport_proc_register(pp);
parport_announce_port(pp); parport_announce_port(pp);
usb_set_intfdata (intf, pp); usb_set_intfdata (intf, pp);
...@@ -616,7 +615,6 @@ static void uss720_disconnect(struct usb_interface *intf) ...@@ -616,7 +615,6 @@ static void uss720_disconnect(struct usb_interface *intf)
if (pp) { if (pp) {
priv = pp->private_data; priv = pp->private_data;
parport_remove_port(pp); parport_remove_port(pp);
parport_proc_unregister(pp);
#if 0 #if 0
usb_release_irq(usbdev, priv->irqhandle, priv->irqpipe); usb_release_irq(usbdev, priv->irqhandle, priv->irqpipe);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment