@ -179,8 +179,12 @@ struct udevice *eth_get_dev(void)
*/
*/
static void eth_set_dev ( struct udevice * dev )
static void eth_set_dev ( struct udevice * dev )
{
{
if ( dev & & ! device_active ( dev ) )
if ( dev & & ! device_active ( dev ) ) {
eth_errno = device_probe ( dev ) ;
eth_errno = device_probe ( dev ) ;
if ( eth_errno )
dev = NULL ;
}
eth_get_uclass_priv ( ) - > current = dev ;
eth_get_uclass_priv ( ) - > current = dev ;
}
}
@ -213,10 +217,9 @@ struct udevice *eth_get_dev_by_name(const char *devname)
* match an alias or it will match a literal name and we ' ll pick
* match an alias or it will match a literal name and we ' ll pick
* up the error when we try to probe again in eth_set_dev ( ) .
* up the error when we try to probe again in eth_set_dev ( ) .
*/
*/
device_probe ( it ) ;
if ( device_probe ( it ) )
/*
continue ;
* Check for the name or the sequence number to match
/* Check for the name or the sequence number to match */
*/
if ( strcmp ( it - > name , devname ) = = 0 | |
if ( strcmp ( it - > name , devname ) = = 0 | |
( endp > startp & & it - > seq = = seq ) )
( endp > startp & & it - > seq = = seq ) )
return it ;
return it ;
@ -346,6 +349,7 @@ int eth_init(void)
old_current = current ;
old_current = current ;
do {
do {
if ( current ) {
debug ( " Trying %s \n " , current - > name ) ;
debug ( " Trying %s \n " , current - > name ) ;
if ( device_active ( current ) ) {
if ( device_active ( current ) ) {
@ -362,6 +366,9 @@ int eth_init(void)
}
}
debug ( " FAIL \n " ) ;
debug ( " FAIL \n " ) ;
} else {
debug ( " PROBE FAIL \n " ) ;
}
/*
/*
* If ethrotate is enabled , this will change " current " ,
* If ethrotate is enabled , this will change " current " ,