mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
hwrng: exynos - Disable runtime PM on probe failure
commit48a61e1e2aupstream. Add proper error path (for disabling runtime PM) when registering of hwrng fails. Fixes:b329669ea0("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aaac8cab2f
commit
390bddc4a3
@@ -118,6 +118,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);
|
||||
@@ -145,7 +146,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;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
Reference in New Issue
Block a user