diff options
author | Gatien Chevallier <gatien.chevallier@foss.st.com> | 2023-09-21 10:02:54 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-10-01 16:28:15 +0800 |
commit | 18d9a8262bd4e481fac99c60a0bc2effd04fdea9 (patch) | |
tree | fd35ea8f5c1c3f9da4646f1bedf75b915196afbb /drivers/char | |
parent | 0d2d67b48646b3b7d5f830525e3779a0f9efa424 (diff) |
hwrng: stm32 - use devm_platform_get_and_ioremap_resource() API
Use devm_platform_get_and_ioremap_resource() to get and ioremap a
resource.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.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.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index efb6a9f9a11b..d64d25d0fee8 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -118,18 +118,13 @@ static int stm32_rng_probe(struct platform_device *ofdev) struct device *dev = &ofdev->dev; struct device_node *np = ofdev->dev.of_node; struct stm32_rng_private *priv; - struct resource res; - int err; + struct resource *res; priv = devm_kzalloc(dev, sizeof(struct stm32_rng_private), GFP_KERNEL); if (!priv) return -ENOMEM; - err = of_address_to_resource(np, 0, &res); - if (err) - return err; - - priv->base = devm_ioremap_resource(dev, &res); + priv->base = devm_platform_get_and_ioremap_resource(ofdev, 0, &res); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); |