Skip to content

Commit 0dacf3f

Browse files
manabiandavem330
authored andcommitted
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@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7781e5d commit 0dacf3f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
109109
const char **mac)
110110
{
111111
struct device_node *np = pdev->dev.of_node;
112+
const struct stmmac_of_data *data;
112113
struct stmmac_dma_cfg *dma_cfg;
113-
const struct of_device_id *device;
114-
struct device *dev = &pdev->dev;
115114

116-
device = of_match_device(dev->driver->of_match_table, dev);
117-
if (device->data) {
118-
const struct stmmac_of_data *data = device->data;
115+
data = of_device_get_match_data(&pdev->dev);
116+
if (data) {
119117
plat->has_gmac = data->has_gmac;
120118
plat->enh_desc = data->enh_desc;
121119
plat->tx_coe = data->tx_coe;

0 commit comments

Comments
 (0)