mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()
@ 2023-07-06  7:20 Yangtao Li
  2023-07-06  7:20 ` [PATCH 2/7] bus: da850-mstpri: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: Yangtao Li, linux-arm-kernel, linux-sunxi, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/sunxi-rsb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
index 696c0aefb0ca..2aefd5dde3c9 100644
--- a/drivers/bus/sunxi-rsb.c
+++ b/drivers/bus/sunxi-rsb.c
@@ -746,7 +746,6 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct resource *r;
 	struct sunxi_rsb *rsb;
 	u32 clk_freq = 3000000;
 	int irq, ret;
@@ -766,8 +765,7 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
 	rsb->dev = dev;
 	rsb->clk_freq = clk_freq;
 	platform_set_drvdata(pdev, rsb);
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	rsb->regs = devm_ioremap_resource(dev, r);
+	rsb->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rsb->regs))
 		return PTR_ERR(rsb->regs);
 
-- 
2.39.0


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

* [PATCH 2/7] bus: da850-mstpri: Use devm_platform_get_and_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-06  7:20 ` [PATCH 3/7] bus: omap-ocp2scp: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  Cc: Yangtao Li, linux-kernel

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/da8xx-mstpri.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/bus/da8xx-mstpri.c b/drivers/bus/da8xx-mstpri.c
index ee4c02335130..864b61adf005 100644
--- a/drivers/bus/da8xx-mstpri.c
+++ b/drivers/bus/da8xx-mstpri.c
@@ -213,8 +213,7 @@ static int da8xx_mstpri_probe(struct platform_device *pdev)
 	u32 reg;
 	int i;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mstpri = devm_ioremap_resource(dev, res);
+	mstpri = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(mstpri)) {
 		dev_err(dev, "unable to map MSTPRI registers\n");
 		return PTR_ERR(mstpri);
-- 
2.39.0


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

* [PATCH 3/7] bus: omap-ocp2scp: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
  2023-07-06  7:20 ` [PATCH 2/7] bus: da850-mstpri: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-06  7:20 ` [PATCH 4/7] bus: qcom-ebi2: " Yangtao Li
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  Cc: Yangtao Li, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/omap-ocp2scp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index e02d0656242b..75dd8f4d4f50 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -31,7 +31,6 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
 	int ret;
 	u32 reg;
 	void __iomem *regs;
-	struct resource *res;
 	struct device_node *np = pdev->dev.of_node;
 
 	if (np) {
@@ -58,8 +57,7 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
 	 * of SYNC2 parameter in OCP2SCP. Suggested reset value is 0x6 or more.
 	 */
 	if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		regs = devm_ioremap_resource(&pdev->dev, res);
+		regs = devm_platform_ioremap_resource(pdev, 0);
 		if (IS_ERR(regs)) {
 			ret = PTR_ERR(regs);
 			goto err1;
-- 
2.39.0


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

* [PATCH 4/7] bus: qcom-ebi2: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
  2023-07-06  7:20 ` [PATCH 2/7] bus: da850-mstpri: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-06  7:20 ` [PATCH 3/7] bus: omap-ocp2scp: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-06  7:20 ` [PATCH 5/7] bus: tegra-gmi: " Yangtao Li
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: Yangtao Li, linux-arm-msm, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/qcom-ebi2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index c1fef1b4bd89..01e76bb05218 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -294,7 +294,6 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
 	struct device_node *np = pdev->dev.of_node;
 	struct device_node *child;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *ebi2_base;
 	void __iomem *ebi2_xmem;
 	struct clk *ebi2xclk;
@@ -325,15 +324,13 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
 		goto err_disable_2x_clk;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ebi2_base = devm_ioremap_resource(dev, res);
+	ebi2_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ebi2_base)) {
 		ret = PTR_ERR(ebi2_base);
 		goto err_disable_clk;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	ebi2_xmem = devm_ioremap_resource(dev, res);
+	ebi2_xmem = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(ebi2_xmem)) {
 		ret = PTR_ERR(ebi2_xmem);
 		goto err_disable_clk;
-- 
2.39.0


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

* [PATCH 5/7] bus: tegra-gmi: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (2 preceding siblings ...)
  2023-07-06  7:20 ` [PATCH 4/7] bus: qcom-ebi2: " Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-06  7:20 ` [PATCH 6/7] bus: vexpress-config: " Yangtao Li
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter; +Cc: Yangtao Li, linux-tegra, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/tegra-gmi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/tegra-gmi.c b/drivers/bus/tegra-gmi.c
index e3506ef37051..59919e99f7cc 100644
--- a/drivers/bus/tegra-gmi.c
+++ b/drivers/bus/tegra-gmi.c
@@ -211,7 +211,6 @@ static int tegra_gmi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct tegra_gmi *gmi;
-	struct resource *res;
 	int err;
 
 	gmi = devm_kzalloc(dev, sizeof(*gmi), GFP_KERNEL);
@@ -221,8 +220,7 @@ static int tegra_gmi_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, gmi);
 	gmi->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	gmi->base = devm_ioremap_resource(dev, res);
+	gmi->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(gmi->base))
 		return PTR_ERR(gmi->base);
 
-- 
2.39.0


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

* [PATCH 6/7] bus: vexpress-config: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (3 preceding siblings ...)
  2023-07-06  7:20 ` [PATCH 5/7] bus: tegra-gmi: " Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-19 10:06   ` [PATCH 6/7] " Sudeep Holla
  2023-07-06  7:20 ` [PATCH 7/7] bus: omap_l3_noc: " Yangtao Li
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  To: Liviu Dudau, Sudeep Holla, Lorenzo Pieralisi
  Cc: Yangtao Li, linux-kernel, linux-arm-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/vexpress-config.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index 472a570bd53a..c4e1becbb2d2 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -350,7 +350,6 @@ static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = {
 static int vexpress_syscfg_probe(struct platform_device *pdev)
 {
 	struct vexpress_syscfg *syscfg;
-	struct resource *res;
 	struct vexpress_config_bridge *bridge;
 	struct device_node *node;
 	int master;
@@ -362,8 +361,7 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
 	syscfg->dev = &pdev->dev;
 	INIT_LIST_HEAD(&syscfg->funcs);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	syscfg->base = devm_ioremap_resource(&pdev->dev, res);
+	syscfg->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(syscfg->base))
 		return PTR_ERR(syscfg->base);
 
-- 
2.39.0


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

* [PATCH 7/7] bus: omap_l3_noc: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (4 preceding siblings ...)
  2023-07-06  7:20 ` [PATCH 6/7] bus: vexpress-config: " Yangtao Li
@ 2023-07-06  7:20 ` Yangtao Li
  2023-07-11 18:25 ` [PATCH 1/7] bus: sunxi-rsb: " Jernej Škrabec
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Yangtao Li @ 2023-07-06  7:20 UTC (permalink / raw)
  Cc: Yangtao Li, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/bus/omap_l3_noc.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index eb1ba6319fda..0137e9ec577a 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -255,20 +255,15 @@ static int omap_l3_probe(struct platform_device *pdev)
 
 	/* Get mem resources */
 	for (i = 0, res_idx = 0; i < l3->num_modules; i++) {
-		struct resource	*res;
-
 		if (l3->l3_base[i] == L3_BASE_IS_SUBMODULE) {
 			/* First entry cannot be submodule */
 			BUG_ON(i == 0);
 			l3->l3_base[i] = l3->l3_base[i - 1];
 			continue;
 		}
-		res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx);
-		l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res);
-		if (IS_ERR(l3->l3_base[i])) {
-			dev_err(l3->dev, "ioremap %d failed\n", i);
+		l3->l3_base[i] = devm_platform_ioremap_resource(pdev, res_idx);
+		if (IS_ERR(l3->l3_base[i]))
 			return PTR_ERR(l3->l3_base[i]);
-		}
 		res_idx++;
 	}
 
-- 
2.39.0


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

* Re: [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (5 preceding siblings ...)
  2023-07-06  7:20 ` [PATCH 7/7] bus: omap_l3_noc: " Yangtao Li
@ 2023-07-11 18:25 ` Jernej Škrabec
  2023-07-21 15:28 ` (subset) " Thierry Reding
  2023-07-30 22:50 ` Jernej Škrabec
  8 siblings, 0 replies; 11+ messages in thread
From: Jernej Škrabec @ 2023-07-11 18:25 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Yangtao Li
  Cc: Yangtao Li, linux-arm-kernel, linux-sunxi, linux-kernel

Dne četrtek, 06. julij 2023 ob 09:20:36 CEST je Yangtao Li napisal(a):
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/bus/sunxi-rsb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
> index 696c0aefb0ca..2aefd5dde3c9 100644
> --- a/drivers/bus/sunxi-rsb.c
> +++ b/drivers/bus/sunxi-rsb.c
> @@ -746,7 +746,6 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
> {
>  	struct device *dev = &pdev->dev;
>  	struct device_node *np = dev->of_node;
> -	struct resource *r;
>  	struct sunxi_rsb *rsb;
>  	u32 clk_freq = 3000000;
>  	int irq, ret;
> @@ -766,8 +765,7 @@ static int sunxi_rsb_probe(struct platform_device *pdev)
> rsb->dev = dev;
>  	rsb->clk_freq = clk_freq;
>  	platform_set_drvdata(pdev, rsb);
> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	rsb->regs = devm_ioremap_resource(dev, r);
> +	rsb->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rsb->regs))
>  		return PTR_ERR(rsb->regs);





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

* Re: [PATCH 6/7] [PATCH 6/7] bus: vexpress-config: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 ` [PATCH 6/7] bus: vexpress-config: " Yangtao Li
@ 2023-07-19 10:06   ` Sudeep Holla
  0 siblings, 0 replies; 11+ messages in thread
From: Sudeep Holla @ 2023-07-19 10:06 UTC (permalink / raw)
  To: Yangtao Li, Liviu Dudau, Sudeep Holla, Lorenzo Pieralisi
  Cc: linux-arm-kernel, linux-sunxi, linux-kernel

On Thu, 06 Jul 2023 15:20:36 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>

Applied to sudeep.holla/linux (for-next/vexpress/updates), thanks!

[6/7] bus: vexpress-config: Convert to devm_platform_ioremap_resource()
      https://git.kernel.org/sudeep.holla/c/bc0e769647d7
--
Regards,
Sudeep


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

* Re: (subset) [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (6 preceding siblings ...)
  2023-07-11 18:25 ` [PATCH 1/7] bus: sunxi-rsb: " Jernej Škrabec
@ 2023-07-21 15:28 ` Thierry Reding
  2023-07-30 22:50 ` Jernej Škrabec
  8 siblings, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2023-07-21 15:28 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Yangtao Li
  Cc: linux-arm-kernel, linux-sunxi, linux-kernel

From: Thierry Reding <treding@nvidia.com>


On Thu, 06 Jul 2023 15:20:36 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> 

Applied, thanks!

[5/7] bus: tegra-gmi: Convert to devm_platform_ioremap_resource()
      commit: df823d210395341c58e8d346dfc37d6e67e9f2c6

Best regards,
-- 
Thierry Reding <treding@nvidia.com>

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

* Re: [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource()
  2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (7 preceding siblings ...)
  2023-07-21 15:28 ` (subset) " Thierry Reding
@ 2023-07-30 22:50 ` Jernej Škrabec
  8 siblings, 0 replies; 11+ messages in thread
From: Jernej Škrabec @ 2023-07-30 22:50 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland, Yangtao Li
  Cc: Yangtao Li, linux-arm-kernel, linux-sunxi, linux-kernel

Dne četrtek, 06. julij 2023 ob 09:20:36 CEST je Yangtao Li napisal(a):
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Applied, thanks!

Best regards,
Jernej



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

end of thread, other threads:[~2023-07-30 22:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06  7:20 [PATCH 1/7] bus: sunxi-rsb: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06  7:20 ` [PATCH 2/7] bus: da850-mstpri: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06  7:20 ` [PATCH 3/7] bus: omap-ocp2scp: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06  7:20 ` [PATCH 4/7] bus: qcom-ebi2: " Yangtao Li
2023-07-06  7:20 ` [PATCH 5/7] bus: tegra-gmi: " Yangtao Li
2023-07-06  7:20 ` [PATCH 6/7] bus: vexpress-config: " Yangtao Li
2023-07-19 10:06   ` [PATCH 6/7] " Sudeep Holla
2023-07-06  7:20 ` [PATCH 7/7] bus: omap_l3_noc: " Yangtao Li
2023-07-11 18:25 ` [PATCH 1/7] bus: sunxi-rsb: " Jernej Škrabec
2023-07-21 15:28 ` (subset) " Thierry Reding
2023-07-30 22:50 ` Jernej Škrabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®