of_get_mac_address now uses NVMEM under the hood, so it could now return
EPROBE_DEFER and it needs to be handled, which means, that it needs to
be propagated back to the device driver subsystem in order to be handled
as designed.
While at it, remove superfluous call of is_valid_ether_addr, as the MAC
address returned by of_get_mac_address was already checked by
is_valid_ether_addr internally.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
ag->stop_desc->next = (u32) ag->stop_desc_dma;
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (PTR_ERR(mac_addr) == -EPROBE_DEFER) {
+ return -EPROBE_DEFER;
+ } else if (!IS_ERR_OR_NULL(mac_addr)) {
memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
- if (!mac_addr || !is_valid_ether_addr(dev->dev_addr)) {
+ } else {
dev_err(&pdev->dev, "invalid MAC address, using random address\n");
eth_random_addr(dev->dev_addr);
}