Commit ea315a69 authored by Haojian Zhuang's avatar Haojian Zhuang
Browse files

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: default avatarHaojian Zhuang <haojian.zhuang@linaro.org>
parent e74dc940
...@@ -481,7 +481,7 @@ static int mmc_enumerate(unsigned int clk, unsigned int bus_width) ...@@ -481,7 +481,7 @@ static int mmc_enumerate(unsigned int clk, unsigned int bus_width)
return mmc_set_ios(clk, 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; int ret;
unsigned int cmd_idx, cmd_arg; unsigned int cmd_idx, cmd_arg;
...@@ -548,7 +548,7 @@ size_t mmc_read_blocks(unsigned int lba, uintptr_t buf, size_t size) ...@@ -548,7 +548,7 @@ size_t mmc_read_blocks(unsigned int lba, uintptr_t buf, size_t size)
return 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; int ret;
unsigned int cmd_idx, cmd_arg; 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) ...@@ -615,7 +615,7 @@ size_t mmc_write_blocks(unsigned int lba, const uintptr_t buf, size_t size)
return 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; int ret;
...@@ -661,7 +661,7 @@ static inline void mmc_rpmb_disable(void) ...@@ -661,7 +661,7 @@ static inline void mmc_rpmb_disable(void)
PART_CFG_BOOT_PARTITION1_ENABLE); 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; size_t size_read;
...@@ -672,7 +672,7 @@ size_t mmc_rpmb_read_blocks(unsigned int lba, uintptr_t buf, size_t size) ...@@ -672,7 +672,7 @@ size_t mmc_rpmb_read_blocks(unsigned int lba, uintptr_t buf, size_t size)
return size_read; 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; size_t size_written;
...@@ -683,7 +683,7 @@ size_t mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, size_t size) ...@@ -683,7 +683,7 @@ size_t mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, size_t size)
return size_written; 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; size_t size_erased;
......
...@@ -208,13 +208,12 @@ struct mmc_device_info { ...@@ -208,13 +208,12 @@ struct mmc_device_info {
enum mmc_device_type mmc_dev_type; /* Type of MMC */ 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_read_blocks(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_write_blocks(int lba, const uintptr_t buf, size_t size);
size_t mmc_erase_blocks(unsigned int lba, size_t size); size_t mmc_erase_blocks(int lba, size_t size);
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 mmc_rpmb_write_blocks(unsigned int lba, const uintptr_t buf, size_t mmc_rpmb_write_blocks(int lba, const uintptr_t buf, size_t size);
size_t size); size_t mmc_rpmb_erase_blocks(int lba, size_t size);
size_t mmc_rpmb_erase_blocks(unsigned int lba, size_t size);
int mmc_init(const struct mmc_ops *ops_ptr, unsigned int clk, int mmc_init(const struct mmc_ops *ops_ptr, unsigned int clk,
unsigned int width, unsigned int flags, unsigned int width, unsigned int flags,
struct mmc_device_info *device_info); struct mmc_device_info *device_info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment