Skip to content

Commit f25fbd5

Browse files
krzkgregkh
authored andcommitted
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>
1 parent bb1d981 commit f25fbd5

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/tty/serial/samsung_tty.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,23 +2147,14 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
21472147

21482148
/* Device driver serial port probe */
21492149

2150-
#ifdef CONFIG_OF
2151-
static const struct of_device_id s3c24xx_uart_dt_match[];
2152-
#endif
2153-
21542150
static int probe_index;
21552151

21562152
static inline const struct s3c24xx_serial_drv_data *
21572153
s3c24xx_get_driver_data(struct platform_device *pdev)
21582154
{
2159-
#ifdef CONFIG_OF
2160-
if (pdev->dev.of_node) {
2161-
const struct of_device_id *match;
2155+
if (dev_of_node(&pdev->dev))
2156+
return of_device_get_match_data(&pdev->dev);
21622157

2163-
match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node);
2164-
return (struct s3c24xx_serial_drv_data *)match->data;
2165-
}
2166-
#endif
21672158
return (struct s3c24xx_serial_drv_data *)
21682159
platform_get_device_id(pdev)->driver_data;
21692160
}

0 commit comments

Comments
 (0)