public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug
@ 2008-04-13 18:15 David Brownell
  2008-04-13 18:39 ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2008-04-13 18:15 UTC (permalink / raw)
  To: Andrew Morton, linux-serial; +Cc: kay

From: Kay Sievers <kay.sievers@vrfy.org>

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform
modalias is prefixed with "platform:". Add MODULE_ALIAS() to the
hotpluggable serial platform drivers, to re-enable auto loading.

NOTE that Kconfig for some of these drivers doesn't allow modular
builds, and thus doesn't match the driver source's unload support.
Presumably their unload code is buggy and/or weakly tested...

[ dbrownell@users.sourceforge.net: more drivers, registration fixes ]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 drivers/serial/atmel_serial.c |    1 +
 drivers/serial/bfin_5xx.c     |    2 ++
 drivers/serial/imx.c          |    2 ++
 drivers/serial/mcf.c          |    1 +
 drivers/serial/mpc52xx_uart.c |    2 ++
 drivers/serial/mpsc.c         |    2 ++
 drivers/serial/netx-serial.c  |    2 ++
 drivers/serial/pnx8xxx_uart.c |    1 +
 drivers/serial/pxa.c          |    3 ++-
 drivers/serial/s3c2410.c      |    4 ++++
 drivers/serial/sa1100.c       |    2 ++
 drivers/serial/sc26xx.c       |    2 ++
 drivers/serial/sh-sci.c       |    1 +
 drivers/serial/uartlite.c     |    3 +++
 drivers/serial/vr41xx_siu.c   |    3 +++
 15 files changed, 30 insertions(+), 1 deletion(-)

--- g26.orig/drivers/serial/atmel_serial.c	2008-04-13 10:43:34.000000000 -0700
+++ g26/drivers/serial/atmel_serial.c	2008-04-13 10:46:32.000000000 -0700
@@ -1577,3 +1577,4 @@ module_exit(atmel_serial_exit);
 MODULE_AUTHOR("Rick Bronson");
 MODULE_DESCRIPTION("Atmel AT91 / AT32 serial port driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:atmel_usart");
--- g26.orig/drivers/serial/bfin_5xx.c	2008-04-13 10:43:34.000000000 -0700
+++ g26/drivers/serial/bfin_5xx.c	2008-04-13 10:49:15.000000000 -0700
@@ -1243,6 +1243,7 @@ static struct platform_driver bfin_seria
 	.resume		= bfin_serial_resume,
 	.driver		= {
 		.name	= "bfin-uart",
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -1301,3 +1302,4 @@ MODULE_AUTHOR("Aubrey.Li <aubrey.li@anal
 MODULE_DESCRIPTION("Blackfin generic serial port driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CHARDEV_MAJOR(BFIN_SERIAL_MAJOR);
+MODULE_ALIAS("platform:bfin-uart");
--- g26.orig/drivers/serial/imx.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/imx.c	2008-04-13 10:49:52.000000000 -0700
@@ -1090,6 +1090,7 @@ static struct platform_driver serial_imx
 	.resume		= serial_imx_resume,
 	.driver		= {
 	        .name	= "imx-uart",
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -1124,3 +1125,4 @@ module_exit(imx_serial_exit);
 MODULE_AUTHOR("Sascha Hauer");
 MODULE_DESCRIPTION("IMX generic serial port driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:imx-uart");
--- g26.orig/drivers/serial/mcf.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/mcf.c	2008-04-13 10:46:32.000000000 -0700
@@ -649,5 +649,6 @@ module_exit(mcf_exit);
 MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com>");
 MODULE_DESCRIPTION("Freescale ColdFire UART driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:mcfuart");
 
 /****************************************************************************/
--- g26.orig/drivers/serial/mpc52xx_uart.c	2008-04-13 10:48:05.000000000 -0700
+++ g26/drivers/serial/mpc52xx_uart.c	2008-04-13 10:54:40.000000000 -0700
@@ -1188,6 +1188,8 @@ mpc52xx_uart_resume(struct platform_devi
 }
 #endif
 
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:mpc52xx-psc");
 
 static struct platform_driver mpc52xx_uart_platform_driver = {
 	.probe		= mpc52xx_uart_probe,
--- g26.orig/drivers/serial/mpsc.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/mpsc.c	2008-04-13 11:00:58.000000000 -0700
@@ -1964,6 +1964,7 @@ static struct platform_driver mpsc_drive
 	.remove	= mpsc_drv_remove,
 	.driver	= {
 		.name	= MPSC_CTLR_NAME,
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -2007,3 +2008,4 @@ MODULE_DESCRIPTION("Generic Marvell MPSC
 MODULE_VERSION(MPSC_VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR);
+MODULE_ALIAS("platform:" MPSC_CTLR_NAME);
--- g26.orig/drivers/serial/netx-serial.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/netx-serial.c	2008-04-13 10:55:40.000000000 -0700
@@ -713,6 +713,7 @@ static struct platform_driver serial_net
 
 	.driver		= {
 		.name   = DRIVER_NAME,
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -745,3 +746,4 @@ module_exit(netx_serial_exit);
 MODULE_AUTHOR("Sascha Hauer");
 MODULE_DESCRIPTION("NetX serial port driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRIVER_NAME);
--- g26.orig/drivers/serial/pnx8xxx_uart.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/pnx8xxx_uart.c	2008-04-13 10:46:32.000000000 -0700
@@ -850,3 +850,4 @@ MODULE_AUTHOR("Embedded Alley Solutions,
 MODULE_DESCRIPTION("PNX8XXX SoCs serial port driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_PNX8XXX_MAJOR);
+MODULE_ALIAS("platform:pnx8xxx-uart");
--- g26.orig/drivers/serial/pxa.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/pxa.c	2008-04-13 10:56:07.000000000 -0700
@@ -833,6 +833,7 @@ static struct platform_driver serial_pxa
 	.resume		= serial_pxa_resume,
 	.driver		= {
 	        .name	= "pxa2xx-uart",
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -861,4 +862,4 @@ module_init(serial_pxa_init);
 module_exit(serial_pxa_exit);
 
 MODULE_LICENSE("GPL");
-
+MODULE_ALIAS("platform:pxa2xx-uart");
--- g26.orig/drivers/serial/s3c2410.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/s3c2410.c	2008-04-13 10:46:32.000000000 -0700
@@ -1935,3 +1935,7 @@ console_initcall(s3c24xx_serial_initcons
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
 MODULE_DESCRIPTION("Samsung S3C2410/S3C2440/S3C2412 Serial port driver");
+MODULE_ALIAS("platform:s3c2400-uart");
+MODULE_ALIAS("platform:s3c2410-uart");
+MODULE_ALIAS("platform:s3c2412-uart");
+MODULE_ALIAS("platform:s3c2440-uart");
--- g26.orig/drivers/serial/sa1100.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/sa1100.c	2008-04-13 10:57:07.000000000 -0700
@@ -884,6 +884,7 @@ static struct platform_driver sa11x0_ser
 	.resume		= sa1100_serial_resume,
 	.driver		= {
 		.name	= "sa11x0-uart",
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -917,3 +918,4 @@ MODULE_AUTHOR("Deep Blue Solutions Ltd")
 MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.50 $");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_SA1100_MAJOR);
+MODULE_ALIAS("platform:sa11x0-uart");
--- g26.orig/drivers/serial/sc26xx.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/sc26xx.c	2008-04-13 10:57:14.000000000 -0700
@@ -732,6 +732,7 @@ static struct platform_driver sc26xx_dri
 	.remove	= __devexit_p(sc26xx_driver_remove),
 	.driver	= {
 		.name	= "SC26xx",
+		.owner	= THIS_MODULE,
 	},
 };
 
@@ -753,3 +754,4 @@ MODULE_AUTHOR("Thomas Bogendörfer");
 MODULE_DESCRIPTION("SC681/SC2692 serial driver");
 MODULE_VERSION("1.0");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:SC26xx");
--- g26.orig/drivers/serial/sh-sci.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/sh-sci.c	2008-04-13 10:46:32.000000000 -0700
@@ -1552,3 +1552,4 @@ module_init(sci_init);
 module_exit(sci_exit);
 
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:sh-sci");
--- g26.orig/drivers/serial/uartlite.c	2008-04-13 10:48:05.000000000 -0700
+++ g26/drivers/serial/uartlite.c	2008-04-13 10:59:04.000000000 -0700
@@ -561,6 +561,9 @@ static int __devexit ulite_remove(struct
 	return ulite_release(&pdev->dev);
 }
 
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:uartlite");
+
 static struct platform_driver ulite_platform_driver = {
 	.probe	= ulite_probe,
 	.remove	= __devexit_p(ulite_remove),
--- g26.orig/drivers/serial/vr41xx_siu.c	2008-04-13 10:43:35.000000000 -0700
+++ g26/drivers/serial/vr41xx_siu.c	2008-04-13 10:46:32.000000000 -0700
@@ -960,3 +960,6 @@ static void __exit vr41xx_siu_exit(void)
 
 module_init(vr41xx_siu_init);
 module_exit(vr41xx_siu_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:SIU");
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug
  2008-04-13 18:15 [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug David Brownell
@ 2008-04-13 18:39 ` Peter Korsgaard
  2008-04-13 19:07   ` David Brownell
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2008-04-13 18:39 UTC (permalink / raw)
  To: David Brownell; +Cc: Andrew Morton, linux-serial, kay

>>>>> "David" == David Brownell <david-b@pacbell.net> writes:

Hi,

 David>  MODULE_LICENSE("GPL");
 David> +MODULE_ALIAS("platform:sh-sci");
 David> --- g26.orig/drivers/serial/uartlite.c	2008-04-13 10:48:05.000000000 -0700
 David> +++ g26/drivers/serial/uartlite.c	2008-04-13 10:59:04.000000000 -0700
 David> @@ -561,6 +561,9 @@ static int __devexit ulite_remove(struct
 David>  	return ulite_release(&pdev->dev);
 David>  }
 
 David> +/* work with hotplug and coldplug */
 David> +MODULE_ALIAS("platform:uartlite");
 David> +

Why not stick this next to the other MODULE_ lines, like the other
drivers?

Other than that ..

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug
  2008-04-13 18:39 ` Peter Korsgaard
@ 2008-04-13 19:07   ` David Brownell
  2008-04-13 19:11     ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2008-04-13 19:07 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: Andrew Morton, linux-serial, kay

On Sunday 13 April 2008, Peter Korsgaard wrote:
>  David> +/* work with hotplug and coldplug */
>  David> +MODULE_ALIAS("platform:uartlite");
>  David> +
> 
> Why not stick this next to the other MODULE_ lines, like the other
> drivers?

Conceptually that's part of the driver struct ... it's not
metadata like who wrote it, its version, and so on.  So I
prefer to keep it with that driver.

For example if the driver name changes that alias must change
too.  And when the platform bus glue gets configured out -- with
PPC_MERGE, where OpenFirmware bus glue aranges for any hotplug
and coldplug suppoort, or in some other cases -- that alias must
be made to vanish.

So when I fix omissions in Kay's original patch, or otherwise
write the code myself, that's how I do it.

- Dave


> Other than that ..
> 
> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
> 
> -- 
> Bye, Peter Korsgaard
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug
  2008-04-13 19:07   ` David Brownell
@ 2008-04-13 19:11     ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2008-04-13 19:11 UTC (permalink / raw)
  To: David Brownell; +Cc: Andrew Morton, linux-serial, kay

>>>>> "David" == David Brownell <david-b@pacbell.net> writes:

Hi,

 David> So when I fix omissions in Kay's original patch, or otherwise
 David> write the code myself, that's how I do it.

Ok.

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-13 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-13 18:15 [patch 2.6.25-rc9] serial: fix platform driver hotplug/coldplug David Brownell
2008-04-13 18:39 ` Peter Korsgaard
2008-04-13 19:07   ` David Brownell
2008-04-13 19:11     ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox