summary refs log tree commit diff
path: root/drivers/char
diff options
context:
space:
mode:
authorLionel Debieve <lionel.debieve@st.com>2019-04-01 12:30:45 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-04-15 17:35:10 +0800
commitaf0d4442dd6813de6e77309063beb064fa8e89ae (patch)
treed2ebf1b975e021ef0188eb34a4b4f5f8a7d92242 /drivers/char
parenteda69b0c06bc615f4b055d560ed19001619e611a (diff)
downloadlinux-af0d4442dd6813de6e77309063beb064fa8e89ae.tar.gz
hwrng: stm32 - fix unbalanced pm_runtime_enable
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>
Diffstat (limited to 'drivers/char')
-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 042860d97b15..37b338a76ba4 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -169,6 +169,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)
 {
@@ -210,6 +217,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);