Skip to contentSkip to conversation

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

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

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

PATCH 1/1 char: hw_random: xgene-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/xgene-rng.c | 1 -
 1 file changed, 1 deletion(-)
drivers/char/hw_random/xgene-rng.c +0 -1
index 7c8f3cb7c6af..9d64b5931a27 100644
@@ -321,7 +321,6 @@ static int xgene_rng_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ctx->dev = &pdev->dev;
-	platform_set_drvdata(pdev, ctx);
 
 	ctx->csr_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ctx->csr_base))
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
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/xgene-rng.c | 1 -
 1 file changed, 1 deletion(-)
drivers/char/hw_random/xgene-rng.c +0 -1
index 7c8f3cb7c6af..9d64b5931a27 100644
@@ -321,7 +321,6 @@ static int xgene_rng_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ctx->dev = &pdev->dev;
-	platform_set_drvdata(pdev, ctx);
 
 	ctx->csr_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ctx->csr_base))
Signature · 1 line
2.34.1

This one's ok, too. 67fb1e295839 ("hwrng: xgene - Simplify using devm_clk_get_optional_enabled()") removed the platform_get_drvdata call.

Reviewed-by
#2 lore raw
Quoted 23 lines · Martin Kaiser
Quoted 19 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/xgene-rng.c | 1 -
 1 file changed, 1 deletion(-)
drivers/char/hw_random/xgene-rng.c +0 -1
index 7c8f3cb7c6af..9d64b5931a27 100644
@@ -321,7 +321,6 @@ static int xgene_rng_probe(struct platform_device *pdev)
              return -ENOMEM;
 
      ctx->dev = &pdev->dev;
-     platform_set_drvdata(pdev, ctx);
Quoted 8 lines
Quoted 4 lines
drivers/char/hw_random/xgene-rng.c +0 -1
      ctx->csr_base = devm_platform_ioremap_resource(pdev, 0);
      if (IS_ERR(ctx->csr_base))
--

2.34.1

This one's ok, too. 67fb1e295839 ("hwrng: xgene - Simplify using devm_clk_get_optional_enabled()") removed the platform_get_drvdata call.

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/xgene-rng.c | 1 -
 1 file changed, 1 deletion(-)

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