
From: <viro@www.linux.org.uk>

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().


---

 drivers/parport/parport_amiga.c  |    3 ---
 drivers/parport/parport_arc.c    |    1 -
 drivers/parport/parport_atari.c  |    3 ---
 drivers/parport/parport_gsc.c    |    2 --
 drivers/parport/parport_mfc3.c   |    2 --
 drivers/parport/parport_pc.c     |    2 --
 drivers/parport/parport_sunbpp.c |    2 --
 drivers/parport/procfs.c         |    2 --
 drivers/parport/share.c          |    3 +++
 drivers/usb/misc/uss720.c        |    2 --
 10 files changed, 3 insertions(+), 19 deletions(-)

diff -puN drivers/parport/parport_amiga.c~parport-08-parport_announce-cleanups drivers/parport/parport_amiga.c
--- 25/drivers/parport/parport_amiga.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_amiga.c	2004-02-18 23:44:00.000000000 -0800
@@ -262,8 +262,6 @@ static int __init parport_amiga_init(voi
 	this_port = p;
 	printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name);
 	/* XXX: set operating mode */
-	parport_proc_register(p);
-
 	parport_announce_port(p);
 
 	return 0;
@@ -281,7 +279,6 @@ static void __exit parport_amiga_exit(vo
 	parport_remove_port(this_port);
 	if (this_port->irq != PARPORT_IRQ_NONE)
 		free_irq(IRQ_AMIGA_CIAA_FLG, this_port);
-	parport_proc_unregister(this_port);
 	parport_put_port(this_port);
 	release_mem_region(CIAA_PHYSADDR-1+0x100, 0x100);
 }
diff -puN drivers/parport/parport_arc.c~parport-08-parport_announce-cleanups drivers/parport/parport_arc.c
--- 25/drivers/parport/parport_arc.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_arc.c	2004-02-18 23:44:00.000000000 -0800
@@ -129,7 +129,6 @@ static int parport_arc_init(void)
 
 	printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n",
 	       p->irq);
-	parport_proc_register(p);
 
 	/* Tell the high-level drivers about the port. */
 	parport_announce_port (p);
diff -puN drivers/parport/parport_atari.c~parport-08-parport_announce-cleanups drivers/parport/parport_atari.c
--- 25/drivers/parport/parport_atari.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_atari.c	2004-02-18 23:44:00.000000000 -0800
@@ -216,8 +216,6 @@ static int __init parport_atari_init(voi
 
 		this_port = p;
 		printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name);
-		parport_proc_register(p);
-
 		parport_announce_port (p);
 
 		return 0;
@@ -230,7 +228,6 @@ static void __exit parport_atari_exit(vo
 	parport_remove_port(this_port);
 	if (this_port->irq != PARPORT_IRQ_NONE)
 		free_irq(IRQ_MFP_BUSY, this_port);
-	parport_proc_unregister(this_port);
 	parport_put_port(this_port);
 }
 
diff -puN drivers/parport/parport_gsc.c~parport-08-parport_announce-cleanups drivers/parport/parport_gsc.c
--- 25/drivers/parport/parport_gsc.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_gsc.c	2004-02-18 23:44:00.000000000 -0800
@@ -412,7 +412,6 @@ struct parport *__devinit parport_gsc_pr
 	}
 #undef printmode
 	printk("]\n");
-	parport_proc_register(p);
 
 	if (p->irq != PARPORT_IRQ_NONE) {
 		if (request_irq (p->irq, parport_gsc_interrupt,
@@ -488,7 +487,6 @@ static void __devexit parport_remove_chi
 			free_dma(p->dma);
 		if (p->irq != PARPORT_IRQ_NONE)
 			free_irq(p->irq, p);
-		parport_proc_unregister(p);
 		if (priv->dma_buf)
 			pci_free_consistent(priv->dev, PAGE_SIZE,
 					    priv->dma_buf,
diff -puN drivers/parport/parport_mfc3.c~parport-08-parport_announce-cleanups drivers/parport/parport_mfc3.c
--- 25/drivers/parport/parport_mfc3.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_mfc3.c	2004-02-18 23:44:00.000000000 -0800
@@ -360,7 +360,6 @@ static int __init parport_mfc3_init(void
 		this_port[pias++] = p;
 		printk(KERN_INFO "%s: Multiface III port using irq\n", p->name);
 		/* XXX: set operating mode */
-		parport_proc_register(p);
 
 		p->private_data = (void *)piabase;
 		parport_announce_port (p);
@@ -386,7 +385,6 @@ static void __exit parport_mfc3_exit(voi
 		if (!this_port[i])
 			continue;
 		parport_remove_port(this_port[i]);
-		parport_proc_unregister(this_port[i]);
 		if (!this_port[i]->irq != PARPORT_IRQ_NONE) {
 			if (--use_cnt == 0) 
 				free_irq(IRQ_AMIGA_PORTS, &pp_mfc3_ops);
diff -puN drivers/parport/parport_pc.c~parport-08-parport_announce-cleanups drivers/parport/parport_pc.c
--- 25/drivers/parport/parport_pc.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_pc.c	2004-02-18 23:44:00.000000000 -0800
@@ -2236,7 +2236,6 @@ struct parport *parport_pc_probe_port (u
 	printk("]\n");
 	if (probedirq != PARPORT_IRQ_NONE) 
 		printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq);
-	parport_proc_register(p);
 
 	/* If No ECP release the ports grabbed above. */
 	if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) {
@@ -2326,7 +2325,6 @@ void parport_pc_unregister_port (struct 
 #endif /* CONFIG_PARPORT_PC_FIFO */
 	struct parport_operations *ops = p->ops;
 	parport_remove_port(p);
-	parport_proc_unregister(p);
 	if (p->dma != PARPORT_DMA_NONE)
 		free_dma(p->dma);
 	if (p->irq != PARPORT_IRQ_NONE)
diff -puN drivers/parport/parport_sunbpp.c~parport-08-parport_announce-cleanups drivers/parport/parport_sunbpp.c
--- 25/drivers/parport/parport_sunbpp.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/parport_sunbpp.c	2004-02-18 23:44:00.000000000 -0800
@@ -343,7 +343,6 @@ static int __init init_one_port(struct s
 	sbus_writeb(value_tcr, &regs->p_tcr);
 
 	printk(KERN_INFO "%s: sunbpp at 0x%lx\n", p->name, p->base);
-	parport_proc_register(p);
 	parport_announce_port (p);
 
 	return 1;
@@ -374,7 +373,6 @@ static void __exit parport_sunbpp_exit(v
 		if (1/*p->modes & PARPORT_MODE_PCSPP*/) { 
 			struct parport_operations *ops = p->ops;
 			parport_remove_port(p);
-			parport_proc_unregister(p);
 
 			if (p->irq != PARPORT_IRQ_NONE) {
 				parport_sunbpp_disable_irq(p);
diff -puN drivers/parport/procfs.c~parport-08-parport_announce-cleanups drivers/parport/procfs.c
--- 25/drivers/parport/procfs.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/procfs.c	2004-02-18 23:44:00.000000000 -0800
@@ -530,8 +530,6 @@ static void __exit parport_default_proc_
 }
 #endif
 
-EXPORT_SYMBOL(parport_proc_register);
-EXPORT_SYMBOL(parport_proc_unregister);
 EXPORT_SYMBOL(parport_device_proc_register);
 EXPORT_SYMBOL(parport_device_proc_unregister);
 
diff -puN drivers/parport/share.c~parport-08-parport_announce-cleanups drivers/parport/share.c
--- 25/drivers/parport/share.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/parport/share.c	2004-02-18 23:44:00.000000000 -0800
@@ -420,6 +420,7 @@ void parport_announce_port (struct parpo
 	parport_daisy_init(port);
 #endif
 
+	parport_proc_register(port);
 	down(&registration_lock);
 	/* We are locked against anyone else performing alterations, but
 	 * because of parport_enumerate people can still _read_ the list
@@ -528,6 +529,8 @@ void parport_remove_port(struct parport 
 
 	up(&registration_lock);
 
+	parport_proc_unregister(port);
+
 	/* Yes, parport_enumerate _is_ unsafe.  Don't use it. */
 	for (i = 1; i < 3; i++) {
 		struct parport *slave = port->slaves[i-1];
diff -puN drivers/usb/misc/uss720.c~parport-08-parport_announce-cleanups drivers/usb/misc/uss720.c
--- 25/drivers/usb/misc/uss720.c~parport-08-parport_announce-cleanups	2004-02-18 23:44:00.000000000 -0800
+++ 25-akpm/drivers/usb/misc/uss720.c	2004-02-18 23:44:00.000000000 -0800
@@ -592,7 +592,6 @@ static int uss720_probe(struct usb_inter
 		goto probe_abort_port;
 	}
 #endif
-	parport_proc_register(pp);
 	parport_announce_port(pp);
 
 	usb_set_intfdata (intf, pp);
@@ -616,7 +615,6 @@ static void uss720_disconnect(struct usb
 	if (pp) {
 		priv = pp->private_data;
 		parport_remove_port(pp);
-		parport_proc_unregister(pp);
 #if 0
 		usb_release_irq(usbdev, priv->irqhandle, priv->irqpipe);
 #endif

_
