public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot]  [PATCH]: common/cmd_flash.c: bug-fix
@ 2010-02-12  8:31 Teh Kok How
  2010-02-12  9:00 ` Stefan Roese
  2010-02-12  9:16 ` Teh Kok How
  0 siblings, 2 replies; 9+ messages in thread
From: Teh Kok How @ 2010-02-12  8:31 UTC (permalink / raw)
  To: u-boot

--- 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];

 

        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)) {

+        sprintf(mtd_dev, "%s%d", MTD_DEV_TYPE(current_mtd_dev->id->type),
current_mtd_dev->id->num);

+       if ((argc == 2) && (mtd_id_parse(mtd_dev, NULL, &dev_type, &dev_num)
== 0)) {

                mtdparts_init();

                if (find_dev_and_part(argv[1], &dev, &pnum, &part) == 0) {

                        if (dev->id->type == MTD_DEV_TYPE_NOR) {

@@ -481,6 +484,7 @@

 #endif

        int p;

        int rcode = 0;

+       char mtd_dev[10];

 

        if (argc < 3) {

                cmd_usage(cmdtp);

@@ -567,7 +571,8 @@

 

 #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)

        /* protect on/off <part-id> */

-       if ((argc == 3) && (mtd_id_parse(argv[2], NULL, &dev_type, &dev_num)
== 0)) {

+        sprintf(mtd_dev, "%s%d", MTD_DEV_TYPE(current_mtd_dev->id->type),
current_mtd_dev->id->num);

+       if ((argc == 3) && (mtd_id_parse(mtd_dev, NULL, &dev_type, &dev_num)
== 0)) {

                mtdparts_init();

                if (find_dev_and_part(argv[2], &dev, &pnum, &part) == 0) {

                        if (dev->id->type == MTD_DEV_TYPE_NOR) {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-22  8:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12  8:31 [U-Boot] [PATCH]: common/cmd_flash.c: bug-fix Teh Kok How
2010-02-12  9:00 ` Stefan Roese
2010-02-12  9:16 ` Teh Kok How
2010-02-12 10:19   ` Stefan Roese
2010-02-12 10:35   ` [U-Boot] [PATCH]: common/cmd_flash.c: Fix mtdparts usage in "erase" and "protect" Teh Kok How
2010-02-12 15:32     ` Wolfgang Denk
2010-02-12 15:27   ` [U-Boot] [PATCH]: common/cmd_flash.c: bug-fix Wolfgang Denk
2010-02-22  5:36     ` Teh Kok How
2010-02-22  8:28       ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox