Skip to content

Commit

Permalink
crypto: drivers - simplify getting .drvdata
Browse files Browse the repository at this point in the history
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Wolfram Sang authored and Herbert Xu committed Apr 28, 2018
1 parent 9dbc8a0 commit 8ce31dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions drivers/crypto/exynos-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ static int exynos_rng_remove(struct platform_device *pdev)

static int __maybe_unused exynos_rng_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_rng_dev *rng = platform_get_drvdata(pdev);
struct exynos_rng_dev *rng = dev_get_drvdata(dev);
int ret;

/* If we were never seeded then after resume it will be the same */
Expand Down Expand Up @@ -350,8 +349,7 @@ static int __maybe_unused exynos_rng_suspend(struct device *dev)

static int __maybe_unused exynos_rng_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_rng_dev *rng = platform_get_drvdata(pdev);
struct exynos_rng_dev *rng = dev_get_drvdata(dev);
int ret;

/* Never seeded so nothing to do */
Expand Down
6 changes: 2 additions & 4 deletions drivers/crypto/picoxcell_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,7 @@ static void spacc_spacc_complete(unsigned long data)
#ifdef CONFIG_PM
static int spacc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct spacc_engine *engine = platform_get_drvdata(pdev);
struct spacc_engine *engine = dev_get_drvdata(dev);

/*
* We only support standby mode. All we have to do is gate the clock to
Expand All @@ -1184,8 +1183,7 @@ static int spacc_suspend(struct device *dev)

static int spacc_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct spacc_engine *engine = platform_get_drvdata(pdev);
struct spacc_engine *engine = dev_get_drvdata(dev);

return clk_enable(engine->clk);
}
Expand Down

0 comments on commit 8ce31dc

Please sign in to comment.