summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/via
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2021-08-23 19:33:37 +0800
committerDavid S. Miller <davem@davemloft.net>2021-08-23 12:56:15 +0100
commitf6a4e0e8a00ff6fadb29f3646ccd33cc85195a38 (patch)
tree9390d3b38d409df60e1b42b5090e8c26a5bda066 /drivers/net/ethernet/via
parentb708a96d76462614123f4e8a8bb030889ab43ba4 (diff)
via-velocity: Use of_device_get_match_data to simplify code
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>
Diffstat (limited to 'drivers/net/ethernet/via')
-rw-r--r--drivers/net/ethernet/via/via-velocity.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index 278f49518d3f..6a08ea658816 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -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)