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

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

authored by

Tang Bin and committed by
Greg Kroah-Hartman
74d2fb7e a6a65f9e

+2 -5
+2 -5
drivers/tty/serial/vt8500_serial.c
··· 623 623 struct vt8500_port *vt8500_port; 624 624 struct resource *mmres, *irqres; 625 625 struct device_node *np = pdev->dev.of_node; 626 - const struct of_device_id *match; 627 626 const unsigned int *flags; 628 627 int ret; 629 628 int port; 630 629 631 - match = of_match_device(wmt_dt_ids, &pdev->dev); 632 - if (!match) 630 + flags = of_device_get_match_data(&pdev->dev); 631 + if (!flags) 633 632 return -EINVAL; 634 - 635 - flags = match->data; 636 633 637 634 mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0); 638 635 irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);