[PATCH] [MTD] cs553x_nand.c: support partitions; cs553x_cleanup() fix

Josh Boyer jwboyer at linux.vnet.ibm.com
Tue Jan 2 09:40:58 EST 2007


On Tue, 2007-01-02 at 16:21 +0200, Indrek Kruusa wrote:
> Hi!
> 
> Patch for drivers/mtd/nand/cs553x_nand.c:
> - support partitions
> - cs553x_cleanup(): try the cleanup for all chip selects

Some small nit picks.

> 
> Signed-off-by: Indrek Kruusa <indrek.kruusa at artecdesign.ee>
> 
> 
> --- cs553x_nand.c_git	2007-01-02 15:13:06.000000000 +0200
> +++ cs553x_nand.c	2007-01-02 15:45:38.000000000 +0200

Patches should have a strip level of 1.

> @@ -273,12 +273,21 @@
>  	return 0;
>  }
> 
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> +const char *part_probes[] = { "cmdlinepart", NULL };
> +#endif
> +
> +
>  static int __init cs553x_init(void)
>  {
>  	int err = -ENXIO;
>  	int i;
>  	uint64_t val;
> 
> +	int mtd_parts_nb = 0;
> +	struct mtd_partition *mtd_parts = 0;

Pointers should be initialized with NULL.  Otherwise sparse will
complain.

> +
>  	/* If the CPU isn't a Geode GX or LX, abort */
>  	if (!is_geode())
>  		return -ENXIO;
> @@ -307,9 +316,20 @@
>  	   do mtdconcat etc. if we want to. */
>  	for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
>  		if (cs553x_mtd[i]) {
> -			add_mtd_device(cs553x_mtd[i]);
> 
>  			/* If any devices registered, return success. Else the last error. */
> +#ifdef CONFIG_MTD_PARTITIONS
> +			cs553x_mtd[i]->name = "cs553x_nand";

You assign the same name to all the devices?

josh





More information about the linux-mtd mailing list