X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=net%2Feth-uclass.c;h=91d861be41365459a7bd5c114376b59b8c5a7652;hb=bb839ad931840e49472bf65c7e54d61aef8f6736;hp=240b5965345543ff679ae925a2401f9c254b6e8b;hpb=423effc04a195ce6a464eadadfa7f765bf786889;p=oweals%2Fu-boot.git diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 240b596534..91d861be41 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2001-2015 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Joe Hershberger, National Instruments - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -308,12 +307,13 @@ void eth_halt(void) struct eth_device_priv *priv; current = eth_get_dev(); - if (!current || !device_active(current)) + if (!current || !eth_is_active(current)) return; eth_get_ops(current)->stop(current); priv = current->uclass_priv; - priv->state = ETH_STATE_PASSIVE; + if (priv) + priv->state = ETH_STATE_PASSIVE; } int eth_is_active(struct udevice *dev) @@ -396,7 +396,7 @@ int eth_initialize(void) * This is accomplished by attempting to probe each device and calling * their write_hwaddr() operation. */ - uclass_first_device(UCLASS_ETH, &dev); + uclass_first_device_check(UCLASS_ETH, &dev); if (!dev) { printf("No ethernet found.\n"); bootstage_error(BOOTSTAGE_ID_NET_ETH_START); @@ -425,7 +425,7 @@ int eth_initialize(void) eth_write_hwaddr(dev); - uclass_next_device(&dev); + uclass_next_device_check(&dev); num_devices++; } while (dev);