linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Input: Use devm_platform_ioremap_resource()
@ 2019-04-04  7:17 Mukesh Ojha
  2019-04-04  7:17 ` [PATCH 1/5] Input: fsl-imx25-tcq: " Mukesh Ojha
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

Hi All,

This is just a minor change to promote using of this api
devm_platform_ioremap_resource() and nothing else functional
change it does.

Also, there are patches where only ioremap is used without requesting
the mem region so this devm_platform_ioremap_resource() take cares all
of that in single call.


Mukesh Ojha (5):
  Input: fsl-imx25-tcq: Use devm_platform_ioremap_resource()
  Input: mxs-lradc-ts.c: Use devm_platform_ioremap_resource()
  Input: s3c2410_ts: Use devm_platform_ioremap_resource()
  Input: sun4i-ts: Use devm_platform_ioremap_resource()
  Input: ts4800-ts: Use devm_platform_ioremap_resource()

 drivers/input/touchscreen/fsl-imx25-tcq.c |  4 +---
 drivers/input/touchscreen/mxs-lradc-ts.c  |  6 +-----
 drivers/input/touchscreen/s3c2410_ts.c    | 10 +---------
 drivers/input/touchscreen/sun4i-ts.c      |  3 +--
 drivers/input/touchscreen/ts4800-ts.c     |  4 +---
 5 files changed, 5 insertions(+), 22 deletions(-)

-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/5] Input: fsl-imx25-tcq: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
@ 2019-04-04  7:17 ` Mukesh Ojha
  2019-07-16  7:30   ` Dmitry Torokhov
  2019-04-04  7:17 ` [PATCH 2/5] Input: mxs-lradc-ts.c: " Mukesh Ojha
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/input/touchscreen/fsl-imx25-tcq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/fsl-imx25-tcq.c b/drivers/input/touchscreen/fsl-imx25-tcq.c
index 1d6c8f4..b66df8a 100644
--- a/drivers/input/touchscreen/fsl-imx25-tcq.c
+++ b/drivers/input/touchscreen/fsl-imx25-tcq.c
@@ -503,7 +503,6 @@ static int mx25_tcq_probe(struct platform_device *pdev)
 	struct input_dev *idev;
 	struct mx25_tcq_priv *priv;
 	struct mx25_tsadc *tsadc = dev_get_drvdata(dev->parent);
-	struct resource *res;
 	void __iomem *mem;
 	int error;
 
@@ -512,8 +511,7 @@ static int mx25_tcq_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	priv->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mem = devm_ioremap_resource(dev, res);
+	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
 		return PTR_ERR(mem);
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/5] Input: mxs-lradc-ts.c: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
  2019-04-04  7:17 ` [PATCH 1/5] Input: fsl-imx25-tcq: " Mukesh Ojha
@ 2019-04-04  7:17 ` Mukesh Ojha
  2019-07-16  7:32   ` Dmitry Torokhov
  2019-04-04  7:17 ` [PATCH 3/5] Input: s3c2410_ts: " Mukesh Ojha
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/input/touchscreen/mxs-lradc-ts.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
index c850b51..af047fa 100644
--- a/drivers/input/touchscreen/mxs-lradc-ts.c
+++ b/drivers/input/touchscreen/mxs-lradc-ts.c
@@ -615,7 +615,6 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
 	struct device_node *node = dev->parent->of_node;
 	struct mxs_lradc *lradc = dev_get_drvdata(dev->parent);
 	struct mxs_lradc_ts *ts;
-	struct resource *iores;
 	int ret, irq, virq, i;
 	u32 ts_wires = 0, adapt;
 
@@ -629,10 +628,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
 	ts->dev = dev;
 	spin_lock_init(&ts->lock);
 
-	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!iores)
-		return -EINVAL;
-	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
+	ts->base = devm_platform_ioremap_resource(pdev, 0);
 	if (!ts->base)
 		return -ENOMEM;
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/5] Input: s3c2410_ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
  2019-04-04  7:17 ` [PATCH 1/5] Input: fsl-imx25-tcq: " Mukesh Ojha
  2019-04-04  7:17 ` [PATCH 2/5] Input: mxs-lradc-ts.c: " Mukesh Ojha
@ 2019-04-04  7:17 ` Mukesh Ojha
  2019-07-16  7:39   ` Dmitry Torokhov
  2019-04-04  7:17 ` [PATCH 4/5] Input: sun4i-ts: " Mukesh Ojha
  2019-04-04  7:17 ` [PATCH 5/5] Input: ts4800-ts: " Mukesh Ojha
  4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/input/touchscreen/s3c2410_ts.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 1173890..e11cdae 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -242,7 +242,6 @@ static int s3c2410ts_probe(struct platform_device *pdev)
 	struct s3c2410_ts_mach_info *info;
 	struct device *dev = &pdev->dev;
 	struct input_dev *input_dev;
-	struct resource *res;
 	int ret = -EINVAL;
 
 	/* Initialise input stuff */
@@ -277,14 +276,7 @@ static int s3c2410ts_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "no resource for registers\n");
-		ret = -ENOENT;
-		goto err_clk;
-	}
-
-	ts.io = ioremap(res->start, resource_size(res));
+	ts.io = devm_platform_ioremap_resource(pdev, 0);
 	if (ts.io == NULL) {
 		dev_err(dev, "cannot map registers\n");
 		ret = -ENOMEM;
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/5] Input: sun4i-ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
                   ` (2 preceding siblings ...)
  2019-04-04  7:17 ` [PATCH 3/5] Input: s3c2410_ts: " Mukesh Ojha
@ 2019-04-04  7:17 ` Mukesh Ojha
  2019-07-16  7:34   ` Dmitry Torokhov
  2019-04-04  7:17 ` [PATCH 5/5] Input: ts4800-ts: " Mukesh Ojha
  4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/input/touchscreen/sun4i-ts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index d2e14d9..bbb0104 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -309,8 +309,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 		input_set_drvdata(ts->input, ts);
 	}
 
-	ts->base = devm_ioremap_resource(dev,
-			      platform_get_resource(pdev, IORESOURCE_MEM, 0));
+	ts->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ts->base))
 		return PTR_ERR(ts->base);
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/5] Input: ts4800-ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
                   ` (3 preceding siblings ...)
  2019-04-04  7:17 ` [PATCH 4/5] Input: sun4i-ts: " Mukesh Ojha
@ 2019-04-04  7:17 ` Mukesh Ojha
  2019-07-16  7:34   ` Dmitry Torokhov
  4 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2019-04-04  7:17 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer, linux-imx, linux-input,
	linux-arm-kernel, linux-kernel
  Cc: Mukesh Ojha

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/input/touchscreen/ts4800-ts.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c
index fed73ee..5b4f536 100644
--- a/drivers/input/touchscreen/ts4800-ts.c
+++ b/drivers/input/touchscreen/ts4800-ts.c
@@ -148,7 +148,6 @@ static int ts4800_ts_probe(struct platform_device *pdev)
 {
 	struct input_polled_dev *poll_dev;
 	struct ts4800_ts *ts;
-	struct resource *res;
 	int error;
 
 	ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL);
@@ -159,8 +158,7 @@ static int ts4800_ts_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ts->base = devm_ioremap_resource(&pdev->dev, res);
+	ts->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ts->base))
 		return PTR_ERR(ts->base);
 
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/5] Input: fsl-imx25-tcq: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 ` [PATCH 1/5] Input: fsl-imx25-tcq: " Mukesh Ojha
@ 2019-07-16  7:30   ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2019-07-16  7:30 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: s.hauer, linux-kernel, linux-imx, linux-input, shawnguo,
	linux-arm-kernel

On Thu, Apr 04, 2019 at 12:47:19PM +0530, Mukesh Ojha wrote:
> devm_platform_ioremap_resource() internally have platform_get_resource()
> and devm_ioremap_resource() in it. So instead of calling them separately
> use devm_platform_ioremap_resource() directly.
> 
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/fsl-imx25-tcq.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/fsl-imx25-tcq.c b/drivers/input/touchscreen/fsl-imx25-tcq.c
> index 1d6c8f4..b66df8a 100644
> --- a/drivers/input/touchscreen/fsl-imx25-tcq.c
> +++ b/drivers/input/touchscreen/fsl-imx25-tcq.c
> @@ -503,7 +503,6 @@ static int mx25_tcq_probe(struct platform_device *pdev)
>  	struct input_dev *idev;
>  	struct mx25_tcq_priv *priv;
>  	struct mx25_tsadc *tsadc = dev_get_drvdata(dev->parent);
> -	struct resource *res;
>  	void __iomem *mem;
>  	int error;
>  
> @@ -512,8 +511,7 @@ static int mx25_tcq_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	priv->dev = dev;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	mem = devm_ioremap_resource(dev, res);
> +	mem = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mem))
>  		return PTR_ERR(mem);
>  
> -- 
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
> Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
> 

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/5] Input: mxs-lradc-ts.c: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 ` [PATCH 2/5] Input: mxs-lradc-ts.c: " Mukesh Ojha
@ 2019-07-16  7:32   ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2019-07-16  7:32 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: s.hauer, linux-kernel, linux-imx, linux-input, shawnguo,
	linux-arm-kernel

On Thu, Apr 04, 2019 at 12:47:20PM +0530, Mukesh Ojha wrote:
> devm_platform_ioremap_resource() internally have platform_get_resource()
> and devm_ioremap_resource() in it. So instead of calling them separately
> use devm_platform_ioremap_resource() directly.
> 
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
> ---
>  drivers/input/touchscreen/mxs-lradc-ts.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index c850b51..af047fa 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -615,7 +615,6 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>  	struct device_node *node = dev->parent->of_node;
>  	struct mxs_lradc *lradc = dev_get_drvdata(dev->parent);
>  	struct mxs_lradc_ts *ts;
> -	struct resource *iores;
>  	int ret, irq, virq, i;
>  	u32 ts_wires = 0, adapt;
>  
> @@ -629,10 +628,7 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>  	ts->dev = dev;
>  	spin_lock_init(&ts->lock);
>  
> -	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!iores)
> -		return -EINVAL;
> -	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> +	ts->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (!ts->base)
>  		return -ENOMEM;

This driver did not implement error handling properly (should have used
IS_ERR()/PTR_ERR()), I adjusted and applied.

Thanks.

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 4/5] Input: sun4i-ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 ` [PATCH 4/5] Input: sun4i-ts: " Mukesh Ojha
@ 2019-07-16  7:34   ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2019-07-16  7:34 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: s.hauer, linux-kernel, linux-imx, linux-input, shawnguo,
	linux-arm-kernel

On Thu, Apr 04, 2019 at 12:47:22PM +0530, Mukesh Ojha wrote:
> devm_platform_ioremap_resource() internally have platform_get_resource()
> and devm_ioremap_resource() in it. So instead of calling them separately
> use devm_platform_ioremap_resource() directly.
> 
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/sun4i-ts.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
> index d2e14d9..bbb0104 100644
> --- a/drivers/input/touchscreen/sun4i-ts.c
> +++ b/drivers/input/touchscreen/sun4i-ts.c
> @@ -309,8 +309,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  		input_set_drvdata(ts->input, ts);
>  	}
>  
> -	ts->base = devm_ioremap_resource(dev,
> -			      platform_get_resource(pdev, IORESOURCE_MEM, 0));
> +	ts->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(ts->base))
>  		return PTR_ERR(ts->base);
>  
> -- 
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
> Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
> 

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5] Input: ts4800-ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 ` [PATCH 5/5] Input: ts4800-ts: " Mukesh Ojha
@ 2019-07-16  7:34   ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2019-07-16  7:34 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: s.hauer, linux-kernel, linux-imx, linux-input, shawnguo,
	linux-arm-kernel

On Thu, Apr 04, 2019 at 12:47:23PM +0530, Mukesh Ojha wrote:
> devm_platform_ioremap_resource() internally have platform_get_resource()
> and devm_ioremap_resource() in it. So instead of calling them separately
> use devm_platform_ioremap_resource() directly.
> 
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/ts4800-ts.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c
> index fed73ee..5b4f536 100644
> --- a/drivers/input/touchscreen/ts4800-ts.c
> +++ b/drivers/input/touchscreen/ts4800-ts.c
> @@ -148,7 +148,6 @@ static int ts4800_ts_probe(struct platform_device *pdev)
>  {
>  	struct input_polled_dev *poll_dev;
>  	struct ts4800_ts *ts;
> -	struct resource *res;
>  	int error;
>  
>  	ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL);
> @@ -159,8 +158,7 @@ static int ts4800_ts_probe(struct platform_device *pdev)
>  	if (error)
>  		return error;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ts->base = devm_ioremap_resource(&pdev->dev, res);
> +	ts->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(ts->base))
>  		return PTR_ERR(ts->base);
>  
> -- 
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
> Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
> 

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 3/5] Input: s3c2410_ts: Use devm_platform_ioremap_resource()
  2019-04-04  7:17 ` [PATCH 3/5] Input: s3c2410_ts: " Mukesh Ojha
@ 2019-07-16  7:39   ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2019-07-16  7:39 UTC (permalink / raw)
  To: Mukesh Ojha
  Cc: s.hauer, linux-kernel, linux-imx, linux-input, shawnguo,
	linux-arm-kernel

Hi Mukesh,

On Thu, Apr 04, 2019 at 12:47:21PM +0530, Mukesh Ojha wrote:
> devm_platform_ioremap_resource() internally have platform_get_resource()
> and devm_ioremap_resource() in it. So instead of calling them separately
> use devm_platform_ioremap_resource() directly.
> 
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
> ---
>  drivers/input/touchscreen/s3c2410_ts.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index 1173890..e11cdae 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -242,7 +242,6 @@ static int s3c2410ts_probe(struct platform_device *pdev)
>  	struct s3c2410_ts_mach_info *info;
>  	struct device *dev = &pdev->dev;
>  	struct input_dev *input_dev;
> -	struct resource *res;
>  	int ret = -EINVAL;
>  
>  	/* Initialise input stuff */
> @@ -277,14 +276,7 @@ static int s3c2410ts_probe(struct platform_device *pdev)
>  		goto err_clk;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "no resource for registers\n");
> -		ret = -ENOENT;
> -		goto err_clk;
> -	}
> -
> -	ts.io = ioremap(res->start, resource_size(res));
> +	ts.io = devm_platform_ioremap_resource(pdev, 0);

This is not an equivalent transformation: the original code (rightly or
wrongly) did not request the memory regions described by 'res' while new
variant does.

Also you can't simply slap a single devm resource in a driver that does
not use managed resources as it messes up the release order.

-- 
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-07-16 15:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04  7:17 [PATCH 0/5] Input: Use devm_platform_ioremap_resource() Mukesh Ojha
2019-04-04  7:17 ` [PATCH 1/5] Input: fsl-imx25-tcq: " Mukesh Ojha
2019-07-16  7:30   ` Dmitry Torokhov
2019-04-04  7:17 ` [PATCH 2/5] Input: mxs-lradc-ts.c: " Mukesh Ojha
2019-07-16  7:32   ` Dmitry Torokhov
2019-04-04  7:17 ` [PATCH 3/5] Input: s3c2410_ts: " Mukesh Ojha
2019-07-16  7:39   ` Dmitry Torokhov
2019-04-04  7:17 ` [PATCH 4/5] Input: sun4i-ts: " Mukesh Ojha
2019-07-16  7:34   ` Dmitry Torokhov
2019-04-04  7:17 ` [PATCH 5/5] Input: ts4800-ts: " Mukesh Ojha
2019-07-16  7:34   ` 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).