]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
serial: vt8500: Use of_device_get_match_data
authorTang Bin <tangbin@cmss.chinamobile.com>
Sun, 22 Aug 2021 03:28:06 +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'.

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-4-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/vt8500_serial.c

index c5edd56ff83019f6d608a360d39af87396e272f2..e15b2bf69904cd8b2d5862b0603b4fadd98b0abf 100644 (file)
@@ -623,17 +623,14 @@ static int vt8500_serial_probe(struct platform_device *pdev)
        struct vt8500_port *vt8500_port;
        struct resource *mmres, *irqres;
        struct device_node *np = pdev->dev.of_node;
-       const struct of_device_id *match;
        const unsigned int *flags;
        int ret;
        int port;
 
-       match = of_match_device(wmt_dt_ids, &pdev->dev);
-       if (!match)
+       flags = of_device_get_match_data(&pdev->dev);
+       if (!flags)
                return -EINVAL;
 
-       flags = match->data;
-
        mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!mmres || !irqres)