Author: stefanct Date: Mon Feb 22 09:59:27 2016 New Revision: 1942 URL: http://flashrom.org/trac/flashrom/changeset/1942
Log: 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.
Signed-off-by: Stefan Tauner stefan.tauner@alumni.tuwien.ac.at Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Modified: trunk/dediprog.c trunk/flashrom.c trunk/programmer.h
Modified: trunk/dediprog.c ============================================================================== --- trunk/dediprog.c Mon Feb 22 09:59:15 2016 (r1941) +++ trunk/dediprog.c Mon Feb 22 09:59:27 2016 (r1942) @@ -143,6 +143,11 @@ 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 @@ 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);
Modified: trunk/flashrom.c ============================================================================== --- trunk/flashrom.c Mon Feb 22 09:59:15 2016 (r1941) +++ trunk/flashrom.c Mon Feb 22 09:59:27 2016 (r1942) @@ -247,9 +247,8 @@ #if CONFIG_DEDIPROG == 1 { .name = "dediprog", - .type = OTHER, - /* FIXME */ - .devs.note = "Dediprog SF100\n", + .type = USB, + .devs.dev = devs_dediprog, .init = dediprog_init, .map_flash_region = fallback_map, .unmap_flash_region = fallback_unmap,
Modified: trunk/programmer.h ============================================================================== --- trunk/programmer.h Mon Feb 22 09:59:15 2016 (r1941) +++ trunk/programmer.h Mon Feb 22 09:59:27 2016 (r1942) @@ -528,6 +528,7 @@ /* dediprog.c */ #if CONFIG_DEDIPROG == 1 int dediprog_init(void); +extern const struct dev_entry devs_dediprog[]; #endif
/* ch341a_spi.c */