dediprog: Read device string early

To select one of multiple Dediprogs by `id', we need to know early what
type of device we found, so we can select the proper way to read its id.
OTOH, when a specific device is selected but incompatible (e.g. unknown
firmware version),  we still want to provide correct console output. If
we split the device-type detection from further processing, we can tell
first that a matching device was found and still bail out later in case
the device turns out to be incompatible.

Tested with "SF600PG2. V:01.01.012 HW:01.00", "SF100   V:5.1.9".

Change-Id: I820982d61831e6cd6a830f915dc745a1adea3776
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/102
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
1 file changed