Skip to content

Commit a243ecc

Browse files
robherringdavem330
authored andcommitted
net: mdio: xgene: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() and acpi_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2dd3071 commit a243ecc

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

drivers/net/mdio/mdio-xgene.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
#include <linux/io.h>
1414
#include <linux/mdio/mdio-xgene.h>
1515
#include <linux/module.h>
16+
#include <linux/of.h>
1617
#include <linux/of_mdio.h>
1718
#include <linux/of_net.h>
18-
#include <linux/of_platform.h>
1919
#include <linux/phy.h>
20+
#include <linux/platform_device.h>
2021
#include <linux/prefetch.h>
22+
#include <linux/property.h>
2123
#include <net/ip.h>
2224

2325
u32 xgene_mdio_rd_mac(struct xgene_mdio_pdata *pdata, u32 rd_addr)
@@ -326,24 +328,11 @@ static int xgene_mdio_probe(struct platform_device *pdev)
326328
{
327329
struct device *dev = &pdev->dev;
328330
struct mii_bus *mdio_bus;
329-
const struct of_device_id *of_id;
330331
struct xgene_mdio_pdata *pdata;
331332
void __iomem *csr_base;
332333
int mdio_id = 0, ret = 0;
333334

334-
of_id = of_match_device(xgene_mdio_of_match, &pdev->dev);
335-
if (of_id) {
336-
mdio_id = (uintptr_t)of_id->data;
337-
} else {
338-
#ifdef CONFIG_ACPI
339-
const struct acpi_device_id *acpi_id;
340-
341-
acpi_id = acpi_match_device(xgene_mdio_acpi_match, &pdev->dev);
342-
if (acpi_id)
343-
mdio_id = (enum xgene_mdio_id)acpi_id->driver_data;
344-
#endif
345-
}
346-
335+
mdio_id = (uintptr_t)device_get_match_data(&pdev->dev);
347336
if (!mdio_id)
348337
return -ENODEV;
349338

0 commit comments

Comments
 (0)