[U-Boot-Users] [PATCH] Fix duplicated flash state

Kyungmin Park kmpark at infradead.org
Fri Jul 25 01:31:11 CEST 2008


On Thu, Jul 24, 2008 at 4:43 PM, Fathi Boudra <fboudra at gmail.com> wrote:
> On Tue, Jul 22, 2008 at 10:09 AM, Kyungmin Park <kmpark at infradead.org>
> wrote:
>>
>> Move to one place
>> I just compiled test. Please check other NAND users.
>>
>
> It fails to build, redefinition of id:
> jffs2_1pass.c: In function 'put_fl_mem':
> jffs2_1pass.c:466: error: redefinition of 'id'
> jffs2_1pass.c:459: error: previous definition of 'id' was here
>
> Relevant piece of code:
>
> static inline void put_fl_mem(void *buf)
> {
> #if defined(CONFIG_JFFS2_NAND) && \
>     defined(CONFIG_CMD_NAND)
>     struct mtdids *id = current_part->dev->id;
>
>     if (id->type == MTD_DEV_TYPE_NAND)
>         return put_fl_mem_nand(buf);
> #endif
>
> #if defined(CONFIG_CMD_ONENAND)
>     struct mtdids *id = current_part->dev->id;
>
>     if (id->type == MTD_DEV_TYPE_ONENAND)
>         return put_fl_mem_onenand(buf);
> #endif
> }
>

It's not this patch contents.
I'ts related with the previous patch "JFFS2 support on OneNAND"
Anyway, it should be below.

 static inline void put_fl_mem(void *buf)
 {
-#if defined(CONFIG_JFFS2_NAND) && \
-    defined(CONFIG_CMD_NAND)
+#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || \
+    defined(CONFIG_CMD_ONENAND)
        struct mtdids *id = current_part->dev->id;
+#endif

+#if defined(CONFIG_JFFS2_NAND) && \
+    defined(CONFIG_CMD_NAND)
        if (id->type == MTD_DEV_TYPE_NAND)
                return put_fl_mem_nand(buf);
 #endif
+
+#if defined(CONFIG_CMD_ONENAND)
+       if (id->type == MTD_DEV_TYPE_ONENAND)
+               return put_fl_mem_onenand(buf);
+#endif

Next time it will be clean-uped with next patches.

Thank you,
Kyungmin Park




More information about the U-Boot mailing list