[U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Timur Tabi
The Ethernet initialization functions are supposed to return the number of devices initialized, so fix tsec_eth_init() so that it returns the number of TSECs initialized instead of just zero. This is safe because the return value is currently ignored by all callers, but now they don't have to igno

Re: [U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Andy Fleming
On Jun 4, 2010, at 3:50 PM, Timur Tabi wrote: > The Ethernet initialization functions are supposed to return the number of > devices initialized, so fix tsec_eth_init() so that it returns the number of > TSECs initialized instead of just zero. This is safe because the return value > is currently

Re: [U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Timur Tabi
Andy Fleming wrote: > The old way continued even if one of the tsecs failed to initialize. Let's > preserve the original behavior in that sense: > > for (i = 0; i < num; i++) { > ret = tsec_initialize(bis, &tsecs[i]); > if (ret >= 0) > count++; > } This code has multi

Re: [U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Andy Fleming
On Jun 4, 2010, at 4:01 PM, Timur Tabi wrote: > Andy Fleming wrote: > >> The old way continued even if one of the tsecs failed to initialize. Let's >> preserve the original behavior in that sense: >> >> for (i = 0; i < num; i++) { >> ret = tsec_initialize(bis, &tsecs[i]); >> if (ret

Re: [U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Timur Tabi
Andy Fleming wrote: > You just noted that tsec_eth_init should return the number of tsecs > initialized successfully. Therefore, the callers can check that number, > and respond accordingly. tsec_initialize() can report the error. If we > want more elaborate error handling, we can devise somethi

Re: [U-Boot] [PATCH] tsec: fix the return value for tsec_eth_init()

2010-06-04 Thread Ben Warren
On 6/4/2010 2:42 PM, Timur Tabi wrote: > Andy Fleming wrote: > >> You just noted that tsec_eth_init should return the number of tsecs >> initialized successfully. Therefore, the callers can check that number, >> and respond accordingly. tsec_initialize() can report the error. If we >> want m