[PATCH] [MTD] cs553x_nand.c: support partitions, cs553x_cleanup() fix (take 2)

David Woodhouse dwmw2 at infradead.org
Fri Feb 9 09:14:28 EST 2007


On Thu, 2007-01-04 at 19:41 +0200, Indrek Kruusa wrote:
> @@ -186,6 +189,7 @@
>         int err = 0;
>         struct nand_chip *this;
>         struct mtd_info *new_mtd;
> +       char mtd_name[16] = "cs553x_nand_csX\0";
>  
>         printk(KERN_NOTICE "Probing CS553x NAND controller CS#%d at %sIO 0x%08lx\n", cs, mmio?"MM":"P", adr);
>  
> @@ -245,6 +249,9 @@
>                 goto out_ior;
>         }
>  
> +       mtd_name[14] = (char)(48 + cs);
> +       new_mtd->name = (char*)mtd_name;
> +
>         cs553x_mtd[cs] = new_mtd;
>         goto out;
>  
> @@ -273,12 +280,21 @@ 

Then they just end up all pointing to the same original memory. Don't
you need to allocate and strcpy?

-- 
dwmw2





More information about the linux-mtd mailing list