From: Aishwarya R <aishwaryarj100@gmail.com> To: Jonathan Cameron <jic23@kernel.org>, Hartmut Knaack <knaack.h@gmx.de>, Lars-Peter Clausen <lars@metafoo.de>, Peter Meerwald-Stadler <pmeerw@pmeerw.net>, Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Enrico Weigelt <info@metux.net>, Allison Randal <allison@lohutok.net>, Yangtao Li <tiny.windzz@gmail.com>, Stephen Boyd <swboyd@chromium.org>, Aishwarya R <aishwaryarj100@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Date: Sun, 12 Apr 2020 20:02:18 +0530 [thread overview] Message-ID: <20200412143220.4476-1-aishwaryarj100@gmail.com> (raw) In-Reply-To: <20200409141331.30882-1-aishwaryarj100@gmail.com> From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.Reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> --- drivers/iio/adc/sun4i-gpadc-iio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 176e1cb4abb1..0f2c1738a90d 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -496,7 +496,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, struct iio_dev *indio_dev) { struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - struct resource *mem; void __iomem *base; int ret; @@ -508,8 +507,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels); indio_dev->channels = sun8i_a33_gpadc_channels; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, mem); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) return PTR_ERR(base); -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Aishwarya R <aishwaryarj100@gmail.com> To: Jonathan Cameron <jic23@kernel.org>, Hartmut Knaack <knaack.h@gmx.de>, Lars-Peter Clausen <lars@metafoo.de>, Peter Meerwald-Stadler <pmeerw@pmeerw.net>, Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Enrico Weigelt <info@metux.net>, Allison Randal <allison@lohutok.net>, Yangtao Li <tiny.windzz@gmail.com>, Stephen Boyd <swboyd@chromium.org>, Aishwarya R <aishwaryarj100@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Date: Sun, 12 Apr 2020 20:02:18 +0530 [thread overview] Message-ID: <20200412143220.4476-1-aishwaryarj100@gmail.com> (raw) In-Reply-To: <20200409141331.30882-1-aishwaryarj100@gmail.com> From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.Reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> --- drivers/iio/adc/sun4i-gpadc-iio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 176e1cb4abb1..0f2c1738a90d 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -496,7 +496,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, struct iio_dev *indio_dev) { struct sun4i_gpadc_iio *info = iio_priv(indio_dev); - struct resource *mem; void __iomem *base; int ret; @@ -508,8 +507,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels); indio_dev->channels = sun8i_a33_gpadc_channels; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, mem); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) return PTR_ERR(base); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-04-12 14:32 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-09 14:13 [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Aishwarya R 2020-04-09 14:13 ` Aishwarya R 2020-04-12 14:32 ` Aishwarya R [this message] 2020-04-12 14:32 ` Aishwarya R 2020-04-13 15:33 ` Jonathan Cameron 2020-04-13 15:33 ` Jonathan Cameron
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200412143220.4476-1-aishwaryarj100@gmail.com \ --to=aishwaryarj100@gmail.com \ --cc=allison@lohutok.net \ --cc=info@metux.net \ --cc=jic23@kernel.org \ --cc=knaack.h@gmx.de \ --cc=lars@metafoo.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-iio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mripard@kernel.org \ --cc=pmeerw@pmeerw.net \ --cc=swboyd@chromium.org \ --cc=tglx@linutronix.de \ --cc=tiny.windzz@gmail.com \ --cc=wens@csie.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.