summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2021-08-22 05:28:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-26 14:51:10 +0200
commita6a65f9ee0937d02e8084ee1ed305e38aae848e6 (patch)
treec1fc83e1540562ee2fffdaf2b6033b6d76becba8 /drivers/tty
parentserial: 8250_ingenic: Use of_device_get_match_data (diff)
downloadlinux-a6a65f9ee0937d02e8084ee1ed305e38aae848e6.tar.xz
linux-a6a65f9ee0937d02e8084ee1ed305e38aae848e6.zip
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial-tegra.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index eba5b9ecba34..45e2e4109acd 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1568,14 +1568,12 @@ static int tegra_uart_probe(struct platform_device *pdev)
struct resource *resource;
int ret;
const struct tegra_uart_chip_data *cdata;
- const struct of_device_id *match;
- match = of_match_device(tegra_uart_of_match, &pdev->dev);
- if (!match) {
+ cdata = of_device_get_match_data(&pdev->dev);
+ if (!cdata) {
dev_err(&pdev->dev, "Error: No device match found\n");
return -ENODEV;
}
- cdata = match->data;
tup = devm_kzalloc(&pdev->dev, sizeof(*tup), GFP_KERNEL);
if (!tup) {