linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-10  6:33 Yangtao Li
  2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (11 more replies)
  0 siblings, 12 replies; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Codrin Ciubotariu, Andi Shyti, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea
  Cc: Yangtao Li, linux-i2c, linux-arm-kernel, 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/i2c/busses/i2c-at91-core.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
index 05ad3bc3578a..de3b8f1053e7 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -207,19 +207,15 @@ static int at91_twi_probe(struct platform_device *pdev)
 
 	dev->dev = &pdev->dev;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem)
-		return -ENODEV;
+	dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
+	if (IS_ERR(dev->base))
+		return PTR_ERR(dev->base);
 	phy_addr = mem->start;
 
 	dev->pdata = at91_twi_get_driver_data(pdev);
 	if (!dev->pdata)
 		return -ENODEV;
 
-	dev->base = devm_ioremap_resource(&pdev->dev, mem);
-	if (IS_ERR(dev->base))
-		return PTR_ERR(dev->base);
-
 	dev->irq = platform_get_irq(pdev, 0);
 	if (dev->irq < 0)
 		return dev->irq;
-- 
2.39.0


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

* [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:40   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Andi Shyti, Ray Jui, Scott Branden,
	Broadcom internal kernel review list
  Cc: Yangtao Li, Ray Jui, linux-i2c, linux-arm-kernel, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
---
 drivers/i2c/busses/i2c-bcm-iproc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 2d8342fdc25d..3fac85be543a 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -1026,7 +1026,6 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
 	int irq, ret = 0;
 	struct bcm_iproc_i2c_dev *iproc_i2c;
 	struct i2c_adapter *adap;
-	struct resource *res;
 
 	iproc_i2c = devm_kzalloc(&pdev->dev, sizeof(*iproc_i2c),
 				 GFP_KERNEL);
@@ -1039,15 +1038,12 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
 		(enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev);
 	init_completion(&iproc_i2c->done);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	iproc_i2c->base = devm_ioremap_resource(iproc_i2c->device, res);
+	iproc_i2c->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(iproc_i2c->base))
 		return PTR_ERR(iproc_i2c->base);
 
 	if (iproc_i2c->type == IPROC_I2C_NIC) {
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-		iproc_i2c->idm_base = devm_ioremap_resource(iproc_i2c->device,
-							    res);
+		iproc_i2c->idm_base = devm_platform_ioremap_resource(pdev, 1);
 		if (IS_ERR(iproc_i2c->idm_base))
 			return PTR_ERR(iproc_i2c->idm_base);
 
-- 
2.39.0


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

* [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-10 18:21   ` Kamal Dasu
                     ` (2 more replies)
  2023-07-10  6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (9 subsequent siblings)
  11 siblings, 3 replies; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Kamal Dasu, Broadcom internal kernel review list, Andi Shyti,
	Florian Fainelli
  Cc: Yangtao Li, linux-i2c, linux-arm-kernel, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/i2c/busses/i2c-brcmstb.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index cf92cbcb8c86..0d422487161a 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -594,11 +594,10 @@ static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev)
 
 static int brcmstb_i2c_probe(struct platform_device *pdev)
 {
-	int rc = 0;
 	struct brcmstb_i2c_dev *dev;
 	struct i2c_adapter *adap;
-	struct resource *iomem;
 	const char *int_name;
+	int rc;
 
 	/* Allocate memory for private data structure */
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -614,18 +613,15 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
 	init_completion(&dev->done);
 
 	/* Map hardware registers */
-	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dev->base = devm_ioremap_resource(dev->device, iomem);
-	if (IS_ERR(dev->base)) {
-		rc = -ENOMEM;
-		goto probe_errorout;
-	}
+	dev->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(dev->base))
+		return PTR_ERR(dev->base);
 
 	if (of_device_is_compatible(dev->device->of_node,
 				    "brcm,bcm2711-hdmi-i2c")) {
 		rc = bcm2711_release_bsc(dev);
 		if (rc)
-			goto probe_errorout;
+			return rc;
 	}
 
 	rc = of_property_read_string(dev->device->of_node, "interrupt-names",
@@ -678,16 +674,13 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
 	adap->dev.of_node = pdev->dev.of_node;
 	rc = i2c_add_adapter(adap);
 	if (rc)
-		goto probe_errorout;
+		return rc;
 
 	dev_info(dev->device, "%s@%dhz registered in %s mode\n",
 		 int_name ? int_name : " ", dev->clk_freq_hz,
 		 (dev->irq >= 0) ? "interrupt" : "polling");
 
 	return 0;
-
-probe_errorout:
-	return rc;
 }
 
 static void brcmstb_i2c_remove(struct platform_device *pdev)
-- 
2.39.0


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

* [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
  2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:49   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Khalil Blaiech, Asmaa Mnebhi, Andi Shyti
  Cc: Yangtao Li, linux-i2c, 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/i2c/busses/i2c-mlxbf.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index ae66bdd1b737..2f60e5532b54 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -1080,13 +1080,7 @@ static int mlxbf_i2c_init_resource(struct platform_device *pdev,
 	if (!tmp_res)
 		return -ENOMEM;
 
-	tmp_res->params = platform_get_resource(pdev, IORESOURCE_MEM, type);
-	if (!tmp_res->params) {
-		devm_kfree(dev, tmp_res);
-		return -EIO;
-	}
-
-	tmp_res->io = devm_ioremap_resource(dev, tmp_res->params);
+	tmp_res->io = devm_platform_get_and_ioremap_resource(pdev, type, &tmp_res->params);
 	if (IS_ERR(tmp_res->io)) {
 		devm_kfree(dev, tmp_res);
 		return PTR_ERR(tmp_res->io);
-- 
2.39.0


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

* [PATCH v2 05/11] i2c: stm32f4: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (2 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:49   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Pierre-Yves MORDRET, Alain Volmat, Andi Shyti, Maxime Coquelin,
	Alexandre Torgue
  Cc: Yangtao Li, linux-i2c, linux-stm32, linux-arm-kernel,
	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/i2c/busses/i2c-stm32f4.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
index 6ad06a5a22b4..ecc54792a66f 100644
--- a/drivers/i2c/busses/i2c-stm32f4.c
+++ b/drivers/i2c/busses/i2c-stm32f4.c
@@ -767,8 +767,7 @@ static int stm32f4_i2c_probe(struct platform_device *pdev)
 	if (!i2c_dev)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	i2c_dev->base = devm_ioremap_resource(&pdev->dev, res);
+	i2c_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(i2c_dev->base))
 		return PTR_ERR(i2c_dev->base);
 
-- 
2.39.0


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

* [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (3 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:52   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Andi Shyti
  Cc: Yangtao Li, linux-arm-msm, linux-i2c, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index b670a67c4fdd..229353e96e09 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -767,7 +767,6 @@ static int setup_gpi_dma(struct geni_i2c_dev *gi2c)
 static int geni_i2c_probe(struct platform_device *pdev)
 {
 	struct geni_i2c_dev *gi2c;
-	struct resource *res;
 	u32 proto, tx_depth, fifo_disable;
 	int ret;
 	struct device *dev = &pdev->dev;
@@ -779,8 +778,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
 
 	gi2c->se.dev = dev;
 	gi2c->se.wrapper = dev_get_drvdata(dev->parent);
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	gi2c->se.base = devm_ioremap_resource(dev, res);
+	gi2c->se.base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(gi2c->se.base))
 		return PTR_ERR(gi2c->se.base);
 
-- 
2.39.0


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

* [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (4 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:52   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Patrice Chotard, Andi Shyti
  Cc: Yangtao Li, linux-arm-kernel, linux-i2c, 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/i2c/busses/i2c-st.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
index 25c3521cae0e..ce2333408904 100644
--- a/drivers/i2c/busses/i2c-st.c
+++ b/drivers/i2c/busses/i2c-st.c
@@ -812,8 +812,7 @@ static int st_i2c_probe(struct platform_device *pdev)
 	if (!i2c_dev)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	i2c_dev->base = devm_ioremap_resource(&pdev->dev, res);
+	i2c_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(i2c_dev->base))
 		return PTR_ERR(i2c_dev->base);
 
-- 
2.39.0


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

* [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (5 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-10 12:13   ` Geert Uytterhoeven
  2023-07-12 15:57   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li
                   ` (4 subsequent siblings)
  11 siblings, 2 replies; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Wolfram Sang, Andi Shyti
  Cc: Yangtao Li, linux-renesas-soc, linux-i2c, 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>
---
v2:
-s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev
 drivers/i2c/busses/i2c-sh_mobile.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 21717b943a9e..163fc118873f 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -871,7 +871,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 {
 	struct sh_mobile_i2c_data *pd;
 	struct i2c_adapter *adap;
-	struct resource *res;
 	const struct sh_mobile_dt_config *config;
 	int ret;
 	u32 bus_speed;
@@ -893,10 +892,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->dev = &dev->dev;
 	platform_set_drvdata(dev, pd);
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-
-	pd->res = res;
-	pd->reg = devm_ioremap_resource(&dev->dev, res);
+	pd->reg = devm_platform_get_and_ioremap_resource(dev, 0, &pd->res);
 	if (IS_ERR(pd->reg))
 		return PTR_ERR(pd->reg);
 
@@ -905,7 +901,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->clks_per_count = 1;
 
 	/* Newer variants come with two new bits in ICIC */
-	if (resource_size(res) > 0x17)
+	if (resource_size(pd->res) > 0x17)
 		pd->flags |= IIC_FLAG_HAS_ICIC67;
 
 	pm_runtime_enable(&dev->dev);
-- 
2.39.0


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

* [PATCH v2 09/11] i2c: s3c2410: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (6 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:58   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Andi Shyti
  Cc: Yangtao Li, linux-arm-kernel, linux-samsung-soc, linux-i2c,
	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/i2c/busses/i2c-s3c2410.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 28f0e5c64f32..c14c3807e135 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1034,9 +1034,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 	dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
 
 	/* map the registers */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	i2c->regs = devm_ioremap_resource(&pdev->dev, res);
-
+	i2c->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(i2c->regs))
 		return PTR_ERR(i2c->regs);
 
-- 
2.39.0


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

* [PATCH v2 10/11] i2c: pxa: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (7 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 15:59   ` Andi Shyti
  2023-07-10  6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Andi Shyti; +Cc: Yangtao Li, linux-i2c, 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>
---
v2:
-s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev
 drivers/i2c/busses/i2c-pxa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 937f7eebe906..b630bfeaeb85 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1362,7 +1362,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	struct i2c_pxa_platform_data *plat = dev_get_platdata(&dev->dev);
 	enum pxa_i2c_types i2c_type;
 	struct pxa_i2c *i2c;
-	struct resource *res = NULL;
+	struct resource *res;
 	int ret, irq;
 
 	i2c = devm_kzalloc(&dev->dev, sizeof(struct pxa_i2c), GFP_KERNEL);
@@ -1379,8 +1379,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	i2c->adap.dev.of_node = dev->dev.of_node;
 #endif
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	i2c->reg_base = devm_ioremap_resource(&dev->dev, res);
+	i2c->reg_base = devm_platform_get_and_ioremap_resource(dev, 0, &res);
 	if (IS_ERR(i2c->reg_base))
 		return PTR_ERR(i2c->reg_base);
 
-- 
2.39.0


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

* [PATCH v2 11/11] i2c: pnx: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (8 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li
@ 2023-07-10  6:33 ` Yangtao Li
  2023-07-12 16:00   ` Andi Shyti
  2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti
  2023-08-14 16:10 ` Wolfram Sang
  11 siblings, 1 reply; 26+ messages in thread
From: Yangtao Li @ 2023-07-10  6:33 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Andi Shyti
  Cc: Yangtao Li, linux-arm-kernel, linux-i2c, 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/i2c/busses/i2c-pnx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 82400057f810..ecbbb60407c3 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -683,8 +683,7 @@ static int i2c_pnx_probe(struct platform_device *pdev)
 		 "%s", pdev->name);
 
 	/* Register I/O resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	alg_data->ioaddr = devm_ioremap_resource(&pdev->dev, res);
+	alg_data->ioaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(alg_data->ioaddr))
 		return PTR_ERR(alg_data->ioaddr);
 
-- 
2.39.0


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

* Re: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
@ 2023-07-10 12:13   ` Geert Uytterhoeven
  2023-07-12 15:57   ` Andi Shyti
  1 sibling, 0 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2023-07-10 12:13 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Wolfram Sang, Andi Shyti, linux-renesas-soc, linux-i2c,
	linux-kernel

On Mon, Jul 10, 2023 at 8:41 AM Yangtao Li <frank.li@vivo.com> wrote:
> 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>
> ---
> v2:
> -s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
@ 2023-07-10 18:21   ` Kamal Dasu
  2023-07-10 21:00   ` Florian Fainelli
  2023-07-12 15:43   ` Andi Shyti
  2 siblings, 0 replies; 26+ messages in thread
From: Kamal Dasu @ 2023-07-10 18:21 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Broadcom internal kernel review list, Andi Shyti,
	Florian Fainelli, linux-i2c, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2635 bytes --]

On Mon, Jul 10, 2023 at 2:34 AM Yangtao Li <frank.li@vivo.com> wrote:
>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by:  Kamal Dasu <kamal.dasu@broadcom.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index cf92cbcb8c86..0d422487161a 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -594,11 +594,10 @@ static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev)
>
>  static int brcmstb_i2c_probe(struct platform_device *pdev)
>  {
> -       int rc = 0;
>         struct brcmstb_i2c_dev *dev;
>         struct i2c_adapter *adap;
> -       struct resource *iomem;
>         const char *int_name;
> +       int rc;
>
>         /* Allocate memory for private data structure */
>         dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -614,18 +613,15 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         init_completion(&dev->done);
>
>         /* Map hardware registers */
> -       iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       dev->base = devm_ioremap_resource(dev->device, iomem);
> -       if (IS_ERR(dev->base)) {
> -               rc = -ENOMEM;
> -               goto probe_errorout;
> -       }
> +       dev->base = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(dev->base))
> +               return PTR_ERR(dev->base);
>
>         if (of_device_is_compatible(dev->device->of_node,
>                                     "brcm,bcm2711-hdmi-i2c")) {
>                 rc = bcm2711_release_bsc(dev);
>                 if (rc)
> -                       goto probe_errorout;
> +                       return rc;
>         }
>
>         rc = of_property_read_string(dev->device->of_node, "interrupt-names",
> @@ -678,16 +674,13 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         adap->dev.of_node = pdev->dev.of_node;
>         rc = i2c_add_adapter(adap);
>         if (rc)
> -               goto probe_errorout;
> +               return rc;
>
>         dev_info(dev->device, "%s@%dhz registered in %s mode\n",
>                  int_name ? int_name : " ", dev->clk_freq_hz,
>                  (dev->irq >= 0) ? "interrupt" : "polling");
>
>         return 0;
> -
> -probe_errorout:
> -       return rc;
>  }
>
>  static void brcmstb_i2c_remove(struct platform_device *pdev)
> --
> 2.39.0
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4203 bytes --]

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

* Re: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
  2023-07-10 18:21   ` Kamal Dasu
@ 2023-07-10 21:00   ` Florian Fainelli
  2023-07-12 15:43   ` Andi Shyti
  2 siblings, 0 replies; 26+ messages in thread
From: Florian Fainelli @ 2023-07-10 21:00 UTC (permalink / raw)
  To: Yangtao Li, Kamal Dasu, Broadcom internal kernel review list,
	Andi Shyti
  Cc: linux-i2c, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]



On 7/10/2023 8:33 AM, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

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

* Re: [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (9 preceding siblings ...)
  2023-07-10  6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
@ 2023-07-12 15:37 ` Andi Shyti
  2023-08-14 16:10 ` Wolfram Sang
  11 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:37 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Codrin Ciubotariu, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, linux-i2c, linux-arm-kernel, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:40PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-12 15:40   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:40 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Ray Jui, linux-i2c, linux-arm-kernel, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:41PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> Acked-by: Ray Jui <ray.jui@broadcom.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
  2023-07-10 18:21   ` Kamal Dasu
  2023-07-10 21:00   ` Florian Fainelli
@ 2023-07-12 15:43   ` Andi Shyti
  2 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:43 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Kamal Dasu, Broadcom internal kernel review list,
	Florian Fainelli, linux-i2c, linux-arm-kernel, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:42PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-12 15:49   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:49 UTC (permalink / raw)
  To: Yangtao Li; +Cc: Khalil Blaiech, Asmaa Mnebhi, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:43PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

> ---
>  drivers/i2c/busses/i2c-mlxbf.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
> index ae66bdd1b737..2f60e5532b54 100644
> --- a/drivers/i2c/busses/i2c-mlxbf.c
> +++ b/drivers/i2c/busses/i2c-mlxbf.c
> @@ -1080,13 +1080,7 @@ static int mlxbf_i2c_init_resource(struct platform_device *pdev,
>  	if (!tmp_res)
>  		return -ENOMEM;
>  
> -	tmp_res->params = platform_get_resource(pdev, IORESOURCE_MEM, type);
> -	if (!tmp_res->params) {
> -		devm_kfree(dev, tmp_res);
> -		return -EIO;
> -	}
> -
> -	tmp_res->io = devm_ioremap_resource(dev, tmp_res->params);
> +	tmp_res->io = devm_platform_get_and_ioremap_resource(pdev, type, &tmp_res->params);
>  	if (IS_ERR(tmp_res->io)) {
>  		devm_kfree(dev, tmp_res);

In a later patch we could also remove this redundant
devm_kfree().

Andi

>  		return PTR_ERR(tmp_res->io);
> -- 
> 2.39.0
> 

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

* Re: [PATCH v2 05/11] i2c: stm32f4: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li
@ 2023-07-12 15:49   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:49 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Pierre-Yves MORDRET, Alain Volmat, Maxime Coquelin,
	Alexandre Torgue, linux-i2c, linux-stm32, linux-arm-kernel,
	linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:44PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-12 15:52   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:52 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:45PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-12 15:52   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:52 UTC (permalink / raw)
  To: Yangtao Li; +Cc: Patrice Chotard, linux-arm-kernel, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:46PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
  2023-07-10 12:13   ` Geert Uytterhoeven
@ 2023-07-12 15:57   ` Andi Shyti
  1 sibling, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:57 UTC (permalink / raw)
  To: Yangtao Li; +Cc: Wolfram Sang, linux-renesas-soc, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:47PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 09/11] i2c: s3c2410: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li
@ 2023-07-12 15:58   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:58 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Krzysztof Kozlowski, Alim Akhtar, linux-arm-kernel,
	linux-samsung-soc, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:48PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 10/11] i2c: pxa: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li
@ 2023-07-12 15:59   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 15:59 UTC (permalink / raw)
  To: Yangtao Li; +Cc: linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:49PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

> ---
> v2:
> -s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev
>  drivers/i2c/busses/i2c-pxa.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index 937f7eebe906..b630bfeaeb85 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1362,7 +1362,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  	struct i2c_pxa_platform_data *plat = dev_get_platdata(&dev->dev);
>  	enum pxa_i2c_types i2c_type;
>  	struct pxa_i2c *i2c;
> -	struct resource *res = NULL;
> +	struct resource *res;
>  	int ret, irq;
>  
>  	i2c = devm_kzalloc(&dev->dev, sizeof(struct pxa_i2c), GFP_KERNEL);
> @@ -1379,8 +1379,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  	i2c->adap.dev.of_node = dev->dev.of_node;
>  #endif
>  
> -	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> -	i2c->reg_base = devm_ioremap_resource(&dev->dev, res);
> +	i2c->reg_base = devm_platform_get_and_ioremap_resource(dev, 0, &res);
>  	if (IS_ERR(i2c->reg_base))
>  		return PTR_ERR(i2c->reg_base);
>  
> -- 
> 2.39.0
> 

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

* Re: [PATCH v2 11/11] i2c: pnx: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
@ 2023-07-12 16:00   ` Andi Shyti
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Shyti @ 2023-07-12 16:00 UTC (permalink / raw)
  To: Yangtao Li; +Cc: Vladimir Zapolskiy, linux-arm-kernel, linux-i2c, linux-kernel

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:50PM +0800, Yangtao Li wrote:
> 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>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Andi

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

* Re: [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource()
  2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (10 preceding siblings ...)
  2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti
@ 2023-08-14 16:10 ` Wolfram Sang
  11 siblings, 0 replies; 26+ messages in thread
From: Wolfram Sang @ 2023-08-14 16:10 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Codrin Ciubotariu, Andi Shyti, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, linux-i2c, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

On Mon, Jul 10, 2023 at 02:33:40PM +0800, Yangtao Li wrote:
> 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>

Applied to for-next as the rest of this series, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2023-08-14 16:11 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-12 15:40   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
2023-07-10 18:21   ` Kamal Dasu
2023-07-10 21:00   ` Florian Fainelli
2023-07-12 15:43   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-12 15:49   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li
2023-07-12 15:49   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-12 15:52   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-12 15:52   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
2023-07-10 12:13   ` Geert Uytterhoeven
2023-07-12 15:57   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li
2023-07-12 15:58   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li
2023-07-12 15:59   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
2023-07-12 16:00   ` Andi Shyti
2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti
2023-08-14 16:10 ` Wolfram Sang

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