diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2016-02-22 08:59:27 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2016-02-22 08:59:27 +0000 |
commit | fdec7475bf9e321a3729d5ba2100e30e110870ea (patch) | |
tree | fa61a001405821df55486cd6d8a0058ccc9127f1 /dediprog.c | |
parent | f31fe841d78a01cd85b86b5fd9cb7e5bb64dfc4c (diff) | |
download | ast2050-flashrom-fdec7475bf9e321a3729d5ba2100e30e110870ea.zip ast2050-flashrom-fdec7475bf9e321a3729d5ba2100e30e110870ea.tar.gz |
dediprog: use ordinary USB devs array
Even though there is currently only one USB device ID in the wild using our
standard way to define the devices creates nicer output for -L and -z.
Corresponding to flashrom svn r1942.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'dediprog.c')
-rw-r--r-- | dediprog.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -143,6 +143,11 @@ enum dediprog_standalone_mode { LEAVE_STANDALONE_MODE = 1, }; +const struct dev_entry devs_dediprog[] = { + {0x0483, 0xDADA, OK, "Dediprog", "SF100/SF600"}, + + {0}, +}; static int dediprog_firmwareversion = FIRMWARE_VERSION(0, 0, 0); enum dediprog_devtype dediprog_devicetype = DEV_UNKNOWN; @@ -1019,7 +1024,10 @@ int dediprog_init(void) msg_perr("Could not initialize libusb!\n"); return 1; } - dediprog_handle = get_device_by_vid_pid_number(0x0483, 0xdada, (unsigned int) usedevice); + + const uint16_t vid = devs_dediprog[0].vendor_id; + const uint16_t pid = devs_dediprog[0].device_id; + dediprog_handle = get_device_by_vid_pid_number(vid, pid, (unsigned int) usedevice); if (!dediprog_handle) { msg_perr("Could not find a Dediprog programmer on USB.\n"); libusb_exit(usb_ctx); |