mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 14:05:05 -04:00
serial: pmac_zilog: Drop usage of platform_driver_probe()
There are considerations to drop platform_driver_probe() as a concept that isn't relevant any more today. It comes with an added complexity that makes many users hold it wrong. (E.g. this driver should have marked the driver struct with __refdata to prevent the below mentioned false positive section mismatch warning.) This fixes a W=1 build warning: WARNING: modpost: drivers/tty/serial/pmac_zilog: section mismatch in reference: pmz_driver+0x8 (section: .data) -> pmz_detach (section: .exit.text) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/5ea3174616abc9fa256f115b4fb175d289ac1754.1711748999.git.u.kleine-koenig@pengutronix.de Tested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9013517527
commit
7fb96133a7
@@ -1695,7 +1695,7 @@ static void pmz_dispose_port(struct uart_pmac_port *uap)
|
||||
memset(uap, 0, sizeof(struct uart_pmac_port));
|
||||
}
|
||||
|
||||
static int __init pmz_attach(struct platform_device *pdev)
|
||||
static int pmz_attach(struct platform_device *pdev)
|
||||
{
|
||||
struct uart_pmac_port *uap;
|
||||
int i;
|
||||
@@ -1714,7 +1714,7 @@ static int __init pmz_attach(struct platform_device *pdev)
|
||||
return uart_add_one_port(&pmz_uart_reg, &uap->port);
|
||||
}
|
||||
|
||||
static void __exit pmz_detach(struct platform_device *pdev)
|
||||
static void pmz_detach(struct platform_device *pdev)
|
||||
{
|
||||
struct uart_pmac_port *uap = platform_get_drvdata(pdev);
|
||||
|
||||
@@ -1789,7 +1789,8 @@ static struct macio_driver pmz_driver = {
|
||||
#else
|
||||
|
||||
static struct platform_driver pmz_driver = {
|
||||
.remove_new = __exit_p(pmz_detach),
|
||||
.probe = pmz_attach,
|
||||
.remove_new = pmz_detach,
|
||||
.driver = {
|
||||
.name = "scc",
|
||||
},
|
||||
@@ -1837,7 +1838,7 @@ static int __init init_pmz(void)
|
||||
#ifdef CONFIG_PPC_PMAC
|
||||
return macio_register_driver(&pmz_driver);
|
||||
#else
|
||||
return platform_driver_probe(&pmz_driver, pmz_attach);
|
||||
return platform_driver_register(&pmz_driver);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user