From 06ceaec8fd957e6be955431d695e8752ca10ac47 Mon Sep 17 00:00:00 2001 From: Pavithra Palanisamy Date: Mon, 8 Jul 2019 11:47:20 +0530 Subject: [PATCH] usbdump: Add support to scan maximum possible partitions This change adds support to search for valid FAT32 partition throughout the device during crashdump collection on USB, despite encountering any invalid-partition on the loop. Change-Id: Ic6bda03a2448c38f0e93d32214340c2ee896f385 Signed-off-by: Pavithra Palanisamy --- board/qca/arm/common/crashdump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/board/qca/arm/common/crashdump.c b/board/qca/arm/common/crashdump.c index 5d29ab5b6c..300348e311 100644 --- a/board/qca/arm/common/crashdump.c +++ b/board/qca/arm/common/crashdump.c @@ -402,7 +402,8 @@ static int do_dumpqca_data(unsigned int dump_level) #if defined(CONFIG_USB_STORAGE) && defined(CONFIG_FS_FAT) static block_dev_desc_t *stor_dev; disk_partition_t info; - int dev_indx, part_indx, max_dev_avail = 0, part = -1; + int dev_indx, max_dev_avail = 0; + int part_indx = 0, part = -1; int fat_fs = 0; char dev_str[3]; //dev_str = dev:part @@ -426,10 +427,6 @@ static int do_dumpqca_data(unsigned int dump_level) snprintf(dev_str, sizeof(dev_str)+1, "%d:%d", dev_indx, part_indx); part = get_device_and_partition("usb", dev_str, &stor_dev, &info, 1); - if (part < 0) { - printf("No valid partition available for device %d\n", dev_indx); - break; - } if (fat_set_blk_dev(stor_dev, &info) == 0) { fat_fs = 1; @@ -438,6 +435,9 @@ static int do_dumpqca_data(unsigned int dump_level) break; } } + + if (part < 0) + printf("No valid partition available for device %d\n", dev_indx); } if (fat_fs == 1)