[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437085572-11371-2-git-send-email-manabian@gmail.com>
Date: Fri, 17 Jul 2015 00:26:05 +0200
From: Joachim Eastwood <manabian@...il.com>
To: peppe.cavallaro@...com, davem@...emloft.net
Cc: Joachim Eastwood <manabian@...il.com>, netdev@...r.kernel.org
Subject: [PATCH net-next 1/8] stmmac: use of_device_get_match_data to retrieve of match data
By using of_device_get_match_data() the code that retrieve
match data can be simplified quite a bit.
Signed-off-by: Joachim Eastwood <manabian@...il.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index f3918c7e7eeb..89e40ddc0391 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -109,13 +109,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
const char **mac)
{
struct device_node *np = pdev->dev.of_node;
+ const struct stmmac_of_data *data;
struct stmmac_dma_cfg *dma_cfg;
- const struct of_device_id *device;
- struct device *dev = &pdev->dev;
- device = of_match_device(dev->driver->of_match_table, dev);
- if (device->data) {
- const struct stmmac_of_data *data = device->data;
+ data = of_device_get_match_data(&pdev->dev);
+ if (data) {
plat->has_gmac = data->has_gmac;
plat->enh_desc = data->enh_desc;
plat->tx_coe = data->tx_coe;
--
1.8.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists