From f79b653523980cb3a7510a474860aa1594868c9f Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 10 Aug 2012 13:22:01 +0200 Subject: cold-flash: Use struct usb_device_info --- src/cold-flash.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cold-flash.c') diff --git a/src/cold-flash.c b/src/cold-flash.c index 6f47e1a..6b14684 100644 --- a/src/cold-flash.c +++ b/src/cold-flash.c @@ -305,7 +305,7 @@ static int ping_timeout(usb_dev_handle * udev) { } -int cold_flash(usb_dev_handle * udev, struct image * x2nd, struct image * secondary) { +int cold_flash(struct usb_device_info * dev, struct image * x2nd, struct image * secondary) { if ( x2nd->type != IMAGE_2ND ) { fprintf(stderr, "Image type is not 2nd X-Loader\n"); @@ -317,22 +317,22 @@ int cold_flash(usb_dev_handle * udev, struct image * x2nd, struct image * second return 1; } - if ( ! read_asic(udev) ) { + if ( ! read_asic(dev->udev) ) { fprintf(stderr, "Reading ASIC ID failed\n"); return 1; } - if ( ! send_2nd(udev, x2nd) ) { + if ( ! send_2nd(dev->udev, x2nd) ) { fprintf(stderr, "Sending 2nd X-Loader image failed\n"); return 1; } - if ( ! ping_timeout(udev) ) { + if ( ! ping_timeout(dev->udev) ) { fprintf(stderr, "Sending X-Loader ping message failed\n"); return 1; } - if ( ! send_secondary(udev, secondary) ) { + if ( ! send_secondary(dev->udev, secondary) ) { fprintf(stderr, "Sending Secondary image failed\n"); return 1; } @@ -342,17 +342,17 @@ int cold_flash(usb_dev_handle * udev, struct image * x2nd, struct image * second } -int leave_cold_flash(usb_dev_handle * udev) { +int leave_cold_flash(struct usb_device_info * dev) { int ret; - if ( ! read_asic(udev) ) { + if ( ! read_asic(dev->udev) ) { fprintf(stderr, "Reading ASIC ID failed\n"); return 1; } printf("Sending OMAP memory boot message...\n"); - ret = usb_bulk_write(udev, WRITE_DEV, (char *)&omap_memory_msg, sizeof(omap_memory_msg), WRITE_TIMEOUT); + ret = usb_bulk_write(dev->udev, WRITE_DEV, (char *)&omap_memory_msg, sizeof(omap_memory_msg), WRITE_TIMEOUT); usleep(5000); if ( ret != sizeof(omap_memory_msg) ) { fprintf(stderr, "Error while sending OMAP memory boot message\n"); -- cgit v1.2.3