Skip to content

Commit

Permalink
serial: fix platform driver hotplug/coldplug
Browse files Browse the repository at this point in the history
Since 43cc71e, 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...

[[email protected]: more drivers, registration fixes]
Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: David Brownell <[email protected]>
Acked-by: Peter Korsgaard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kaysievers authored and torvalds committed Apr 16, 2008
1 parent 12c2c01 commit e169c13
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
2 changes: 2 additions & 0 deletions drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ static struct platform_driver bfin_serial_driver = {
.resume = bfin_serial_resume,
.driver = {
.name = "bfin-uart",
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -1301,3 +1302,4 @@ MODULE_AUTHOR("Aubrey.Li <[email protected]>");
MODULE_DESCRIPTION("Blackfin generic serial port driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(BFIN_SERIAL_MAJOR);
MODULE_ALIAS("platform:bfin-uart");
2 changes: 2 additions & 0 deletions drivers/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ static struct platform_driver serial_imx_driver = {
.resume = serial_imx_resume,
.driver = {
.name = "imx-uart",
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -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");
1 change: 1 addition & 0 deletions drivers/serial/mcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,5 +649,6 @@ module_exit(mcf_exit);
MODULE_AUTHOR("Greg Ungerer <[email protected]>");
MODULE_DESCRIPTION("Freescale ColdFire UART driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:mcfuart");

/****************************************************************************/
2 changes: 2 additions & 0 deletions drivers/serial/mpc52xx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,8 @@ mpc52xx_uart_resume(struct platform_device *dev)
}
#endif

/* work with hotplug and coldplug */
MODULE_ALIAS("platform:mpc52xx-psc");

static struct platform_driver mpc52xx_uart_platform_driver = {
.probe = mpc52xx_uart_probe,
Expand Down
2 changes: 2 additions & 0 deletions drivers/serial/mpsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,7 @@ static struct platform_driver mpsc_driver = {
.remove = mpsc_drv_remove,
.driver = {
.name = MPSC_CTLR_NAME,
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -2007,3 +2008,4 @@ MODULE_DESCRIPTION("Generic Marvell MPSC serial/UART driver $Revision: 1.00 $");
MODULE_VERSION(MPSC_VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR);
MODULE_ALIAS("platform:" MPSC_CTLR_NAME);
2 changes: 2 additions & 0 deletions drivers/serial/netx-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ static struct platform_driver serial_netx_driver = {

.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -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);
1 change: 1 addition & 0 deletions drivers/serial/pnx8xxx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,3 +850,4 @@ MODULE_AUTHOR("Embedded Alley Solutions, Inc.");
MODULE_DESCRIPTION("PNX8XXX SoCs serial port driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_PNX8XXX_MAJOR);
MODULE_ALIAS("platform:pnx8xxx-uart");
3 changes: 2 additions & 1 deletion drivers/serial/pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ static struct platform_driver serial_pxa_driver = {
.resume = serial_pxa_resume,
.driver = {
.name = "pxa2xx-uart",
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -861,4 +862,4 @@ module_init(serial_pxa_init);
module_exit(serial_pxa_exit);

MODULE_LICENSE("GPL");

MODULE_ALIAS("platform:pxa2xx-uart");
4 changes: 4 additions & 0 deletions drivers/serial/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,3 +1935,7 @@ console_initcall(s3c24xx_serial_initconsole);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ben Dooks <[email protected]>");
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");
2 changes: 2 additions & 0 deletions drivers/serial/sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ static struct platform_driver sa11x0_serial_driver = {
.resume = sa1100_serial_resume,
.driver = {
.name = "sa11x0-uart",
.owner = THIS_MODULE,
},
};

Expand Down Expand Up @@ -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");
2 changes: 2 additions & 0 deletions drivers/serial/sc26xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ static struct platform_driver sc26xx_driver = {
.remove = __devexit_p(sc26xx_driver_remove),
.driver = {
.name = "SC26xx",
.owner = THIS_MODULE,
},
};

Expand All @@ -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");
1 change: 1 addition & 0 deletions drivers/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,3 +1552,4 @@ module_init(sci_init);
module_exit(sci_exit);

MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:sh-sci");
3 changes: 3 additions & 0 deletions drivers/serial/uartlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ static int __devexit ulite_remove(struct platform_device *pdev)
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),
Expand Down
3 changes: 3 additions & 0 deletions drivers/serial/vr41xx_siu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit e169c13

Please sign in to comment.