Skip to content

Commit a6a65f9

Browse files
Tang Bingregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Tang Bin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 618bf2b commit a6a65f9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/tty/serial/serial-tegra.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,14 +1568,12 @@ static int tegra_uart_probe(struct platform_device *pdev)
15681568
struct resource *resource;
15691569
int ret;
15701570
const struct tegra_uart_chip_data *cdata;
1571-
const struct of_device_id *match;
15721571

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) {
15751574
dev_err(&pdev->dev, "Error: No device match found\n");
15761575
return -ENODEV;
15771576
}
1578-
cdata = match->data;
15791577

15801578
tup = devm_kzalloc(&pdev->dev, sizeof(*tup), GFP_KERNEL);
15811579
if (!tup) {

0 commit comments

Comments
 (0)