linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource
@ 2019-12-14 17:54 Yangtao Li
  2019-12-14 17:54 ` [PATCH 02/10] soc: samsung: " Yangtao Li
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/sunxi/sunxi_sram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 1b0d50f36349..f73fbcc73f51 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -320,7 +320,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
 
 static int sunxi_sram_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct dentry *d;
 	struct regmap *emac_clock;
 	const struct sunxi_sramc_variant *variant;
@@ -331,8 +330,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)
 	if (!variant)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.17.1


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

* [PATCH 02/10] soc: samsung: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-15 11:57   ` Krzysztof Kozlowski
  2019-12-14 17:54 ` [PATCH 03/10] soc: amlogic: " Yangtao Li
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/samsung/exynos-pmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index d34ca201b8b7..7da2701c871a 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -110,10 +110,8 @@ EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap);
 static int exynos_pmu_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	pmu_base_addr = devm_ioremap_resource(dev, res);
+	pmu_base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pmu_base_addr))
 		return PTR_ERR(pmu_base_addr);
 
-- 
2.17.1


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

* [PATCH 03/10] soc: amlogic: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
  2019-12-14 17:54 ` [PATCH 02/10] soc: samsung: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 04/10] soc: zte: " Yangtao Li
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/amlogic/meson-canvas.c      | 4 +---
 drivers/soc/amlogic/meson-clk-measure.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index c655f5f92b12..561044063319 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -166,7 +166,6 @@ EXPORT_SYMBOL_GPL(meson_canvas_free);
 
 static int meson_canvas_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct meson_canvas *canvas;
 	struct device *dev = &pdev->dev;
 
@@ -174,8 +173,7 @@ static int meson_canvas_probe(struct platform_device *pdev)
 	if (!canvas)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	canvas->reg_base = devm_ioremap_resource(dev, res);
+	canvas->reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(canvas->reg_base))
 		return PTR_ERR(canvas->reg_base);
 
diff --git a/drivers/soc/amlogic/meson-clk-measure.c b/drivers/soc/amlogic/meson-clk-measure.c
index 0fa47d77577d..173baa53fce3 100644
--- a/drivers/soc/amlogic/meson-clk-measure.c
+++ b/drivers/soc/amlogic/meson-clk-measure.c
@@ -605,7 +605,6 @@ static int meson_msr_probe(struct platform_device *pdev)
 {
 	const struct meson_msr_id *match_data;
 	struct meson_msr *priv;
-	struct resource *res;
 	struct dentry *root, *clks;
 	void __iomem *base;
 	int i;
@@ -623,8 +622,7 @@ static int meson_msr_probe(struct platform_device *pdev)
 
 	memcpy(priv->msr_table, match_data, sizeof(priv->msr_table));
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base)) {
 		dev_err(&pdev->dev, "io resource mapping failed\n");
 		return PTR_ERR(base);
-- 
2.17.1


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

* [PATCH 04/10] soc: zte: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
  2019-12-14 17:54 ` [PATCH 02/10] soc: samsung: " Yangtao Li
  2019-12-14 17:54 ` [PATCH 03/10] soc: amlogic: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 05/10] soc: fsl: " Yangtao Li
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/zte/zx2967_pm_domains.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/zte/zx2967_pm_domains.c b/drivers/soc/zte/zx2967_pm_domains.c
index a4503e31b616..9f2a274d2759 100644
--- a/drivers/soc/zte/zx2967_pm_domains.c
+++ b/drivers/soc/zte/zx2967_pm_domains.c
@@ -113,7 +113,6 @@ int zx2967_pd_probe(struct platform_device *pdev,
 		    int domain_num)
 {
 	struct genpd_onecell_data *genpd_data;
-	struct resource *res;
 	int i;
 
 	genpd_data = devm_kzalloc(&pdev->dev, sizeof(*genpd_data), GFP_KERNEL);
@@ -123,8 +122,7 @@ int zx2967_pd_probe(struct platform_device *pdev,
 	genpd_data->domains = zx_pm_domains;
 	genpd_data->num_domains = domain_num;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	pcubase = devm_ioremap_resource(&pdev->dev, res);
+	pcubase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pcubase))
 		return PTR_ERR(pcubase);
 
-- 
2.17.1


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

* [PATCH 05/10] soc: fsl: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (2 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 04/10] soc: zte: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 06/10] soc: mediatek: " Yangtao Li
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/fsl/guts.c | 4 +---
 drivers/soc/fsl/rcpm.c | 7 +------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
index 34810f9bb2ee..ebec06a22ab4 100644
--- a/drivers/soc/fsl/guts.c
+++ b/drivers/soc/fsl/guts.c
@@ -140,7 +140,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	const struct fsl_soc_die_attr *soc_die;
 	const char *machine;
 	u32 svr;
@@ -152,8 +151,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
 
 	guts->little_endian = of_property_read_bool(np, "little-endian");
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	guts->regs = devm_ioremap_resource(dev, res);
+	guts->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(guts->regs))
 		return PTR_ERR(guts->regs);
 
diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
index a093dbe6d2cb..322fde95974b 100644
--- a/drivers/soc/fsl/rcpm.c
+++ b/drivers/soc/fsl/rcpm.c
@@ -102,7 +102,6 @@ static const struct dev_pm_ops rcpm_pm_ops = {
 static int rcpm_probe(struct platform_device *pdev)
 {
 	struct device	*dev = &pdev->dev;
-	struct resource *r;
 	struct rcpm	*rcpm;
 	int ret;
 
@@ -110,11 +109,7 @@ static int rcpm_probe(struct platform_device *pdev)
 	if (!rcpm)
 		return -ENOMEM;
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!r)
-		return -ENODEV;
-
-	rcpm->ippdexpcr_base = devm_ioremap_resource(&pdev->dev, r);
+	rcpm->ippdexpcr_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rcpm->ippdexpcr_base)) {
 		ret =  PTR_ERR(rcpm->ippdexpcr_base);
 		return ret;
-- 
2.17.1


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

* [PATCH 06/10] soc: mediatek: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (3 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 05/10] soc: fsl: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 07/10] soc: ti: wkup_m3_ipc: " Yangtao Li
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/mediatek/mtk-scpsys.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c
index f669d3754627..2aa2afdc9ccf 100644
--- a/drivers/soc/mediatek/mtk-scpsys.c
+++ b/drivers/soc/mediatek/mtk-scpsys.c
@@ -425,7 +425,6 @@ static struct scp *init_scp(struct platform_device *pdev,
 			bool bus_prot_reg_update)
 {
 	struct genpd_onecell_data *pd_data;
-	struct resource *res;
 	int i, j;
 	struct scp *scp;
 	struct clk *clk[CLK_MAX];
@@ -441,8 +440,7 @@ static struct scp *init_scp(struct platform_device *pdev,
 
 	scp->dev = &pdev->dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	scp->base = devm_ioremap_resource(&pdev->dev, res);
+	scp->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(scp->base))
 		return ERR_CAST(scp->base);
 
-- 
2.17.1


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

* [PATCH 07/10] soc: ti: wkup_m3_ipc: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (4 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 06/10] soc: mediatek: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 08/10] soc: lantiq: " Yangtao Li
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/ti/wkup_m3_ipc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 378369d9364a..e058f67e6333 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -429,7 +429,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 	int irq, ret;
 	phandle rproc_phandle;
 	struct rproc *m3_rproc;
-	struct resource *res;
 	struct task_struct *task;
 	struct wkup_m3_ipc *m3_ipc;
 
@@ -437,8 +436,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 	if (!m3_ipc)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	m3_ipc->ipc_mem_base = devm_ioremap_resource(dev, res);
+	m3_ipc->ipc_mem_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(m3_ipc->ipc_mem_base)) {
 		dev_err(dev, "could not ioremap ipc_mem\n");
 		return PTR_ERR(m3_ipc->ipc_mem_base);
-- 
2.17.1


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

* [PATCH 08/10] soc: lantiq: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (5 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 07/10] soc: ti: wkup_m3_ipc: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2020-01-13 19:10   ` Paul Burton
  2019-12-14 17:54 ` [PATCH 09/10] soc: ixp4xx: qmgr: " Yangtao Li
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/lantiq/fpi-bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/lantiq/fpi-bus.c b/drivers/soc/lantiq/fpi-bus.c
index cb0303a0fe60..dff1375851cf 100644
--- a/drivers/soc/lantiq/fpi-bus.c
+++ b/drivers/soc/lantiq/fpi-bus.c
@@ -28,14 +28,12 @@ static int ltq_fpi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct resource *res_xbar;
 	struct regmap *rcu_regmap;
 	void __iomem *xbar_membase;
 	u32 rcu_ahb_endianness_reg_offset;
 	int ret;
 
-	res_xbar = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	xbar_membase = devm_ioremap_resource(dev, res_xbar);
+	xbar_membase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(xbar_membase))
 		return PTR_ERR(xbar_membase);
 
-- 
2.17.1


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

* [PATCH 09/10] soc: ixp4xx: qmgr: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (6 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 08/10] soc: lantiq: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-14 17:54 ` [PATCH 10/10] soc: qcom: " Yangtao Li
  2019-12-18  2:45 ` [PATCH 01/10] soc: sunxi: " Chen-Yu Tsai
  9 siblings, 0 replies; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/ixp4xx/ixp4xx-qmgr.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
index 8c968382cea7..520babbd9037 100644
--- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c
+++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
@@ -375,13 +375,9 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
 	int i, err;
 	irq_handler_t handler1, handler2;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	int irq1, irq2;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-	qmgr_regs = devm_ioremap_resource(dev, res);
+	qmgr_regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(qmgr_regs))
 		return PTR_ERR(qmgr_regs);
 
-- 
2.17.1


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

* [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (7 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 09/10] soc: ixp4xx: qmgr: " Yangtao Li
@ 2019-12-14 17:54 ` Yangtao Li
  2019-12-15 10:48   ` Marc Zyngier
  2019-12-18  2:45 ` [PATCH 01/10] soc: sunxi: " Chen-Yu Tsai
  9 siblings, 1 reply; 15+ messages in thread
From: Yangtao Li @ 2019-12-14 17:54 UTC (permalink / raw)
  To: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, linuxppc-dev,
	linux-mips, linux-mediatek, linux-arm-msm, linux-samsung-soc,
	Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/soc/qcom/llcc-qcom.c    | 7 +------
 drivers/soc/qcom/qcom-geni-se.c | 4 +---
 drivers/soc/qcom/qcom_aoss.c    | 4 +---
 drivers/soc/qcom/qcom_gsbi.c    | 5 +----
 drivers/soc/qcom/spm.c          | 4 +---
 5 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 429b5a60a1ba..99e19df76889 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)
 static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
 		const char *name)
 {
-	struct resource *res;
 	void __iomem *base;
 	struct regmap_config llcc_regmap_config = {
 		.reg_bits = 32,
@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
 		.fast_io = true,
 	};
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
-	if (!res)
-		return ERR_PTR(-ENODEV);
-
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return ERR_CAST(base);
 
diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
index 7d622ea1274e..9c2c429b4b3f 100644
--- a/drivers/soc/qcom/qcom-geni-se.c
+++ b/drivers/soc/qcom/qcom-geni-se.c
@@ -723,7 +723,6 @@ EXPORT_SYMBOL(geni_se_rx_dma_unprep);
 static int geni_se_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct geni_wrapper *wrapper;
 	int ret;
 
@@ -732,8 +731,7 @@ static int geni_se_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	wrapper->dev = dev;
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	wrapper->base = devm_ioremap_resource(dev, res);
+	wrapper->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(wrapper->base))
 		return PTR_ERR(wrapper->base);
 
diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index 006ac40c526a..fcfba9f1aaa1 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -513,7 +513,6 @@ static void qmp_cooling_devices_remove(struct qmp *qmp)
 
 static int qmp_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct qmp *qmp;
 	int irq;
 	int ret;
@@ -526,8 +525,7 @@ static int qmp_probe(struct platform_device *pdev)
 	init_waitqueue_head(&qmp->event);
 	mutex_init(&qmp->tx_lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	qmp->msgram = devm_ioremap_resource(&pdev->dev, res);
+	qmp->msgram = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(qmp->msgram))
 		return PTR_ERR(qmp->msgram);
 
diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c
index 304afc223a58..202ff31cf54f 100644
--- a/drivers/soc/qcom/qcom_gsbi.c
+++ b/drivers/soc/qcom/qcom_gsbi.c
@@ -127,7 +127,6 @@ static int gsbi_probe(struct platform_device *pdev)
 	struct device_node *node = pdev->dev.of_node;
 	struct device_node *tcsr_node;
 	const struct of_device_id *match;
-	struct resource *res;
 	void __iomem *base;
 	struct gsbi_info *gsbi;
 	int i, ret;
@@ -135,12 +134,10 @@ static int gsbi_probe(struct platform_device *pdev)
 	const struct crci_config *config = NULL;
 
 	gsbi = devm_kzalloc(&pdev->dev, sizeof(*gsbi), GFP_KERNEL);
-
 	if (!gsbi)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c
index 8e10e02c6aa5..b6131ab07879 100644
--- a/drivers/soc/qcom/spm.c
+++ b/drivers/soc/qcom/spm.c
@@ -320,7 +320,6 @@ static const struct of_device_id spm_match_table[] = {
 static int spm_dev_probe(struct platform_device *pdev)
 {
 	struct spm_driver_data *drv;
-	struct resource *res;
 	const struct of_device_id *match_id;
 	void __iomem *addr;
 	int cpu;
@@ -329,8 +328,7 @@ static int spm_dev_probe(struct platform_device *pdev)
 	if (!drv)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	drv->reg_base = devm_ioremap_resource(&pdev->dev, res);
+	drv->reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(drv->reg_base))
 		return PTR_ERR(drv->reg_base);
 
-- 
2.17.1


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

* Re: [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 ` [PATCH 10/10] soc: qcom: " Yangtao Li
@ 2019-12-15 10:48   ` Marc Zyngier
  2019-12-15 12:00     ` Frank Lee
  0 siblings, 1 reply; 15+ messages in thread
From: Marc Zyngier @ 2019-12-15 10:48 UTC (permalink / raw)
  To: Yangtao Li
  Cc: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo, linux-samsung-soc, linux-arm-msm, linux-kernel,
	linux-mips, linux-mediatek, linux-amlogic, linuxppc-dev,
	linux-arm-kernel

On Sat, 14 Dec 2019 17:54:47 +0000
Yangtao Li <tiny.windzz@gmail.com> wrote:

> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/soc/qcom/llcc-qcom.c    | 7 +------
>  drivers/soc/qcom/qcom-geni-se.c | 4 +---
>  drivers/soc/qcom/qcom_aoss.c    | 4 +---
>  drivers/soc/qcom/qcom_gsbi.c    | 5 +----
>  drivers/soc/qcom/spm.c          | 4 +---
>  5 files changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index 429b5a60a1ba..99e19df76889 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)
>  static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
>  		const char *name)
>  {
> -	struct resource *res;
>  	void __iomem *base;
>  	struct regmap_config llcc_regmap_config = {
>  		.reg_bits = 32,
> @@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
>  		.fast_io = true,
>  	};
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
> -	if (!res)
> -		return ERR_PTR(-ENODEV);
> -
> -	base = devm_ioremap_resource(&pdev->dev, res);
> +	base = devm_platform_ioremap_resource(pdev, 0);

What guarantees do you have that entry 0 matches name?

I find these changes pointless: they don't add much to the readability
or maintainability of the code, and instead introduce creative bugs.

	M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH 02/10] soc: samsung: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 ` [PATCH 02/10] soc: samsung: " Yangtao Li
@ 2019-12-15 11:57   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-15 11:57 UTC (permalink / raw)
  To: Yangtao Li
  Cc: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, mripard, wens, ssantosh, jun.nie,
	shawnguo, linux-arm-kernel, linux-amlogic, linux-kernel,
	linuxppc-dev, linux-mips, linux-mediatek, linux-arm-msm,
	linux-samsung-soc

On Sat, Dec 14, 2019 at 05:54:39PM +0000, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/soc/samsung/exynos-pmu.c | 4 +---

Thanks, applied.

Best regards,
Krzysztof


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

* Re: [PATCH 10/10] soc: qcom: convert to devm_platform_ioremap_resource
  2019-12-15 10:48   ` Marc Zyngier
@ 2019-12-15 12:00     ` Frank Lee
  0 siblings, 0 replies; 15+ messages in thread
From: Frank Lee @ 2019-12-15 12:00 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: khilman, leoyang.li, khalasa, john, Matthias Brugger, agross,
	bjorn.andersson, kgene, krzk, Maxime Ripard, Chen-Yu Tsai,
	ssantosh, jun.nie, shawnguo, linux-samsung-soc, linux-arm-msm,
	Linux Kernel Mailing List, linux-mips, linux-mediatek,
	linux-amlogic, linuxppc-dev, Linux ARM

On Sun, Dec 15, 2019 at 6:48 PM Marc Zyngier <maz@kernel.org> wrote:
>
> On Sat, 14 Dec 2019 17:54:47 +0000
> Yangtao Li <tiny.windzz@gmail.com> wrote:
>
> > Use devm_platform_ioremap_resource() to simplify code.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> > ---
> >  drivers/soc/qcom/llcc-qcom.c    | 7 +------
> >  drivers/soc/qcom/qcom-geni-se.c | 4 +---
> >  drivers/soc/qcom/qcom_aoss.c    | 4 +---
> >  drivers/soc/qcom/qcom_gsbi.c    | 5 +----
> >  drivers/soc/qcom/spm.c          | 4 +---
> >  5 files changed, 5 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> > index 429b5a60a1ba..99e19df76889 100644
> > --- a/drivers/soc/qcom/llcc-qcom.c
> > +++ b/drivers/soc/qcom/llcc-qcom.c
> > @@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)
> >  static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
> >               const char *name)
> >  {
> > -     struct resource *res;
> >       void __iomem *base;
> >       struct regmap_config llcc_regmap_config = {
> >               .reg_bits = 32,
> > @@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
> >               .fast_io = true,
> >       };
> >
> > -     res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
> > -     if (!res)
> > -             return ERR_PTR(-ENODEV);
> > -
> > -     base = devm_ioremap_resource(&pdev->dev, res);
> > +     base = devm_platform_ioremap_resource(pdev, 0);
>
> What guarantees do you have that entry 0 matches name?

Yeah, this place is wrong. I intruduce another helper.

https://lore.kernel.org/patchwork/patch/1165186/

Thx,
Yangtao


>
> I find these changes pointless: they don't add much to the readability
> or maintainability of the code, and instead introduce creative bugs.
>
>         M.
> --
> Jazz is not dead. It just smells funny...

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

* Re: [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
                   ` (8 preceding siblings ...)
  2019-12-14 17:54 ` [PATCH 10/10] soc: qcom: " Yangtao Li
@ 2019-12-18  2:45 ` Chen-Yu Tsai
  9 siblings, 0 replies; 15+ messages in thread
From: Chen-Yu Tsai @ 2019-12-18  2:45 UTC (permalink / raw)
  To: Yangtao Li, Maxime Ripard
  Cc: Kevin Hilman, leoyang.li, khalasa, John Crispin,
	Matthias Brugger, Andy Gross, Bjorn Andersson, Kukjin Kim,
	Krzysztof Kozlowski, Santosh Shilimkar, Jun Nie, Shawn Guo,
	linux-arm-kernel, open list:ARM/Amlogic Meson...,
	linux-kernel, linuxppc-dev, linux-mips,
	moderated list:ARM/Mediatek SoC...,
	linux-arm-msm, moderated list:ARM/SAMSUNG EXYNO...

On Sun, Dec 15, 2019 at 1:54 AM Yangtao Li <tiny.windzz@gmail.com> wrote:
>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>

> ---
>  drivers/soc/sunxi/sunxi_sram.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
> index 1b0d50f36349..f73fbcc73f51 100644
> --- a/drivers/soc/sunxi/sunxi_sram.c
> +++ b/drivers/soc/sunxi/sunxi_sram.c
> @@ -320,7 +320,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
>
>  static int sunxi_sram_probe(struct platform_device *pdev)
>  {
> -       struct resource *res;
>         struct dentry *d;
>         struct regmap *emac_clock;
>         const struct sunxi_sramc_variant *variant;
> @@ -331,8 +330,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)
>         if (!variant)
>                 return -EINVAL;
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       base = devm_ioremap_resource(&pdev->dev, res);
> +       base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(base))
>                 return PTR_ERR(base);
>
> --
> 2.17.1
>

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

* Re: [PATCH 08/10] soc: lantiq: convert to devm_platform_ioremap_resource
  2019-12-14 17:54 ` [PATCH 08/10] soc: lantiq: " Yangtao Li
@ 2020-01-13 19:10   ` Paul Burton
  0 siblings, 0 replies; 15+ messages in thread
From: Paul Burton @ 2020-01-13 19:10 UTC (permalink / raw)
  To: Yangtao Li
  Cc: khilman, leoyang.li, khalasa, john, matthias.bgg, agross,
	bjorn.andersson, kgene, krzk, mripard, wens, ssantosh, jun.nie,
	shawnguo, linux-arm-kernel, linux-amlogic, linux-kernel,
	linuxppc-dev, linux-mips, linux-mediatek, linux-arm-msm,
	linux-samsung-soc, Yangtao Li, linux-mips

Hello,

Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.

Applied to mips-next.

> commit 23c25c732530
> https://git.kernel.org/mips/c/23c25c732530
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> Signed-off-by: Paul Burton <paulburton@kernel.org>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]

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

end of thread, other threads:[~2020-01-13 19:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-14 17:54 [PATCH 01/10] soc: sunxi: convert to devm_platform_ioremap_resource Yangtao Li
2019-12-14 17:54 ` [PATCH 02/10] soc: samsung: " Yangtao Li
2019-12-15 11:57   ` Krzysztof Kozlowski
2019-12-14 17:54 ` [PATCH 03/10] soc: amlogic: " Yangtao Li
2019-12-14 17:54 ` [PATCH 04/10] soc: zte: " Yangtao Li
2019-12-14 17:54 ` [PATCH 05/10] soc: fsl: " Yangtao Li
2019-12-14 17:54 ` [PATCH 06/10] soc: mediatek: " Yangtao Li
2019-12-14 17:54 ` [PATCH 07/10] soc: ti: wkup_m3_ipc: " Yangtao Li
2019-12-14 17:54 ` [PATCH 08/10] soc: lantiq: " Yangtao Li
2020-01-13 19:10   ` Paul Burton
2019-12-14 17:54 ` [PATCH 09/10] soc: ixp4xx: qmgr: " Yangtao Li
2019-12-14 17:54 ` [PATCH 10/10] soc: qcom: " Yangtao Li
2019-12-15 10:48   ` Marc Zyngier
2019-12-15 12:00     ` Frank Lee
2019-12-18  2:45 ` [PATCH 01/10] soc: sunxi: " Chen-Yu Tsai

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