usbdev: Refactor device discovery code
Currently there is a lot of code shared between
usb_dev_get_by_vid_pid_serial() and usb_dev_get_by_vid_pid_number().
Fix this by pulling out the conditional filtering at the heart of each loop
and calling it via a function pointer.
I haven't got (two) dediprog programmers to test with but I have tested
both by...serial() and by...number() calls using a pair of Developerboxen
and a hacked driver.
Signed-off-by: Daniel Thompson <firstname.lastname@example.org>
Tested-by: build bot (Jenkins) <email@example.com>
Reviewed-by: Nico Huber <firstname.lastname@example.org>
1 file changed