[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] [PATCH] Fix USB devices connected handling
2014-02-18 12:57 GMT+01:00 Alan Hourihane <alanh@fairlite.co.uk>:
> On 02/18/14 11:29, David Gálvez wrote:
>
> Hi David,
>
> Thanks for spotting the second part. But the first fix can't be right.
>
> When the devnum is allocated it's always +1, so the dev_index-- has to be
> decremented to get to the correct structure to zero out.
>
> Am I missing something ?
>
Yes :-)
This device index decrement was there for the static dev_index
variable that you removed. Now it's decrementing the device index
number (dev->devnum) in the USB device struct that is passed to the
usb_free_device() function, now when an initialization fails and this
function is called the data for the USB device previously installed is
cleared, the root hub for example when the first USB device plugged
fails.
I hope I explained my self :-)