Skip to contentSkip to conversation

char: hw_random: hisi-rng: removed unneeded call to platform_set_drvdata()

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

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

PATCH 1/1 char: hw_random: hisi-rng: removed unneeded 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/hisi-rng.c | 2 --
 1 file changed, 2 deletions(-)
drivers/char/hw_random/hisi-rng.c +0 -2
index 96438f85cafa..b6f27566e0ba 100644
@@ -79,8 +79,6 @@ static int hisi_rng_probe(struct platform_device *pdev)
 	if (!rng)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, rng);
-
 	rng->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rng->base))
 		return PTR_ERR(rng->base);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 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/hisi-rng.c | 2 --
 1 file changed, 2 deletions(-)
drivers/char/hw_random/hisi-rng.c +0 -2
index 96438f85cafa..b6f27566e0ba 100644
@@ -79,8 +79,6 @@ static int hisi_rng_probe(struct platform_device *pdev)
 	if (!rng)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, rng);
-
 	rng->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rng->base))
 		return PTR_ERR(rng->base);
Signature · 1 line
2.34.1

This one can go.

Reviewed-by
#2 lore raw
Quoted 29 lines · Martin Kaiser
Quoted 24 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/hisi-rng.c | 2 --
 1 file changed, 2 deletions(-)
drivers/char/hw_random/hisi-rng.c +0 -3
index 96438f85cafa..b6f27566e0ba 100644
@@ -79,8 +79,6 @@ static int hisi_rng_probe(struct platform_device *pdev)
      if (!rng)
              return -ENOMEM;
 
-     platform_set_drvdata(pdev, rng);
-
      rng->base = devm_platform_ioremap_resource(pdev, 0);
      if (IS_ERR(rng->base))
              return PTR_ERR(rng->base);
--
Quoted 1 line

2.34.1

Quoted 2 lines

This one can go.

Quoted 1 line
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/hisi-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