Skip to content

Commit

Permalink
net: ibm: emac: Switch to use dev_err_probe() helper
Browse files Browse the repository at this point in the history
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Yingliang authored and David S. Miller committed Sep 21, 2022
1 parent d02bb8b commit b6dc230
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/ethernet/ibm/emac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2979,11 +2979,9 @@ static int emac_init_config(struct emac_instance *dev)

/* Read MAC-address */
err = of_get_ethdev_address(np, dev->ndev);
if (err) {
if (err != -EPROBE_DEFER)
dev_err(&dev->ofdev->dev, "Can't get valid [local-]mac-address from OF !\n");
return err;
}
if (err)
return dev_err_probe(&dev->ofdev->dev, err,
"Can't get valid [local-]mac-address from OF !\n");

/* IAHT and GAHT filter parameterization */
if (emac_has_feature(dev, EMAC_FTR_EMAC4SYNC)) {
Expand Down

0 comments on commit b6dc230

Please sign in to comment.