serial: 8250_ingenic: Use of_device_get_match_data
authorTang Bin <tangbin@cmss.chinamobile.com>
Sun, 22 Aug 2021 03:28:04 +0000 (11:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 12:51:10 +0000 (14:51 +0200)
Retrieve OF match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.

Acked-by: Paul Cercueil <paul@crapouillou.net>
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-2-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_ingenic.c

index 988bf6bcce42d03f30c97e83e770a3e34848eac1..65402d05eff9301e77c91288e6219101e21973b7 100644 (file)
@@ -209,16 +209,14 @@ static int ingenic_uart_probe(struct platform_device *pdev)
        struct uart_8250_port uart = {};
        struct ingenic_uart_data *data;
        const struct ingenic_uart_config *cdata;
-       const struct of_device_id *match;
        struct resource *regs;
        int irq, err, line;
 
-       match = of_match_device(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;
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)