Skip to content

Commit af0d444

Browse files
ldebieveherbertx
authored andcommitted
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>
1 parent eda69b0 commit af0d444

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/char/hw_random/stm32-rng.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ static int stm32_rng_probe(struct platform_device *ofdev)
169169
return devm_hwrng_register(dev, &priv->rng);
170170
}
171171

172+
static int stm32_rng_remove(struct platform_device *ofdev)
173+
{
174+
pm_runtime_disable(&ofdev->dev);
175+
176+
return 0;
177+
}
178+
172179
#ifdef CONFIG_PM
173180
static int stm32_rng_runtime_suspend(struct device *dev)
174181
{
@@ -210,6 +217,7 @@ static struct platform_driver stm32_rng_driver = {
210217
.of_match_table = stm32_rng_match,
211218
},
212219
.probe = stm32_rng_probe,
220+
.remove = stm32_rng_remove,
213221
};
214222

215223
module_platform_driver(stm32_rng_driver);

0 commit comments

Comments
 (0)