linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: at91-adc: Use devm_platform_ioremap_resource
@ 2020-04-09 15:11 Aishwarya R
  2020-04-09 15:59 ` Alexandre Belloni
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Aishwarya R @ 2020-04-09 15:11 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, Thomas Gleixner, Allison Randal, Kefeng Wang,
	Stephen Boyd, Aishwarya R, linux-iio, linux-arm-kernel,
	linux-kernel

Use the helper function that wraps the calls to
platform_get_resource() and devm_ioremap_resource()
together.

Signed-off-by: Aishwarya R <aishwaryarj100@gmail.com>
---
 drivers/iio/adc/at91_adc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index abe99856c823..0368b6dc6d60 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -1152,7 +1152,6 @@ static int at91_adc_probe(struct platform_device *pdev)
 	int ret;
 	struct iio_dev *idev;
 	struct at91_adc_state *st;
-	struct resource *res;
 	u32 reg;
 
 	idev = devm_iio_device_alloc(&pdev->dev, sizeof(struct at91_adc_state));
@@ -1182,9 +1181,7 @@ static int at91_adc_probe(struct platform_device *pdev)
 	if (st->irq < 0)
 		return -ENODEV;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	st->reg_base = devm_ioremap_resource(&pdev->dev, res);
+	st->reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(st->reg_base))
 		return PTR_ERR(st->reg_base);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-13 15:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 15:11 [PATCH] iio: adc: at91-adc: Use devm_platform_ioremap_resource Aishwarya R
2020-04-09 15:59 ` Alexandre Belloni
2020-04-10 10:55   ` Andy Shevchenko
2020-04-10 11:22     ` Alexandre Belloni
2020-04-10 16:37       ` Andy Shevchenko
2020-04-12 10:23         ` Jonathan Cameron
2020-04-10  9:43 ` Aishwarya R
2020-04-12 10:13 ` Jonathan Cameron
2020-04-12 13:56 ` Aishwarya R
2020-04-13 15:36   ` 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).