summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2016-03-14 09:07:14 +0900
committerHerbert Xu <herbert@gondor.apana.org.au>2016-04-05 20:35:43 +0800
commit48a61e1e2af8020f11a2b8f8dc878144477623c6 (patch)
tree957f71a6d2ca9bed7d9fc134dd46577b7fc5d8a4 /drivers/char/hw_random
parentf1925d78d7b710a1179828d53e918295f5f5d222 (diff)
downloadlinux-rpi-48a61e1e2af8020f11a2b8f8dc878144477623c6.tar.gz
linux-rpi-48a61e1e2af8020f11a2b8f8dc878144477623c6.tar.bz2
linux-rpi-48a61e1e2af8020f11a2b8f8dc878144477623c6.zip
hwrng: exynos - Disable runtime PM on probe failure
Add proper error path (for disabling runtime PM) when registering of hwrng fails. Fixes: b329669ea0b5 ("hwrng: exynos - Add support for Exynos random number generator") Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/exynos-rng.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c
index 38b80f82ddd2..71b45b153cf2 100644
--- a/drivers/char/hw_random/exynos-rng.c
+++ b/drivers/char/hw_random/exynos-rng.c
@@ -119,6 +119,7 @@ static int exynos_rng_probe(struct platform_device *pdev)
{
struct exynos_rng *exynos_rng;
struct resource *res;
+ int ret;
exynos_rng = devm_kzalloc(&pdev->dev, sizeof(struct exynos_rng),
GFP_KERNEL);
@@ -146,7 +147,13 @@ static int exynos_rng_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_enable(&pdev->dev);
- return devm_hwrng_register(&pdev->dev, &exynos_rng->rng);
+ ret = devm_hwrng_register(&pdev->dev, &exynos_rng->rng);
+ if (ret) {
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ }
+
+ return ret;
}
static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev)