From: Michael Ellerman <mpe@ellerman.id.au>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Dawei Li" <set_pte_at@outlook.com>,
"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Cc: Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
linux-kbuild@vger.kernel.org, linux-serial@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, kernel@pengutronix.de
Subject: Re: [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe()
Date: Wed, 03 Apr 2024 16:15:01 +1100 [thread overview]
Message-ID: <877chf81t6.fsf@mail.lhotse> (raw)
In-Reply-To: <5ea3174616abc9fa256f115b4fb175d289ac1754.1711748999.git.u.kleine-koenig@pengutronix.de>
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> 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>
> ---
> drivers/tty/serial/pmac_zilog.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
I gave it a quick spin in qemu, no issues.
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
> diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
> index 05d97e89511e..e44621218248 100644
> --- a/drivers/tty/serial/pmac_zilog.c
> +++ b/drivers/tty/serial/pmac_zilog.c
> @@ -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
> }
>
> base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
> --
> 2.43.0
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Dawei Li" <set_pte_at@outlook.com>,
"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Cc: kernel@pengutronix.de, linux-kbuild@vger.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
linux-serial@vger.kernel.org,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe()
Date: Wed, 03 Apr 2024 16:15:01 +1100 [thread overview]
Message-ID: <877chf81t6.fsf@mail.lhotse> (raw)
In-Reply-To: <5ea3174616abc9fa256f115b4fb175d289ac1754.1711748999.git.u.kleine-koenig@pengutronix.de>
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> 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>
> ---
> drivers/tty/serial/pmac_zilog.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
I gave it a quick spin in qemu, no issues.
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
> diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
> index 05d97e89511e..e44621218248 100644
> --- a/drivers/tty/serial/pmac_zilog.c
> +++ b/drivers/tty/serial/pmac_zilog.c
> @@ -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
> }
>
> base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
> --
> 2.43.0
next prev parent reply other threads:[~2024-04-03 5:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
2024-04-15 14:37 ` Uwe Kleine-König
2024-04-29 20:30 ` Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] serial: ami: " Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
2024-03-30 0:16 ` Kuppuswamy Sathyanarayanan
2024-04-15 14:39 ` Uwe Kleine-König
2024-04-29 20:32 ` Uwe Kleine-König
2024-04-15 21:53 ` Tom Lendacky
2024-03-29 21:54 ` [PATCH] OSS: dmasound/paula: " Uwe Kleine-König
2024-04-01 11:47 ` Takashi Iwai
2024-03-29 21:54 ` [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe() Uwe Kleine-König
2024-03-29 21:54 ` Uwe Kleine-König
2024-04-03 5:15 ` Michael Ellerman [this message]
2024-04-03 5:15 ` Michael Ellerman
2024-04-15 14:34 ` [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
2024-04-29 20:29 ` Uwe Kleine-König
2024-04-30 20:59 ` Dmitry Torokhov
2024-04-30 20:58 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877chf81t6.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=aneesh.kumar@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=damien.lemoal@opensource.wdc.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=set_pte_at@outlook.com \
--cc=tglx@linutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.