diff mbox

[U-Boot,3/8] cmd_sf: Use mtd->size instead of flash->size

Message ID 1444679655-30349-3-git-send-email-jteki@openedev.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki Oct. 12, 2015, 7:54 p.m. UTC
Since mtd got added, replace flash->size with mtd->size.

Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 common/cmd_sf.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Heiko Schocher Oct. 29, 2015, 6:32 a.m. UTC | #1
Hello Jagan,

Am 12.10.2015 um 21:54 schrieb Jagan Teki:
> Since mtd got added, replace flash->size with mtd->size.
>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
>   common/cmd_sf.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/common/cmd_sf.c b/common/cmd_sf.c
> index ac7f5df..a501376 100644
> --- a/common/cmd_sf.c
> +++ b/common/cmd_sf.c
> @@ -275,13 +275,13 @@ static int do_spi_flash_read_write(int argc, char * const argv[])
>   		return -1;
>
>   	if (mtd_arg_off_size(argc - 2, &argv[2], &dev, &offset, &len,
> -			     &maxsize, MTD_DEV_TYPE_NOR, flash->size))
> +			     &maxsize, MTD_DEV_TYPE_NOR, flash->mtd->size))
>   		return -1;
>
>   	/* Consistency checking */
> -	if (offset + len > flash->size) {
> -		printf("ERROR: attempting %s past flash size (%#x)\n",
> -		       argv[0], flash->size);
> +	if (offset + len > flash->mtd->size) {
> +		printf("ERROR: attempting %s past flash size (0x%llx)\n",
> +		       argv[0], flash->mtd->size);
>   		return 1;
>   	}
>
> @@ -327,7 +327,7 @@ static int do_spi_flash_erase(int argc, char * const argv[])
>   		return -1;
>
>   	if (mtd_arg_off(argv[1], &dev, &offset, &len, &maxsize,
> -			MTD_DEV_TYPE_NOR, flash->size))
> +			MTD_DEV_TYPE_NOR, flash->mtd->size))
>   		return -1;
>
>   	ret = sf_parse_len_arg(argv[2], &size);
> @@ -335,9 +335,9 @@ static int do_spi_flash_erase(int argc, char * const argv[])
>   		return -1;
>
>   	/* Consistency checking */
> -	if (offset + size > flash->size) {
> -		printf("ERROR: attempting %s past flash size (%#x)\n",
> -		       argv[0], flash->size);
> +	if (offset + size > flash->mtd->size) {
> +		printf("ERROR: attempting %s past flash size (0x%llx)\n",
> +		       argv[0], flash->mtd->size);
>   		return 1;
>   	}
>
>
diff mbox

Patch

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index ac7f5df..a501376 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -275,13 +275,13 @@  static int do_spi_flash_read_write(int argc, char * const argv[])
 		return -1;
 
 	if (mtd_arg_off_size(argc - 2, &argv[2], &dev, &offset, &len,
-			     &maxsize, MTD_DEV_TYPE_NOR, flash->size))
+			     &maxsize, MTD_DEV_TYPE_NOR, flash->mtd->size))
 		return -1;
 
 	/* Consistency checking */
-	if (offset + len > flash->size) {
-		printf("ERROR: attempting %s past flash size (%#x)\n",
-		       argv[0], flash->size);
+	if (offset + len > flash->mtd->size) {
+		printf("ERROR: attempting %s past flash size (0x%llx)\n",
+		       argv[0], flash->mtd->size);
 		return 1;
 	}
 
@@ -327,7 +327,7 @@  static int do_spi_flash_erase(int argc, char * const argv[])
 		return -1;
 
 	if (mtd_arg_off(argv[1], &dev, &offset, &len, &maxsize,
-			MTD_DEV_TYPE_NOR, flash->size))
+			MTD_DEV_TYPE_NOR, flash->mtd->size))
 		return -1;
 
 	ret = sf_parse_len_arg(argv[2], &size);
@@ -335,9 +335,9 @@  static int do_spi_flash_erase(int argc, char * const argv[])
 		return -1;
 
 	/* Consistency checking */
-	if (offset + size > flash->size) {
-		printf("ERROR: attempting %s past flash size (%#x)\n",
-		       argv[0], flash->size);
+	if (offset + size > flash->mtd->size) {
+		printf("ERROR: attempting %s past flash size (0x%llx)\n",
+		       argv[0], flash->mtd->size);
 		return 1;
 	}