Skip to contentSkip to conversation

serial: imx: Remove unneeded of_device_get_match_data() NULL check

PATCH In review Fabio Estevam 2 participants 3 messages Nov 26, 2020 – Nov 30, 2020

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 serial: imx: Remove unneeded of_device_get_match_data() NULL check

Since 5.10-rc1 i.MX is a devicetree-only platform and the NULL check on of_device_get_match_data() is no longer needed.

This check was only needed when this driver supported both DT and non-DT platforms.

Remove the unneeded of_device_get_match_data() NULL check.

---
 drivers/tty/serial/imx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/tty/serial/imx.c +0 -3
index b50f97cb07e9..6d12453ffc54 100644
@@ -2174,9 +2174,6 @@ static int imx_uart_probe_dt(struct imx_port *sport,
 	int ret;
 
 	sport->devdata = of_device_get_match_data(&pdev->dev);
-	if (!sport->devdata)
-		/* no device tree device */
-		return 1;
 
 	ret = of_alias_get_id(np, "serial");
 	if (ret < 0) {
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 18 lines · Fabio Estevam

Since 5.10-rc1 i.MX is a devicetree-only platform and the NULL check on of_device_get_match_data() is no longer needed.

This check was only needed when this driver supported both DT and non-DT platforms.

Remove the unneeded of_device_get_match_data() NULL check.

---
 drivers/tty/serial/imx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/tty/serial/imx.c +0 -0
index b50f97cb07e9..6d12453ffc54 100644

drivers/tty/serial/imx.c static int imx_uart_probe_dt(struct imx_port *sport, · line 2179

Quoted 6 lines
drivers/tty/serial/imx.c +0 -3
@@ -2174,9 +2174,6 @@ static int imx_uart_probe_dt(struct imx_port *sport,
 	int ret;
 
 	sport->devdata = of_device_get_match_data(&pdev->dev);
-	if (!sport->devdata)
-		/* no device tree device */
-		return 1;

Would it be sensible to fold imx_uart_probe_dt into imx_uart_probe now?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel