Skip to content

Commit

Permalink
via-velocity: Use of_device_get_match_data to simplify code
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: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tang Bin authored and David S. Miller committed Aug 23, 2021
1 parent b708a96 commit f6a4e0e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/via/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -2943,14 +2943,12 @@ static void velocity_pci_remove(struct pci_dev *pdev)

static int velocity_platform_probe(struct platform_device *pdev)
{
const struct of_device_id *of_id;
const struct velocity_info_tbl *info;
int irq;

of_id = of_match_device(velocity_of_ids, &pdev->dev);
if (!of_id)
info = of_device_get_match_data(&pdev->dev);
if (!info)
return -EINVAL;
info = of_id->data;

irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
if (!irq)
Expand Down

0 comments on commit f6a4e0e

Please sign in to comment.