
Dear Simon Glass,
In message BANLkTikGucjpun2RhS2T2Nyq4_KB9gK8zw@mail.gmail.com you wrote:
eth = &usb_eth[usb_max_eth_dev].eth_dev;
Index for eth is usb_max_eth_dev.
@@ -100,7 +102,10 @@ static void probe_valid_drivers(struct usb_device *> dev) * call since eth_current_> changed (internally called) * relies on it */
eth_register(&usb_eth[usb_max_eth_dev - 1].eth_dev);
eth_register(eth);
You change the behaviour here. Please confirmt his is really intentional.
Yes. Since I am using an 'eth' pointer I don't need to index the array again. The behaviour is the same as before.
No, it is not. Before, we were accessing entry N-1 here. Now we use entry N. usb_max_eth_dev != usb_max_eth_dev - 1
- base_name - base name for device (NULL for "eth")
This is an atitifical decision for the API which is difficult to understand. It just makes the code and understanding it more difficult. Just pass "eth" when you mean it.
The intention was to avoid everyone having to pass the correct value - potential for error, etc. I could have created a #define, but decided on this.
Ummm... but having everyone to pass the correct value is actually a really good thing to have!
Best regards,
Wolfgang Denk