serial: fsl_lpuart: Use of_device_get_match_data()
authorFabio Estevam <festevam@gmail.com>
Mon, 18 Jan 2021 12:44:47 +0000 (09:44 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jan 2021 17:48:15 +0000 (18:48 +0100)
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.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118124447.1632092-1-festevam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_lpuart.c

index bd047e1f9bea71f982b4d743b3dc1cc7c60887f4..794035041744f9572ddef61f7ff9dbbda1d33cbb 100644 (file)
@@ -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;