Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: tegra: Use of_device_get_match_data

Retrieve OF match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210822032806.3256-3-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tang Bin and committed by
Greg Kroah-Hartman
a6a65f9e 618bf2b0

+2 -4
+2 -4
drivers/tty/serial/serial-tegra.c
··· 1568 1568 struct resource *resource; 1569 1569 int ret; 1570 1570 const struct tegra_uart_chip_data *cdata; 1571 - const struct of_device_id *match; 1572 1571 1573 - match = of_match_device(tegra_uart_of_match, &pdev->dev); 1574 - if (!match) { 1572 + cdata = of_device_get_match_data(&pdev->dev); 1573 + if (!cdata) { 1575 1574 dev_err(&pdev->dev, "Error: No device match found\n"); 1576 1575 return -ENODEV; 1577 1576 } 1578 - cdata = match->data; 1579 1577 1580 1578 tup = devm_kzalloc(&pdev->dev, sizeof(*tup), GFP_KERNEL); 1581 1579 if (!tup) {