diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2018-02-08 19:24:11 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2018-02-08 19:24:11 +0100 |
commit | e685787e67c431579f8e2cf717a19174f154fe6c (patch) | |
tree | e47d33e60b83f5fb1bde595714dd5ad1e81cd66f | |
parent | 10b495120e17bb7aeaf24c76db4d291bedb14dc8 (diff) | |
download | 0xFFFF-e685787e67c431579f8e2cf717a19174f154fe6c.tar.bz2 |
disk: Ensure that maj1:min1 is first device and maj2:min2 is second device
-rw-r--r-- | src/disk.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -304,6 +304,7 @@ int disk_init(struct usb_device_info * dev) { int maj2; int min1; int min2; + int tmp; maj1 = -1; maj2 = -1; @@ -390,6 +391,16 @@ int disk_init(struct usb_device_info * dev) { return -1; } + /* Ensure that maj1:min1 is first device and maj2:min2 is second device */ + if ( min2 < min1 ) { + tmp = min1; + min1 = min2; + min2 = tmp; + tmp = maj1; + maj1 = maj2; + maj2 = tmp; + } + /* TODO: change 1 to 0 when disk_flash_dev will be implemented */ /* RX-51 and RM-680 export MyDocs in first usb device and just first partion, so host system see whole device without MBR table */ |