diff mbox

[-next,v2] input: touchscreen: mxs-lradc: Fix return value check in mxs_lradc_ts_probe()

Message ID 20170427151352.23463-1-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun April 27, 2017, 3:13 p.m. UTC
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(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dmitry Torokhov April 27, 2017, 4:52 p.m. UTC | #1
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);
>
Lee Jones April 28, 2017, 7:43 a.m. UTC | #2
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);
> > 
>
diff mbox

Patch

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);