/* Typically this will simply return the active device. In the case where the most recent active device was unset, this will attempt to return the first device. If that device doesn't exist or fails to probe, this function will return NULL.  */
struct udevice* eth_get_dev(void)
/* Typically this will simply return the active device. In the case where the most recent active device was unset, this will attempt to return the first device. If that device doesn't exist or fails to probe, this function will return NULL.  */
struct udevice* eth_get_dev(void)
{
	struct eth_uclass_priv *uc_priv;
	uc_priv = eth_get_uclass_priv();
	if (!uc_priv->current)
		eth_errno = uclass_first_device(UCLASS_ETH,
				    &uc_priv->current);
	return uc_priv->current;
}