[U-Boot] [PATCH]: common/cmd_flash.c: Fix mtdparts usage in "erase" and "protect"

Wolfgang Denk wd at denx.de
Fri Feb 12 16:32:07 CET 2010


Dear "Teh Kok How",

In message <9BAE6A5E771E47C99977F5057F7B300A at smartbridges.com> you wrote:
> Fixes wrong argument to mtd_id_parse that affects u-boot command `erase`
> and `protect` <part-id>. This fix passes the correct part-id to the commands
> so that `erase rootfs` and `protect rootfs` work.
> 
> 
> Signed-off-by: Kok How, Teh <k_h_teh at yahoo.com>
> --- u-boot-2009.11.1.orig/common/cmd_flash.c    2010-01-25
> 16:35:12.000000000 +0800
> +++ u-boot-2009.11.1.new/common/cmd_flash.c     2010-02-12
> 16:18:10.565540182 +0800
> @@ -43,6 +43,7 @@
> 
>  #ifndef CONFIG_SYS_NO_FLASH
>  extern flash_info_t flash_info[];      /* info for FLASH chips */
> +extern struct mtd_device *current_mtd_dev;
> 
>  /*
>   * The user interface starts numbering for Flash banks with 1
> @@ -331,6 +332,7 @@
>         u8 dev_type, dev_num, pnum;
>  #endif
>         int rcode = 0;
> +       char mtd_dev[10];

I already asked: wher eis this magic constant coming from?

>         if (argc < 2) {
>                 cmd_usage(cmdtp);
> @@ -359,7 +361,8 @@
> 
>  #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
>         /* erase <part-id> - erase partition */
> -       if ((argc == 2) && (mtd_id_parse(argv[1], NULL, &dev_type, &dev_num)
> == 0)) {

This is still line wrapped.

Please read http://kerneltrap.org/Linux/Email_Clients_and_Patches and
fix your mailer configuration before reposting.

Also, consider using git-format-patch to create the patch, and using
git-send-email to send it.



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Until you walk a mile in another man's moccasins, you  can't  imagine
the smell.


More information about the U-Boot mailing list