operations: Check for supported image types in dev_flash_image
This commit is contained in:
1 parent
6372323ee8
commit
f1095777c6
1 file changed
+7
-2
+7
-2
@@ -174,10 +174,15 @@ int dev_flash_image(struct device_info * dev, struct image * image) {
|
||||
|
||||
enum usb_flash_protocol protocol = dev->usb->flash_device->protocol;
|
||||
|
||||
if ( protocol == FLASH_NOLO )
|
||||
if ( protocol == FLASH_NOLO ) {
|
||||
if ( image->type != IMAGE_MMC )
|
||||
return nolo_flash_image(dev->usb, image);
|
||||
else if ( protocol == FLASH_MKII )
|
||||
usb_switch_to_update(dev->usb);
|
||||
return -EAGAIN;
|
||||
} else if ( protocol == FLASH_MKII ) {
|
||||
if ( dev->usb->data & (1 << image->type) )
|
||||
return mkii_flash_image(dev->usb, image);
|
||||
}
|
||||
|
||||
usb_switch_to_nolo(dev->usb);
|
||||
return -EAGAIN;
|
||||
|
||||
Reference in new issue
Block a user