* [PATCH] iio: dac: stm32-dac: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08 10:56 Cai Huoqing
2021-09-19 17:33 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-08 10:56 UTC (permalink / raw)
To: caihuoqing
Cc: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel,
linux-kernel
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
drivers/iio/dac/stm32-dac-core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c
index 906436780347..9a6a68b11b2a 100644
--- a/drivers/iio/dac/stm32-dac-core.c
+++ b/drivers/iio/dac/stm32-dac-core.c
@@ -90,7 +90,6 @@ static int stm32_dac_probe(struct platform_device *pdev)
const struct stm32_dac_cfg *cfg;
struct stm32_dac_priv *priv;
struct regmap *regmap;
- struct resource *res;
void __iomem *mmio;
struct reset_control *rst;
int ret;
@@ -106,8 +105,7 @@ static int stm32_dac_probe(struct platform_device *pdev)
cfg = (const struct stm32_dac_cfg *)
of_match_device(dev->driver->of_match_table, dev)->data;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mmio = devm_ioremap_resource(dev, res);
+ mmio = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mmio))
return PTR_ERR(mmio);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: dac: stm32-dac: Make use of the helper function devm_platform_ioremap_resource()
2021-09-08 10:56 [PATCH] iio: dac: stm32-dac: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-19 17:33 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-09-19 17:33 UTC (permalink / raw)
To: Cai Huoqing, linux-iio
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
linux-stm32, linux-arm-kernel, linux-kernel
On Wed, 8 Sep 2021 18:56:38 +0800
Cai Huoqing <caihuoqing@baidu.com> wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Applied to the togreg branch of iio.git and pushed out as testing for 0-day
to see if it can find any problems that we missed.
Thanks,
Jonathan
> ---
> drivers/iio/dac/stm32-dac-core.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c
> index 906436780347..9a6a68b11b2a 100644
> --- a/drivers/iio/dac/stm32-dac-core.c
> +++ b/drivers/iio/dac/stm32-dac-core.c
> @@ -90,7 +90,6 @@ static int stm32_dac_probe(struct platform_device *pdev)
> const struct stm32_dac_cfg *cfg;
> struct stm32_dac_priv *priv;
> struct regmap *regmap;
> - struct resource *res;
> void __iomem *mmio;
> struct reset_control *rst;
> int ret;
> @@ -106,8 +105,7 @@ static int stm32_dac_probe(struct platform_device *pdev)
> cfg = (const struct stm32_dac_cfg *)
> of_match_device(dev->driver->of_match_table, dev)->data;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - mmio = devm_ioremap_resource(dev, res);
> + mmio = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(mmio))
> return PTR_ERR(mmio);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-19 17:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 10:56 [PATCH] iio: dac: stm32-dac: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-19 17:33 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).