diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2022-03-08 11:09:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-18 15:24:28 +0300 |
commit | f25fbd5b1ef3773bd975135f8a017dc2251626cc (patch) | |
tree | ebffd1445e2e791181a0f0a87a3884198dd3fd2e /drivers/tty/serial/samsung_tty.c | |
parent | bb1d98187b09d44b43115f5086a6de5adce61c17 (diff) | |
download | linux-f25fbd5b1ef3773bd975135f8a017dc2251626cc.tar.xz |
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.
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20220308080919.152715-9-krzysztof.kozlowski@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/samsung_tty.c')
-rw-r--r-- | drivers/tty/serial/samsung_tty.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index f466c8f8adcc..5affd7e707bd 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2147,23 +2147,14 @@ err: /* 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; } |