From ea315a69de68a664d774c68088b0e4f48b1303e1 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Thu, 2 Aug 2018 14:49:51 +0800 Subject: [PATCH] drivers/mmc: fix lba param to int mmc_read_blocks()/mmc_write_blocks() derived from io_block_ops_t type. It means that lba param should be integer type, not unsigned integer type. Signed-off-by: Haojian Zhuang --- drivers/mmc/mmc.c | 12 ++++++------ include/drivers/mmc.h | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index c8eac26b..dfd3d989 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -481,7 +481,7 @@ static int mmc_enumerate(unsigned int clk, unsigned int bus_width) return mmc_set_ios(clk, bus_width); } -size_t mmc_read_blocks(unsigned int lba, uintptr_t buf, size_t size) +size_t mmc_read_blocks(int lba, uintptr_t buf, size_t size) { int ret; unsigned int cmd_idx, cmd_arg; @@ -548,7 +548,7 @@ size_t mmc_read_blocks(unsigned int lba, uintptr_t buf, size_t size) return size; } -size_t mmc_write_blocks(unsigned int lba, const uintptr_t buf, size_t size) +size_t mmc_write_blocks(int lba, const uintptr_t buf, size_t size) { int ret; unsigned int cmd_idx, cmd_arg; @@ -615,7 +615,7 @@ size_t mmc_write_blocks(unsigned int lba, const uintptr_t buf, size_t size) return size; } -size_t mmc_erase_blocks(unsigned int lba, size_t size) +size_t mmc_erase_blocks(int lba, size_t size) { int ret; @@ -661,7 +661,7 @@ static inline void mmc_rpmb_disable(void) PART_CFG_BOOT_PARTITION1_ENABLE); } -size_t mmc_rpmb_read_blocks(unsigned int lba, uintptr_t buf, size_t size) +size_t mmc_rpmb_read_blocks(int lba, uintptr_t buf, size_t size) { size_t size_read; @@ -672,7 +672,7 @@ size_t mmc_rpmb_read_blocks(unsigned int lba, uintptr_t buf, size_t size) return size_read; } -size_t mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, size_t size) +size_t mmc_rpmb_write_blocks(int lba, const uintptr_t buf, size_t size) { size_t size_written; @@ -683,7 +683,7 @@ size_t mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, size_t size) return size_written; } -size_t mmc_rpmb_erase_blocks(unsigned int lba, size_t size) +size_t mmc_rpmb_erase_blocks(int lba, size_t size) { size_t size_erased; diff --git a/include/drivers/mmc.h b/include/drivers/mmc.h index 65f4bbdc..0a513bd6 100644 --- a/include/drivers/mmc.h +++ b/include/drivers/mmc.h @@ -208,13 +208,12 @@ struct mmc_device_info { enum mmc_device_type mmc_dev_type; /* Type of MMC */ }; -size_t mmc_read_blocks(unsigned int lba, uintptr_t buf, size_t size); -size_t mmc_write_blocks(unsigned int lba, const uintptr_t buf, size_t size); -size_t mmc_erase_blocks(unsigned int lba, size_t size); -size_t mmc_rpmb_read_blocks(unsigned int lba, uintptr_t buf, size_t size); -size_t mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, - size_t size); -size_t mmc_rpmb_erase_blocks(unsigned int lba, size_t size); +size_t mmc_read_blocks(int lba, uintptr_t buf, size_t size); +size_t mmc_write_blocks(int lba, const uintptr_t buf, size_t size); +size_t mmc_erase_blocks(int lba, size_t size); +size_t mmc_rpmb_read_blocks(int lba, uintptr_t buf, size_t size); +size_t mmc_rpmb_write_blocks(int lba, const uintptr_t buf, size_t size); +size_t mmc_rpmb_erase_blocks(int lba, size_t size); int mmc_init(const struct mmc_ops *ops_ptr, unsigned int clk, unsigned int width, unsigned int flags, struct mmc_device_info *device_info); -- 2.30.2