Skip to content

Commit

Permalink
stmmac: drop unnecessary dt checks in stmmac_probe_config_dt
Browse files Browse the repository at this point in the history
Since the caller already check the presence of a of_node there
is no need to repeat the check in stmmac_probe_config_dt.

There is also no point in checking the return value of the
of_match_device function since if there wasn't match in the
first place we would never be in this function.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joachim Eastwood authored and David S. Miller committed May 21, 2015
1 parent 15ffac7 commit def5cd3
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,7 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
const struct of_device_id *device;
struct device *dev = &pdev->dev;

if (!np)
return -ENODEV;

device = of_match_device(dev->driver->of_match_table, dev);
if (!device)
return -ENODEV;

if (device->data) {
const struct stmmac_of_data *data = device->data;
plat->has_gmac = data->has_gmac;
Expand Down

0 comments on commit def5cd3

Please sign in to comment.