summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/via
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2021-08-23 13:33:36 +0200
committerDavid S. Miller <davem@davemloft.net>2021-08-23 13:56:15 +0200
commitb708a96d76462614123f4e8a8bb030889ab43ba4 (patch)
treeacf9e2a4b8a154e12696cdee4d257d41d758e3ba /drivers/net/ethernet/via
parenthinic: switch from 'pci_' to 'dma_' API (diff)
downloadlinux-b708a96d76462614123f4e8a8bb030889ab43ba4.tar.xz
linux-b708a96d76462614123f4e8a8bb030889ab43ba4.zip
via-rhine: 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-rhine.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 961b623b7880..3b73a9c55a5a 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -1113,13 +1113,12 @@ err_out:
static int rhine_init_one_platform(struct platform_device *pdev)
{
- const struct of_device_id *match;
const u32 *quirks;
int irq;
void __iomem *ioaddr;
- match = of_match_device(rhine_of_tbl, &pdev->dev);
- if (!match)
+ quirks = of_device_get_match_data(&pdev->dev);
+ if (!quirks)
return -EINVAL;
ioaddr = devm_platform_ioremap_resource(pdev, 0);
@@ -1130,10 +1129,6 @@ static int rhine_init_one_platform(struct platform_device *pdev)
if (!irq)
return -EINVAL;
- quirks = match->data;
- if (!quirks)
- return -EINVAL;
-
return rhine_init_one_common(&pdev->dev, *quirks,
(long)ioaddr, ioaddr, irq);
}