Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Fabio Estevam and committed by
Greg Kroah-Hartman
e8372c4f f754ed71

+1 -3
+1 -3
drivers/tty/serial/fsl_lpuart.c
··· 2580 2580 2581 2581 static int lpuart_probe(struct platform_device *pdev) 2582 2582 { 2583 - const struct of_device_id *of_id = of_match_device(lpuart_dt_ids, 2584 - &pdev->dev); 2585 - const struct lpuart_soc_data *sdata = of_id->data; 2583 + const struct lpuart_soc_data *sdata = of_device_get_match_data(&pdev->dev); 2586 2584 struct device_node *np = pdev->dev.of_node; 2587 2585 struct lpuart_port *sport; 2588 2586 struct resource *res;