char: hw_random: xiphera-trng: removed unnneded platform_set_drvdata()
Subsystems (2)
PATCH 1/1 char: hw_random: xiphera-trng: removed unnneded 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/xiphera-trng.c | 2 -- 1 file changed, 2 deletions(-)
drivers/char/hw_random/xiphera-trng.c +0 -2
@@ -122,8 +122,6 @@ static int xiphera_trng_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, trng); -return 0 ; }
Signature · 1 line
2.34.1
Quoted 16 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.Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/xiphera-trng.c | 2 -- 1 file changed, 2 deletions(-)drivers/char/hw_random/xiphera-trng.c +0
-0
drivers/char/hw_random/xiphera-trng.c static int xiphera_trng_probe(struct platform_device *pdev) · line 125
Quoted 6 lines
drivers/char/hw_random/xiphera-trng.c +0
-2@@ -122,8 +122,6 @@ static int xiphera_trng_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, trng); -return 0 ;
This entire block could become now:
return devm_hwrng_register(dev, &trng->rng);
Quoted 5 lines
drivers/char/hw_random/xiphera-trng.c +0
-1} --2.34.1
Alexandru Ardelean
Reviewed-byQuoted 21 lines · Alexandru Ardelean
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.Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/xiphera-trng.c | 2 -- 1 file changed, 2 deletions(-)drivers/char/hw_random/xiphera-trng.c +0
-0@@ -122,8 +122,6 @@ static int xiphera_trng_probe(struct platform_device *pdev)return ret; }
Quoted 8 lines
drivers/char/hw_random/xiphera-trng.c static int xiphera_trng_probe(struct platform_device *pdev) · line 125
Quoted 3 lines
drivers/char/hw_random/xiphera-trng.c +0
-2-platform_set_drvdata (pdev, trng); -return 0 ;This entire block could become now:
return devm_hwrng_register(dev, &trng->rng);
Coming back here.
I wonder if there is a desire to keep the prints above. If yes, then this is fine as-is.
With that:
Quoted 5 lines
Quoted 5 lines
drivers/char/hw_random/xiphera-trng.c +0
-1} --2.34.1
Herbert Xu
maintainerQuoted 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.Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/xiphera-trng.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