* [PATCH] serial: fsl_lpuart: Use of_device_get_match_data()
@ 2021-01-18 12:44 Fabio Estevam
0 siblings, 0 replies; only message in thread
From: Fabio Estevam @ 2021-01-18 12:44 UTC (permalink / raw)
To: gregkh; +Cc: linux-serial, Fabio Estevam
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>
---
drivers/tty/serial/fsl_lpuart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index bd047e1f9bea..794035041744 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-18 12:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 12:44 [PATCH] serial: fsl_lpuart: Use of_device_get_match_data() Fabio Estevam
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 NNTP newsgroup(s).