LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-12  6:28 Yangtao Li
  2023-07-12  6:28 ` [PATCH 02/15] serial: bcm63xx-uart: " Yangtao Li
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/ar933x_uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 4c3d04c6826a..924c1a89347c 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -749,8 +749,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
 
 	port = &up->port;
 
-	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	port->membase = devm_ioremap_resource(&pdev->dev, mem_res);
+	port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &mem_res);
 	if (IS_ERR(port->membase))
 		return PTR_ERR(port->membase);
 
-- 
2.39.0


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

* [PATCH 02/15] serial: bcm63xx-uart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 03/15] serial: clps711x: " Yangtao Li
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/bcm63xx_uart.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 55e82d0bf92d..0dd8cceb837c 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -832,14 +832,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
 		return -EBUSY;
 	memset(port, 0, sizeof(*port));
 
-	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res_mem)
-		return -ENODEV;
-
-	port->mapbase = res_mem->start;
-	port->membase = devm_ioremap_resource(&pdev->dev, res_mem);
+	port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res_mem);
 	if (IS_ERR(port->membase))
 		return PTR_ERR(port->membase);
+	port->mapbase = res_mem->start;
 
 	ret = platform_get_irq(pdev, 0);
 	if (ret < 0)
-- 
2.39.0


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

* [PATCH 03/15] serial: clps711x: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-12  6:28 ` [PATCH 02/15] serial: bcm63xx-uart: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 04/15] serial: linflexuart: " Yangtao Li
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby, Alexander Shiyan
  Cc: Yangtao Li, linux-serial, 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/tty/serial/clps711x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index e49bc4019b50..0deb1d7b53e3 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -450,8 +450,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
 	if (IS_ERR(uart_clk))
 		return PTR_ERR(uart_clk);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	s->port.membase = devm_ioremap_resource(&pdev->dev, res);
+	s->port.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(s->port.membase))
 		return PTR_ERR(s->port.membase);
 
-- 
2.39.0


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

* [PATCH 04/15] serial: linflexuart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
  2023-07-12  6:28 ` [PATCH 02/15] serial: bcm63xx-uart: " Yangtao Li
  2023-07-12  6:28 ` [PATCH 03/15] serial: clps711x: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 05/15] serial: tegra: " Yangtao Li
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/fsl_linflexuart.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c
index 6fc21b6684e6..d3b38a376e08 100644
--- a/drivers/tty/serial/fsl_linflexuart.c
+++ b/drivers/tty/serial/fsl_linflexuart.c
@@ -827,14 +827,10 @@ static int linflex_probe(struct platform_device *pdev)
 
 	sport->line = ret;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-
-	sport->mapbase = res->start;
-	sport->membase = devm_ioremap_resource(&pdev->dev, res);
+	sport->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(sport->membase))
 		return PTR_ERR(sport->membase);
+	sport->mapbase = res->start;
 
 	sport->dev = &pdev->dev;
 	sport->type = PORT_LINFLEXUART;
-- 
2.39.0


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

* [PATCH 05/15] serial: tegra: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (2 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 04/15] serial: linflexuart: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 06/15] serial: omap: " Yangtao Li
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Laxman Dewangan, Greg Kroah-Hartman, Jiri Slaby, Thierry Reding,
	Jonathan Hunter
  Cc: Yangtao Li, linux-serial, linux-tegra, 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/tty/serial/serial-tegra.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 1cf08b33456c..1edb4c381888 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1579,16 +1579,11 @@ static int tegra_uart_probe(struct platform_device *pdev)
 	tup->cdata = cdata;
 
 	platform_set_drvdata(pdev, tup);
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!resource) {
-		dev_err(&pdev->dev, "No IO memory resource\n");
-		return -ENODEV;
-	}
 
-	u->mapbase = resource->start;
-	u->membase = devm_ioremap_resource(&pdev->dev, resource);
+	u->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &resource);
 	if (IS_ERR(u->membase))
 		return PTR_ERR(u->membase);
+	u->mapbase = resource->start;
 
 	tup->uart_clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(tup->uart_clk)) {
-- 
2.39.0


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

* [PATCH 06/15] serial: omap: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (3 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 05/15] serial: tegra: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 07/15] serial: fsl_lpuart: " Yangtao Li
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/omap-serial.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 82d35dbbfa6c..180428f45ce3 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1573,8 +1573,7 @@ static int serial_omap_probe(struct platform_device *pdev)
 	if (!up)
 		return -ENOMEM;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, mem);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.39.0


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

* [PATCH 07/15] serial: fsl_lpuart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (4 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 06/15] serial: omap: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 08/15] serial: vt8500: " Yangtao Li
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/fsl_lpuart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 4d80fae20177..b04951523c5f 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2811,8 +2811,7 @@ static int lpuart_probe(struct platform_device *pdev)
 	if (!sport)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sport->port.membase = devm_ioremap_resource(&pdev->dev, res);
+	sport->port.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(sport->port.membase))
 		return PTR_ERR(sport->port.membase);
 
-- 
2.39.0


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

* [PATCH 08/15] serial: vt8500: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (5 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 07/15] serial: fsl_lpuart: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 09/15] serial: mps2-uart: " Yangtao Li
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Yangtao Li, linux-arm-kernel, linux-serial, 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/tty/serial/vt8500_serial.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c
index cc9157df732f..bcef41c0262e 100644
--- a/drivers/tty/serial/vt8500_serial.c
+++ b/drivers/tty/serial/vt8500_serial.c
@@ -611,10 +611,6 @@ static int vt8500_serial_probe(struct platform_device *pdev)
 	if (!flags)
 		return -EINVAL;
 
-	mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mmres)
-		return -ENODEV;
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
@@ -647,7 +643,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
 	if (!vt8500_port)
 		return -ENOMEM;
 
-	vt8500_port->uart.membase = devm_ioremap_resource(&pdev->dev, mmres);
+	vt8500_port->uart.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &mmres);
 	if (IS_ERR(vt8500_port->uart.membase))
 		return PTR_ERR(vt8500_port->uart.membase);
 
-- 
2.39.0


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

* [PATCH 09/15] serial: mps2-uart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (6 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 08/15] serial: vt8500: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-13 13:18   ` Sudeep Holla
  2023-07-12  6:28 ` [PATCH 10/15] serial: sprd: " Yangtao Li
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby, Liviu Dudau, Sudeep Holla,
	Lorenzo Pieralisi
  Cc: Yangtao Li, linux-serial, 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/tty/serial/mps2-uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c
index 860d161fa594..8ca62e7b7ab6 100644
--- a/drivers/tty/serial/mps2-uart.c
+++ b/drivers/tty/serial/mps2-uart.c
@@ -539,8 +539,7 @@ static int mps2_init_port(struct platform_device *pdev,
 	struct resource *res;
 	int ret;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mps_port->port.membase = devm_ioremap_resource(&pdev->dev, res);
+	mps_port->port.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(mps_port->port.membase))
 		return PTR_ERR(mps_port->port.membase);
 
-- 
2.39.0


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

* [PATCH 10/15] serial: sprd: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (7 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 09/15] serial: mps2-uart: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 11/15] serial: sccnxp: " Yangtao Li
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby, Orson Zhai, Baolin Wang,
	Chunyan Zhang
  Cc: Yangtao Li, linux-serial, 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/tty/serial/sprd_serial.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index b58f51296ace..bc47229069a3 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1179,8 +1179,7 @@ static int sprd_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	up->membase = devm_ioremap_resource(&pdev->dev, res);
+	up->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(up->membase))
 		return PTR_ERR(up->membase);
 
-- 
2.39.0


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

* [PATCH 11/15] serial: sccnxp: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (8 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 10/15] serial: sprd: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 12/15] serial: mvebu-uart: " Yangtao Li
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Yangtao Li, linux-serial, 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/tty/serial/sccnxp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 4f2fc5f7bb19..d0f571a4edbf 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -880,14 +880,14 @@ MODULE_DEVICE_TABLE(platform, sccnxp_id_table);
 
 static int sccnxp_probe(struct platform_device *pdev)
 {
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct sccnxp_pdata *pdata = dev_get_platdata(&pdev->dev);
+	struct resource *res;
 	int i, ret, uartclk;
 	struct sccnxp_port *s;
 	void __iomem *membase;
 	struct clk *clk;
 
-	membase = devm_ioremap_resource(&pdev->dev, res);
+	membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(membase))
 		return PTR_ERR(membase);
 
-- 
2.39.0


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

* [PATCH 12/15] serial: mvebu-uart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (9 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 11/15] serial: sccnxp: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 13/15] serial: sifive: " Yangtao Li
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Pali Rohár, Greg Kroah-Hartman, Jiri Slaby
  Cc: Yangtao Li, linux-serial, 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/tty/serial/mvebu-uart.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 31f739c7a08b..ea924e9b913b 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -876,18 +876,13 @@ static int uart_num_counter;
 
 static int mvebu_uart_probe(struct platform_device *pdev)
 {
-	struct resource *reg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	const struct of_device_id *match = of_match_device(mvebu_uart_of_match,
 							   &pdev->dev);
 	struct uart_port *port;
 	struct mvebu_uart *mvuart;
+	struct resource *reg;
 	int id, irq;
 
-	if (!reg) {
-		dev_err(&pdev->dev, "no registers defined\n");
-		return -EINVAL;
-	}
-
 	/* Assume that all UART ports have a DT alias or none has */
 	id = of_alias_get_id(pdev->dev.of_node, "serial");
 	if (!pdev->dev.of_node || id < 0)
@@ -922,11 +917,11 @@ static int mvebu_uart_probe(struct platform_device *pdev)
 	 */
 	port->irq        = 0;
 	port->irqflags   = 0;
-	port->mapbase    = reg->start;
 
-	port->membase = devm_ioremap_resource(&pdev->dev, reg);
+	port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &reg);
 	if (IS_ERR(port->membase))
 		return PTR_ERR(port->membase);
+	port->mapbase    = reg->start;
 
 	mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),
 			      GFP_KERNEL);
-- 
2.39.0


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

* [PATCH 13/15] serial: sifive: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (10 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 12/15] serial: mvebu-uart: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 14/15] serial: imx: " Yangtao Li
  2023-07-12  6:28 ` [PATCH 15/15] serial: st-asc: " Yangtao Li
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby, Palmer Dabbelt, Paul Walmsley
  Cc: Yangtao Li, linux-serial, linux-riscv, 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/tty/serial/sifive.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index 1f565a216e74..684933f5504c 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -917,12 +917,9 @@ static int sifive_serial_probe(struct platform_device *pdev)
 	if (irq < 0)
 		return -EPROBE_DEFER;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, mem);
-	if (IS_ERR(base)) {
-		dev_err(&pdev->dev, "could not acquire device memory\n");
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
+	if (IS_ERR(base))
 		return PTR_ERR(base);
-	}
 
 	clk = devm_clk_get_enabled(&pdev->dev, NULL);
 	if (IS_ERR(clk)) {
-- 
2.39.0


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

* [PATCH 14/15] serial: imx: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (11 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 13/15] serial: sifive: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  2023-07-12  6:28 ` [PATCH 15/15] serial: st-asc: " Yangtao Li
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Greg Kroah-Hartman, Jiri Slaby, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
  Cc: Yangtao Li, linux-serial, 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/tty/serial/imx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 7341d060f85c..4256bc41cf1b 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2276,8 +2276,7 @@ static int imx_uart_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.39.0


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

* [PATCH 15/15] serial: st-asc: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
                   ` (12 preceding siblings ...)
  2023-07-12  6:28 ` [PATCH 14/15] serial: imx: " Yangtao Li
@ 2023-07-12  6:28 ` Yangtao Li
  13 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-07-12  6:28 UTC (permalink / raw
  To: Patrice Chotard, Greg Kroah-Hartman, Jiri Slaby
  Cc: Yangtao Li, linux-arm-kernel, linux-serial, 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/tty/serial/st-asc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index aa471c9c24d9..4d3b74e48546 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -691,8 +691,7 @@ static int asc_init_port(struct asc_port *ascport,
 	port->irq	= platform_get_irq(pdev, 0);
 	port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_ST_ASC_CONSOLE);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	port->membase = devm_ioremap_resource(&pdev->dev, res);
+	port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(port->membase))
 		return PTR_ERR(port->membase);
 	port->mapbase = res->start;
-- 
2.39.0


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

* Re: [PATCH 09/15] serial: mps2-uart: Use devm_platform_get_and_ioremap_resource()
  2023-07-12  6:28 ` [PATCH 09/15] serial: mps2-uart: " Yangtao Li
@ 2023-07-13 13:18   ` Sudeep Holla
  0 siblings, 0 replies; 16+ messages in thread
From: Sudeep Holla @ 2023-07-13 13:18 UTC (permalink / raw
  To: Yangtao Li
  Cc: Greg Kroah-Hartman, Jiri Slaby, Sudeep Holla, Liviu Dudau,
	Lorenzo Pieralisi, linux-serial, linux-arm-kernel, linux-kernel

On Wed, Jul 12, 2023 at 02:28: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.
> 

Acked-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2023-07-13 13:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12  6:28 [PATCH 01/15] serial: ar933x: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-12  6:28 ` [PATCH 02/15] serial: bcm63xx-uart: " Yangtao Li
2023-07-12  6:28 ` [PATCH 03/15] serial: clps711x: " Yangtao Li
2023-07-12  6:28 ` [PATCH 04/15] serial: linflexuart: " Yangtao Li
2023-07-12  6:28 ` [PATCH 05/15] serial: tegra: " Yangtao Li
2023-07-12  6:28 ` [PATCH 06/15] serial: omap: " Yangtao Li
2023-07-12  6:28 ` [PATCH 07/15] serial: fsl_lpuart: " Yangtao Li
2023-07-12  6:28 ` [PATCH 08/15] serial: vt8500: " Yangtao Li
2023-07-12  6:28 ` [PATCH 09/15] serial: mps2-uart: " Yangtao Li
2023-07-13 13:18   ` Sudeep Holla
2023-07-12  6:28 ` [PATCH 10/15] serial: sprd: " Yangtao Li
2023-07-12  6:28 ` [PATCH 11/15] serial: sccnxp: " Yangtao Li
2023-07-12  6:28 ` [PATCH 12/15] serial: mvebu-uart: " Yangtao Li
2023-07-12  6:28 ` [PATCH 13/15] serial: sifive: " Yangtao Li
2023-07-12  6:28 ` [PATCH 14/15] serial: imx: " Yangtao Li
2023-07-12  6:28 ` [PATCH 15/15] serial: st-asc: " Yangtao Li

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 read-only IMAP folder(s) and NNTP newsgroup(s).