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>
This commit is contained in:
parent
bb1d98187b
commit
f25fbd5b1e
|
@ -2147,23 +2147,14 @@ err:
|
||||||
|
|
||||||
/* Device driver serial port probe */
|
/* Device driver serial port probe */
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
|
||||||
static const struct of_device_id s3c24xx_uart_dt_match[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int probe_index;
|
static int probe_index;
|
||||||
|
|
||||||
static inline const struct s3c24xx_serial_drv_data *
|
static inline const struct s3c24xx_serial_drv_data *
|
||||||
s3c24xx_get_driver_data(struct platform_device *pdev)
|
s3c24xx_get_driver_data(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_OF
|
if (dev_of_node(&pdev->dev))
|
||||||
if (pdev->dev.of_node) {
|
return of_device_get_match_data(&pdev->dev);
|
||||||
const struct of_device_id *match;
|
|
||||||
|
|
||||||
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 *)
|
return (struct s3c24xx_serial_drv_data *)
|
||||||
platform_get_device_id(pdev)->driver_data;
|
platform_get_device_id(pdev)->driver_data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue