All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwrng: mxc-rnga: Drop usage of platform_driver_probe()
@ 2024-03-24 10:37 Uwe Kleine-König
  2024-04-29 20:16 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2024-03-24 10:37 UTC (permalink / raw
  To: Olivia Mackall, Herbert Xu; +Cc: linux-crypto, linux-kbuild, kernel

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 mark
the driver struct with __refdata.)

Convert the driver to the more usual module_platform_driver().

This fixes a W=1 build warning:

	WARNING: modpost: drivers/char/hw_random/mxc-rnga: section mismatch in reference: mxc_rnga_driver+0x10 (section: .data) -> mxc_rnga_remove (section: .exit.text)

with CONFIG_HW_RANDOM_MXC_RNGA=m.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/char/hw_random/mxc-rnga.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c
index 07ec000e4cd7..5d1512b08d9e 100644
--- a/drivers/char/hw_random/mxc-rnga.c
+++ b/drivers/char/hw_random/mxc-rnga.c
@@ -176,7 +176,7 @@ static int __init mxc_rnga_probe(struct platform_device *pdev)
 	return err;
 }
 
-static void __exit mxc_rnga_remove(struct platform_device *pdev)
+static void mxc_rnga_remove(struct platform_device *pdev)
 {
 	struct mxc_rng *mxc_rng = platform_get_drvdata(pdev);
 
@@ -197,10 +197,11 @@ static struct platform_driver mxc_rnga_driver = {
 		.name = "mxc_rnga",
 		.of_match_table = mxc_rnga_of_match,
 	},
-	.remove_new = __exit_p(mxc_rnga_remove),
+	.probe = mxc_rnga_probe,
+	.remove_new = mxc_rnga_remove,
 };
 
-module_platform_driver_probe(mxc_rnga_driver, mxc_rnga_probe);
+module_platform_driver(mxc_rnga_driver);
 
 MODULE_AUTHOR("Freescale Semiconductor, Inc.");
 MODULE_DESCRIPTION("H/W RNGA driver for i.MX");

base-commit: 70293240c5ce675a67bfc48f419b093023b862b3
-- 
2.43.0


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

* Re: [PATCH] hwrng: mxc-rnga: Drop usage of platform_driver_probe()
  2024-03-24 10:37 [PATCH] hwrng: mxc-rnga: Drop usage of platform_driver_probe() Uwe Kleine-König
@ 2024-04-29 20:16 ` Uwe Kleine-König
  2024-04-30  4:06   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2024-04-29 20:16 UTC (permalink / raw
  To: Olivia Mackall, Herbert Xu; +Cc: linux-crypto, kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

Hello,

On Sun, Mar 24, 2024 at 11:37:59AM +0100, Uwe Kleine-König wrote:
> 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 mark
> the driver struct with __refdata.)
> 
> Convert the driver to the more usual module_platform_driver().
> 
> This fixes a W=1 build warning:
> 
> 	WARNING: modpost: drivers/char/hw_random/mxc-rnga: section mismatch in reference: mxc_rnga_driver+0x10 (section: .data) -> mxc_rnga_remove (section: .exit.text)
> 
> with CONFIG_HW_RANDOM_MXC_RNGA=m.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Gentle ping?! Who is the one to pick up this patch (or give feedback to
it)?

I want to change modpost to emit this type of warning also for W=0
builds. For that it would be good to have this patch applied first.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] hwrng: mxc-rnga: Drop usage of platform_driver_probe()
  2024-04-29 20:16 ` Uwe Kleine-König
@ 2024-04-30  4:06   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2024-04-30  4:06 UTC (permalink / raw
  To: Uwe Kleine-König; +Cc: Olivia Mackall, linux-crypto, kernel, linux-kbuild

On Mon, Apr 29, 2024 at 10:16:34PM +0200, Uwe Kleine-König wrote:
>
> Gentle ping?! Who is the one to pick up this patch (or give feedback to
> it)?
> 
> I want to change modpost to emit this type of warning also for W=0
> builds. For that it would be good to have this patch applied first.

It's already in cryptodev as commit

	a9a72140536fe02d98bce72a608ccf3ba9008a71

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2024-04-30  4:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-24 10:37 [PATCH] hwrng: mxc-rnga: Drop usage of platform_driver_probe() Uwe Kleine-König
2024-04-29 20:16 ` Uwe Kleine-König
2024-04-30  4:06   ` Herbert Xu

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.