All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
@ 2017-04-25  6:26 Wei Yongjun
  2017-04-25  7:09 ` Dmitry Torokhov
  2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2017-04-25  6:26 UTC (permalink / raw)
  To: Dmitry Torokhov, Ksenija Stanojevic, Lee Jones, Marek Vasut
  Cc: Wei Yongjun, linux-input

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 4b4aebf..ff9cda2 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
-	if (IS_ERR(ts->base))
-		return PTR_ERR(ts->base);
+	if (!ts->base)
+		return -ENOMEM;
 
 	ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
 				   &ts_wires);


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

* Re: [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
  2017-04-25  6:26 [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe() Wei Yongjun
@ 2017-04-25  7:09 ` Dmitry Torokhov
  2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
  1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2017-04-25  7:09 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Ksenija Stanojevic, Lee Jones, Marek Vasut, Wei Yongjun, linux-input

Hi Wei,

On Mon, Apr 24, 2017 at 11:26 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function devm_ioremap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.

I'd rather we switched to devm_ioremap_resource() that does return
ERR_PTR-encoded error.

>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index 4b4aebf..ff9cda2 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>
>         iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> -       if (IS_ERR(ts->base))
> -               return PTR_ERR(ts->base);
> +       if (!ts->base)
> +               return -ENOMEM;
>
>         ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
>                                    &ts_wires);
>

Thanks.

-- 
Dmitry

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

* [PATCH -next v2] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
  2017-04-25  6:26 [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe() Wei Yongjun
  2017-04-25  7:09 ` Dmitry Torokhov
@ 2017-04-27 15:13 ` Wei Yongjun
  2017-04-27 16:52   ` Dmitry Torokhov
  1 sibling, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2017-04-27 15:13 UTC (permalink / raw)
  To: Dmitry Torokhov, Marek Vasut, Ksenija Stanojevic, Lee Jones
  Cc: Wei Yongjun, linux-input

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function devm_ioremap() returns NULL pointer not
ERR_PTR(). Use devm_ioremap_resource() instead of devm_ioremap().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: use devm_ioremap_resource()
---
 drivers/input/touchscreen/mxs-lradc-ts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index 4b4aebf..2c5076c 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -630,7 +630,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
 	spin_lock_init(&ts->lock);
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
+	ts->base = devm_ioremap_resource(dev, iores);
 	if (IS_ERR(ts->base))
 		return PTR_ERR(ts->base);


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

* Re: [PATCH -next v2] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
  2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
@ 2017-04-27 16:52   ` Dmitry Torokhov
  2017-04-28  7:43     ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2017-04-27 16:52 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Marek Vasut, Ksenija Stanojevic, Lee Jones, Wei Yongjun, linux-input

On Thu, Apr 27, 2017 at 03:13:52PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In case of error, the function devm_ioremap() returns NULL pointer not
> ERR_PTR(). Use devm_ioremap_resource() instead of devm_ioremap().
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Lee, could you please pick this one up as well?

> ---
> v1 -> v2: use devm_ioremap_resource()
> ---
>  drivers/input/touchscreen/mxs-lradc-ts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index 4b4aebf..2c5076c 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -630,7 +630,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>  	spin_lock_init(&ts->lock);
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> +	ts->base = devm_ioremap_resource(dev, iores);
>  	if (IS_ERR(ts->base))
>  		return PTR_ERR(ts->base);
> 

-- 
Dmitry

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

* Re: [PATCH -next v2] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()
  2017-04-27 16:52   ` Dmitry Torokhov
@ 2017-04-28  7:43     ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2017-04-28  7:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Wei Yongjun, Marek Vasut, Ksenija Stanojevic, Wei Yongjun, linux-input

On Thu, 27 Apr 2017, Dmitry Torokhov wrote:

> On Thu, Apr 27, 2017 at 03:13:52PM +0000, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@huawei.com>
> > 
> > In case of error, the function devm_ioremap() returns NULL pointer not
> > ERR_PTR(). Use devm_ioremap_resource() instead of devm_ioremap().
> > 
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Lee, could you please pick this one up as well?

You'll have to pick this up for -fixes.

I've already tagged MFD for Sunday's merge-window.

> > ---
> > v1 -> v2: use devm_ioremap_resource()
> > ---
> >  drivers/input/touchscreen/mxs-lradc-ts.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> > index 4b4aebf..2c5076c 100644
> > --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> > +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> > @@ -630,7 +630,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
> >  	spin_lock_init(&ts->lock);
> >  
> >  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> > +	ts->base = devm_ioremap_resource(dev, iores);
> >  	if (IS_ERR(ts->base))
> >  		return PTR_ERR(ts->base);
> > 
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2017-04-28  7:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25  6:26 [PATCH -next] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe() Wei Yongjun
2017-04-25  7:09 ` Dmitry Torokhov
2017-04-27 15:13 ` [PATCH -next v2] " Wei Yongjun
2017-04-27 16:52   ` Dmitry Torokhov
2017-04-28  7:43     ` Lee Jones

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.