* [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code
@ 2019-04-01 5:19 Anson Huang
2019-04-01 8:02 ` Mukesh Ojha
2019-05-21 5:13 ` dmitry.torokhov
0 siblings, 2 replies; 5+ messages in thread
From: Anson Huang @ 2019-04-01 5:19 UTC (permalink / raw)
To: dmitry.torokhov, shawnguo, s.hauer, kernel, festevam,
linux-input, linux-arm-kernel, linux-kernel
Cc: dl-linux-imx
Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
index c10fc59..e04eecd 100644
--- a/drivers/input/touchscreen/imx6ul_tsc.c
+++ b/drivers/input/touchscreen/imx6ul_tsc.c
@@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct imx6ul_tsc *tsc;
struct input_dev *input_dev;
- struct resource *tsc_mem;
- struct resource *adc_mem;
int err;
int tsc_irq;
int adc_irq;
@@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
return err;
}
- tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem);
+ tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(tsc->tsc_regs)) {
err = PTR_ERR(tsc->tsc_regs);
dev_err(&pdev->dev, "failed to remap tsc memory: %d\n", err);
return err;
}
- adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem);
+ tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(tsc->adc_regs)) {
err = PTR_ERR(tsc->adc_regs);
dev_err(&pdev->dev, "failed to remap adc memory: %d\n", err);
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code
2019-04-01 5:19 [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code Anson Huang
@ 2019-04-01 8:02 ` Mukesh Ojha
2019-04-28 6:30 ` Anson Huang
2019-05-21 5:13 ` dmitry.torokhov
1 sibling, 1 reply; 5+ messages in thread
From: Mukesh Ojha @ 2019-04-01 8:02 UTC (permalink / raw)
To: Anson Huang, dmitry.torokhov, shawnguo, s.hauer, kernel,
festevam, linux-input, linux-arm-kernel, linux-kernel
Cc: dl-linux-imx
On 4/1/2019 10:49 AM, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
> index c10fc59..e04eecd 100644
> --- a/drivers/input/touchscreen/imx6ul_tsc.c
> +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> @@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
> struct device_node *np = pdev->dev.of_node;
> struct imx6ul_tsc *tsc;
> struct input_dev *input_dev;
> - struct resource *tsc_mem;
> - struct resource *adc_mem;
> int err;
> int tsc_irq;
> int adc_irq;
> @@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
> return err;
> }
>
> - tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem);
> + tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(tsc->tsc_regs)) {
> err = PTR_ERR(tsc->tsc_regs);
> dev_err(&pdev->dev, "failed to remap tsc memory: %d\n", err);
> return err;
> }
>
> - adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem);
> + tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(tsc->adc_regs)) {
> err = PTR_ERR(tsc->adc_regs);
> dev_err(&pdev->dev, "failed to remap adc memory: %d\n", err);
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code
2019-04-01 8:02 ` Mukesh Ojha
@ 2019-04-28 6:30 ` Anson Huang
2019-05-09 1:41 ` Anson Huang
0 siblings, 1 reply; 5+ messages in thread
From: Anson Huang @ 2019-04-28 6:30 UTC (permalink / raw)
To: Mukesh Ojha, dmitry.torokhov, shawnguo, s.hauer, kernel,
festevam, linux-input, linux-arm-kernel, linux-kernel
Cc: dl-linux-imx
Ping...
> -----Original Message-----
> From: Mukesh Ojha [mailto:mojha@codeaurora.org]
> Sent: Monday, April 1, 2019 4:02 PM
> To: Anson Huang <anson.huang@nxp.com>; dmitry.torokhov@gmail.com;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; linux-input@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH] input: imx6ul_tsc: use
> devm_platform_ioremap_resource() to simplify code
>
>
> On 4/1/2019 10:49 AM, Anson Huang wrote:
> > Use the new helper devm_platform_ioremap_resource() which wraps the
> > platform_get_resource() and devm_ioremap_resource() together, to
> > simplify the code.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
>
>
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
>
> Cheers,
> -Mukesh
>
> > ---
> > drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------
> > 1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/imx6ul_tsc.c
> > b/drivers/input/touchscreen/imx6ul_tsc.c
> > index c10fc59..e04eecd 100644
> > --- a/drivers/input/touchscreen/imx6ul_tsc.c
> > +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> > @@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct platform_device
> *pdev)
> > struct device_node *np = pdev->dev.of_node;
> > struct imx6ul_tsc *tsc;
> > struct input_dev *input_dev;
> > - struct resource *tsc_mem;
> > - struct resource *adc_mem;
> > int err;
> > int tsc_irq;
> > int adc_irq;
> > @@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct
> platform_device *pdev)
> > return err;
> > }
> >
> > - tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem);
> > + tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0);
> > if (IS_ERR(tsc->tsc_regs)) {
> > err = PTR_ERR(tsc->tsc_regs);
> > dev_err(&pdev->dev, "failed to remap tsc memory: %d\n",
> err);
> > return err;
> > }
> >
> > - adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > - tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem);
> > + tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1);
> > if (IS_ERR(tsc->adc_regs)) {
> > err = PTR_ERR(tsc->adc_regs);
> > dev_err(&pdev->dev, "failed to remap adc memory: %d\n",
> err);
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code
2019-04-28 6:30 ` Anson Huang
@ 2019-05-09 1:41 ` Anson Huang
0 siblings, 0 replies; 5+ messages in thread
From: Anson Huang @ 2019-05-09 1:41 UTC (permalink / raw)
To: Mukesh Ojha, dmitry.torokhov, shawnguo, s.hauer, kernel,
festevam, linux-input, linux-arm-kernel, linux-kernel
Cc: dl-linux-imx
Ping...
> -----Original Message-----
> From: Anson Huang
> Sent: Sunday, April 28, 2019 2:30 PM
> To: Mukesh Ojha <mojha@codeaurora.org>; dmitry.torokhov@gmail.com;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; linux-input@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: RE: [PATCH] input: imx6ul_tsc: use
> devm_platform_ioremap_resource() to simplify code
>
> Ping...
>
> > -----Original Message-----
> > From: Mukesh Ojha [mailto:mojha@codeaurora.org]
> > Sent: Monday, April 1, 2019 4:02 PM
> > To: Anson Huang <anson.huang@nxp.com>; dmitry.torokhov@gmail.com;
> > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> > festevam@gmail.com; linux-input@vger.kernel.org; linux-arm-
> > kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> > Cc: dl-linux-imx <linux-imx@nxp.com>
> > Subject: Re: [PATCH] input: imx6ul_tsc: use
> > devm_platform_ioremap_resource() to simplify code
> >
> >
> > On 4/1/2019 10:49 AM, Anson Huang wrote:
> > > Use the new helper devm_platform_ioremap_resource() which wraps the
> > > platform_get_resource() and devm_ioremap_resource() together, to
> > > simplify the code.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >
> >
> > Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
> >
> > Cheers,
> > -Mukesh
> >
> > > ---
> > > drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------
> > > 1 file changed, 2 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/input/touchscreen/imx6ul_tsc.c
> > > b/drivers/input/touchscreen/imx6ul_tsc.c
> > > index c10fc59..e04eecd 100644
> > > --- a/drivers/input/touchscreen/imx6ul_tsc.c
> > > +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> > > @@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct
> > > platform_device
> > *pdev)
> > > struct device_node *np = pdev->dev.of_node;
> > > struct imx6ul_tsc *tsc;
> > > struct input_dev *input_dev;
> > > - struct resource *tsc_mem;
> > > - struct resource *adc_mem;
> > > int err;
> > > int tsc_irq;
> > > int adc_irq;
> > > @@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct
> > platform_device *pdev)
> > > return err;
> > > }
> > >
> > > - tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > - tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem);
> > > + tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0);
> > > if (IS_ERR(tsc->tsc_regs)) {
> > > err = PTR_ERR(tsc->tsc_regs);
> > > dev_err(&pdev->dev, "failed to remap tsc memory: %d\n",
> > err);
> > > return err;
> > > }
> > >
> > > - adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > > - tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem);
> > > + tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1);
> > > if (IS_ERR(tsc->adc_regs)) {
> > > err = PTR_ERR(tsc->adc_regs);
> > > dev_err(&pdev->dev, "failed to remap adc memory: %d\n",
> > err);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code
2019-04-01 5:19 [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-04-01 8:02 ` Mukesh Ojha
@ 2019-05-21 5:13 ` dmitry.torokhov
1 sibling, 0 replies; 5+ messages in thread
From: dmitry.torokhov @ 2019-05-21 5:13 UTC (permalink / raw)
To: Anson Huang
Cc: shawnguo, s.hauer, kernel, festevam, linux-input,
linux-arm-kernel, linux-kernel, dl-linux-imx
On Mon, Apr 01, 2019 at 05:19:55AM +0000, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
> index c10fc59..e04eecd 100644
> --- a/drivers/input/touchscreen/imx6ul_tsc.c
> +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> @@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
> struct device_node *np = pdev->dev.of_node;
> struct imx6ul_tsc *tsc;
> struct input_dev *input_dev;
> - struct resource *tsc_mem;
> - struct resource *adc_mem;
> int err;
> int tsc_irq;
> int adc_irq;
> @@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
> return err;
> }
>
> - tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem);
> + tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(tsc->tsc_regs)) {
> err = PTR_ERR(tsc->tsc_regs);
> dev_err(&pdev->dev, "failed to remap tsc memory: %d\n", err);
> return err;
> }
>
> - adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem);
> + tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(tsc->adc_regs)) {
> err = PTR_ERR(tsc->adc_regs);
> dev_err(&pdev->dev, "failed to remap adc memory: %d\n", err);
> --
> 2.7.4
>
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-05-21 5:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 5:19 [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-04-01 8:02 ` Mukesh Ojha
2019-04-28 6:30 ` Anson Huang
2019-05-09 1:41 ` Anson Huang
2019-05-21 5:13 ` dmitry.torokhov
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).