diff options
author | Winter Wang <wente.wang@nxp.com> | 2016-11-10 18:33:01 +0800 |
---|---|---|
committer | Winter Wang <wente.wang@nxp.com> | 2016-11-15 13:40:13 +0800 |
commit | 4dc08994529ceafac7202a2be8cd629d901a0869 (patch) | |
tree | 4639866ca916cd5294fde0a36521a6772dea1f7b /drivers/usb/gadget | |
parent | 95afd19ca88891e0ad1661c5994816e5237bf7d5 (diff) | |
download | u-boot-imx-4dc08994529ceafac7202a2be8cd629d901a0869.zip u-boot-imx-4dc08994529ceafac7202a2be8cd629d901a0869.tar.gz u-boot-imx-4dc08994529ceafac7202a2be8cd629d901a0869.tar.bz2 |
MA-8984-2 fastboot: move partition_table_valid to f_fastboot.c
better move partition_table_valid to f_fastboot as it's
not related with lock/unlock function.
Signed-off-by: Winter Wang <wente.wang@nxp.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/fastboot_lock_unlock.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/fastboot_lock_unlock.h | 2 |
3 files changed, 13 insertions, 15 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index f6694dd..8f856b6 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -2669,6 +2669,19 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req) #endif +static int partition_table_valid(void) +{ + int status, mmc_no; + block_dev_desc_t *dev_desc; + disk_partition_t info; + + mmc_no = fastboot_devinfo.dev_id; + dev_desc = get_dev("mmc", mmc_no); + + status = get_partition_info(dev_desc, 1, &info); + + return (status == 0); +} #ifdef CONFIG_FASTBOOT_FLASH static void cb_flash(struct usb_ep *ep, struct usb_request *req) diff --git a/drivers/usb/gadget/fastboot_lock_unlock.c b/drivers/usb/gadget/fastboot_lock_unlock.c index 65184d9..4514bd0 100644 --- a/drivers/usb/gadget/fastboot_lock_unlock.c +++ b/drivers/usb/gadget/fastboot_lock_unlock.c @@ -366,16 +366,3 @@ int fastboot_wipe_data_partition(void) return 0; } - -int partition_table_valid(void) -{ - int status; - block_dev_desc_t *fs_dev_desc; - disk_partition_t fs_partition; - - status = get_device_and_partition(FSL_FASTBOOT_FB_DEV, - get_mmc_part(FSL_FASTBOOT_FB_PART_NUM), - &fs_dev_desc, &fs_partition, 1); - - return (status < 0) ? 0 : 1; -} diff --git a/drivers/usb/gadget/fastboot_lock_unlock.h b/drivers/usb/gadget/fastboot_lock_unlock.h index a75b440..941e1be 100644 --- a/drivers/usb/gadget/fastboot_lock_unlock.h +++ b/drivers/usb/gadget/fastboot_lock_unlock.h @@ -65,6 +65,4 @@ unsigned char fastboot_lock_enable(void); int display_lock(int lock, int verify); -int partition_table_valid(void); - #endif |