char: hw_random: mpfs-rng: removed unneeded call to platform_set_drvdata()
PATCH 1/1 char: hw_random: mpfs-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/mpfs-rng.c | 2 -- 1 file changed, 2 deletions(-)
drivers/char/hw_random/mpfs-rng.c +0 -2
@@ -79,8 +79,6 @@ static int mpfs_rng_probe(struct platform_device *pdev) rng_priv->rng.read = mpfs_rng_read; rng_priv->rng.name = pdev->name; -platform_set_drvdata (pdev, rng_priv); - ret =devm_hwrng_register (&pdev->dev, &rng_priv->rng);if (ret)return dev_err_probe (&pdev->dev, ret,"Failed to register MPFS hwrng\n" );
Signature · 7 lines
2.34.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
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.
I think Greg previously pointed out to you that is it not sufficient to check for platform_get_drvdata() alone, because the information could be accessed without going through that helper. That's not the case here, but it could be true elsewhere.
Thanks,
Conor.
Quoted 22 lines
Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/mpfs-rng.c | 2 -- 1 file changed, 2 deletions(-)drivers/char/hw_random/mpfs-rng.c +0
-2@@ -79,8 +79,6 @@ static int mpfs_rng_probe(struct platform_device *pdev) rng_priv->rng.read = mpfs_rng_read; rng_priv->rng.name = pdev->name; -platform_set_drvdata (pdev, rng_priv); - ret =devm_hwrng_register (&pdev->dev, &rng_priv->rng);if (ret)return dev_err_probe (&pdev->dev, ret,"Failed to register MPFS hwrng\n" );Signature · 1 line
2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Alexandru Ardelean
Reviewed-byQuoted 31 lines · Conor Dooley
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.I think Greg previously pointed out to you that is it not sufficient to check for
platform_get_drvdata()alone, because the information could be accessed without going through that helper. That's not the case here, but it could be true elsewhere.Acked-by Conor Dooley <[email protected]>Thanks,
Conor.Quoted 14 lines
Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/mpfs-rng.c | 2 -- 1 file changed, 2 deletions(-)drivers/char/hw_random/mpfs-rng.c +0
-0@@ -79,8 +79,6 @@ static int mpfs_rng_probe(struct platform_device *pdev) rng_priv->rng.read = mpfs_rng_read; rng_priv->rng.name = pdev->name;
Quoted 3 lines
drivers/char/hw_random/mpfs-rng.c static int mpfs_rng_probe(struct platform_device *pdev) · line 82
Quoted 3 lines
drivers/char/hw_random/mpfs-rng.c +0
-2-platform_set_drvdata (pdev, rng_priv); - ret =devm_hwrng_register (&pdev->dev, &rng_priv->rng);
A question would be if there is a desire to keep the prints below, or would this be sufficient?
return devm_hwrng_register(&pdev->dev, &rng_priv->rng);
If there is the desire to keep the prints, then:
Quoted 5 lines
Quoted 5 lines
drivers/char/hw_random/mpfs-rng.c +0
-1if (ret)return dev_err_probe (&pdev->dev, ret,"Failed to register MPFS hwrng\n" ); --2.34.1
Conor Dooley
maintainerQuoted 39 lines · Alexandru Ardelean
Quoted 31 lines · Conor Dooley
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.I think Greg previously pointed out to you that is it not sufficient to check for
platform_get_drvdata()alone, because the information could be accessed without going through that helper. That's not the case here, but it could be true elsewhere.Acked-by Conor Dooley <[email protected]>Thanks,
Conor.Quoted 14 lines
Signed-off-by Andrei Coardos <[email protected]>--- drivers/char/hw_random/mpfs-rng.c | 2 -- 1 file changed, 2 deletions(-)drivers/char/hw_random/mpfs-rng.c +0
-0@@ -79,8 +79,6 @@ static int mpfs_rng_probe(struct platform_device *pdev) rng_priv->rng.read = mpfs_rng_read; rng_priv->rng.name = pdev->name;Quoted 3 lines
drivers/char/hw_random/mpfs-rng.c static int mpfs_rng_probe(struct platform_device *pdev) · line 82
Quoted 3 lines
drivers/char/hw_random/mpfs-rng.c +0
-2-platform_set_drvdata (pdev, rng_priv); - ret =devm_hwrng_register (&pdev->dev, &rng_priv->rng);A question would be if there is a desire to keep the prints below, or would this be sufficient?
Quoted 3 lines
return devm_hwrng_register(&pdev->dev, &rng_priv->rng);If there is the desire to keep the prints, then:
Yeah, I'd like to keep a print in the failing case, thanks.
Quoted 8 lines
Reviewed-by Alexandru Ardelean <[email protected]>Quoted 5 lines
Quoted 5 lines
drivers/char/hw_random/mpfs-rng.c +0
-1if (ret)return dev_err_probe (&pdev->dev, ret,"Failed to register MPFS hwrng\n" ); --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/mpfs-rng.c | 2 -- 1 file changed, 2 deletions(-)
Patch applied. Thanks.
Signature · 8 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv