Skip to contentSkip to conversation

serial: fsl_lpuart: Use of_device_get_match_data()

PATCH New Fabio Estevam 1 participant 1 message Jan 18, 2021 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: fsl_lpuart: Use of_device_get_match_data()

The retrieval of driver data via of_device_get_match_data() can make the code simpler.

Use of_device_get_match_data() to simplify the code.

---
 drivers/tty/serial/fsl_lpuart.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/fsl_lpuart.c +1 -3
index bd047e1f9bea..794035041744 100644
@@ -2580,9 +2580,7 @@ static struct uart_driver lpuart_reg = {
 
 static int lpuart_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id = of_match_device(lpuart_dt_ids,
-							   &pdev->dev);
-	const struct lpuart_soc_data *sdata = of_id->data;
+	const struct lpuart_soc_data *sdata = of_device_get_match_data(&pdev->dev);
 	struct device_node *np = pdev->dev.of_node;
 	struct lpuart_port *sport;
 	struct resource *res;
Signature · 1 line
2.17.1