Skip to contentSkip to conversation

char: hw_random: bcm2835-rng: removed call to platform_set_drvdata()

PATCH In review Andrei Coardos 4 participants 4 messages Aug 23, 2023 – Sep 15, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 char: hw_random: bcm2835-rng: removed call to platform_set_drvdata()

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

---
 drivers/char/hw_random/bcm2835-rng.c | 2 --
 1 file changed, 2 deletions(-)
drivers/char/hw_random/bcm2835-rng.c +0 -2
index e98fcac578d6..0238f487f9ab 100644
@@ -150,8 +150,6 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, priv);
-
 	/* map peripheral */
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->base))
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andrei Coardos

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

You're right. The platform_get_drvdata call was removed in 4c04b3729 ("hwrng: bcm2835 - Use device managed helpers").

Reviewed-by
#2 lore raw
Quoted 11 lines · Martin Kaiser
Quoted 4 lines · Andrei Coardos

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

You're right. The platform_get_drvdata call was removed in 4c04b3729 ("hwrng: bcm2835 - Use device managed helpers").

Quoted 1 line

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#3 lore raw
In reply to Andrei Coardos
Quoted 9 lines · Andrei Coardos

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

---
 drivers/char/hw_random/bcm2835-rng.c | 2 --
 1 file changed, 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt