hwrng: stm32 - Fix build with CONFIG_PM
authorDaniel Thompson <daniel.thompson@linaro.org>
Wed, 14 Oct 2015 16:04:55 +0000 (17:04 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 15 Oct 2015 01:50:39 +0000 (09:50 +0800)
Commit c6a97c42e399 ("hwrng: stm32 - add support for STM32 HW RNG")
was inadequately tested (actually it was tested quite hard so
incompetent would be a better description that inadequate) and does
not compile on platforms with CONFIG_PM set.

Fix this.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/stm32-rng.c

index 7fa3656a5fc579cce2ac01f7f2bde57978b3662f..92a810648bd00a425fb0e40079797c12272e973b 100644 (file)
@@ -160,7 +160,7 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 #ifdef CONFIG_PM
 static int stm32_rng_runtime_suspend(struct device *dev)
 {
-       struct stm32_rng_private *priv = dev_get_drvdata(pdev);
+       struct stm32_rng_private *priv = dev_get_drvdata(dev);
 
        stm32_rng_cleanup(&priv->rng);
 
@@ -169,7 +169,7 @@ static int stm32_rng_runtime_suspend(struct device *dev)
 
 static int stm32_rng_runtime_resume(struct device *dev)
 {
-       struct stm32_rng_private *priv = dev_get_drvdata(pdev);
+       struct stm32_rng_private *priv = dev_get_drvdata(dev);
 
        return stm32_rng_init(&priv->rng);
 }