summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random/stm32-rng.c
diff options
context:
space:
mode:
authorLionel Debieve <lionel.debieve@st.com>2019-04-01 12:30:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 15:35:32 +0100
commit665eb2dbc8f6fd47d97805a32f9b7385c80312a2 (patch)
tree2972a6bbdbf058debb1a12801a61b8bc98c65006 /drivers/char/hw_random/stm32-rng.c
parent08d5c69a81cb603aaab69496fbfd3ec511069031 (diff)
hwrng: stm32 - fix unbalanced pm_runtime_enable
commit af0d4442dd6813de6e77309063beb064fa8e89ae upstream. No remove function implemented yet in the driver. Without remove function, the pm_runtime implementation complains when removing and probing again the driver. Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/hw_random/stm32-rng.c')
-rw-r--r--drivers/char/hw_random/stm32-rng.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 83c695938a2d..f53d47e3355d 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -166,6 +166,13 @@ static int stm32_rng_probe(struct platform_device *ofdev)
return devm_hwrng_register(dev, &priv->rng);
}
+static int stm32_rng_remove(struct platform_device *ofdev)
+{
+ pm_runtime_disable(&ofdev->dev);
+
+ return 0;
+}
+
#ifdef CONFIG_PM
static int stm32_rng_runtime_suspend(struct device *dev)
{
@@ -202,6 +209,7 @@ static struct platform_driver stm32_rng_driver = {
.of_match_table = stm32_rng_match,
},
.probe = stm32_rng_probe,
+ .remove = stm32_rng_remove,
};
module_platform_driver(stm32_rng_driver);