Skip to content

Commit

Permalink
serial: vt8500: Use of_device_get_match_data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tang Bin authored and Greg Kroah-Hartman committed Aug 26, 2021
1 parent a6a65f9 commit 74d2fb7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/tty/serial/vt8500_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 74d2fb7

Please sign in to comment.