[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220308080919.152715-9-krzysztof.kozlowski@canonical.com>
Date: Tue, 8 Mar 2022 09:09:19 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Alim Akhtar <alim.akhtar@...sung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v3 8/8] tty: serial: samsung: simplify getting OF match data
Simplify the code with of_device_get_match_data() and use dev_of_node()
to remove ifdef-erry.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Reviewed-by: Alim Akhtar <alim.akhtar@...sung.com>
Tested-by: Alim Akhtar <alim.akhtar@...sung.com>
---
drivers/tty/serial/samsung_tty.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 3ffae912217c..74d466cc4152 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2150,23 +2150,14 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
/* Device driver serial port probe */
-#ifdef CONFIG_OF
-static const struct of_device_id s3c24xx_uart_dt_match[];
-#endif
-
static int probe_index;
static inline const struct s3c24xx_serial_drv_data *
s3c24xx_get_driver_data(struct platform_device *pdev)
{
-#ifdef CONFIG_OF
- if (pdev->dev.of_node) {
- const struct of_device_id *match;
+ if (dev_of_node(&pdev->dev))
+ return of_device_get_match_data(&pdev->dev);
- match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
- return (struct s3c24xx_serial_drv_data *)match->data;
- }
-#endif
return (struct s3c24xx_serial_drv_data *)
platform_get_device_id(pdev)->driver_data;
}
--
2.32.0
Powered by blists - more mailing lists