scripts: imx-usb-loader: fail early if the USB device path does not match
find_imx_dev() loops through all USB devices, tries to open them, and
then compares the chosen device path (given with -p on the command line)
to the path of the currently opened device. The device path can be
checked earlier, opening the device is not neccessary.

We fail early here because in the next commit we want to enable the user
to force using a device by specifying its path. Opening every single
device available on the system then leads to unnecessary error messages
for all devices that do not match the provided path.

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 5e6b749 commit 5e176bda94c4ce0721a1ecbdc1604fc9ca6a43e1
@Roland Hieber Roland Hieber authored on 3 Sep 2018
Sascha Hauer committed on 7 Sep 2018
Showing 1 changed file
View
scripts/imx/imx-usb-loader.c