Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
[MTD] [NAND] cs553x_nand: command line partitioning support

+28 -3
+28 -3
drivers/mtd/nand/cs553x_nand.c
··· 13 13 * Overview: 14 14 * This is a device driver for the NAND flash controller found on 15 15 * the AMD CS5535/CS5536 companion chipsets for the Geode processor. 16 + * mtd-id for command line partitioning is cs553x_nand_cs[0-3] 17 + * where 0-3 reflects the chip select for NAND. 16 18 * 17 19 */ 18 20 21 + #include <linux/kernel.h> 19 22 #include <linux/slab.h> 20 23 #include <linux/init.h> 21 24 #include <linux/module.h> ··· 247 244 goto out_ior; 248 245 } 249 246 247 + new_mtd->name = kasprintf(GFP_KERNEL, "cs553x_nand_cs%d", cs); 248 + 250 249 cs553x_mtd[cs] = new_mtd; 251 250 goto out; 252 251 ··· 277 272 return 0; 278 273 } 279 274 275 + 276 + #ifdef CONFIG_MTD_PARTITIONS 277 + const char *part_probes[] = { "cmdlinepart", NULL }; 278 + #endif 279 + 280 + 280 281 static int __init cs553x_init(void) 281 282 { 282 283 int err = -ENXIO; 283 284 int i; 284 285 uint64_t val; 286 + 287 + int mtd_parts_nb = 0; 288 + struct mtd_partition *mtd_parts = NULL; 285 289 286 290 /* If the CPU isn't a Geode GX or LX, abort */ 287 291 if (!is_geode()) ··· 304 290 305 291 /* If it doesn't have the NAND controller enabled, abort */ 306 292 rdmsrl(MSR_DIVIL_BALL_OPTS, val); 307 - if (val & 1) { 293 + if (val & PIN_OPT_IDE) { 308 294 printk(KERN_INFO "CS553x NAND controller: Flash I/O not enabled in MSR_DIVIL_BALL_OPTS.\n"); 309 295 return -ENXIO; 310 296 } ··· 320 306 do mtdconcat etc. if we want to. */ 321 307 for (i = 0; i < NR_CS553X_CONTROLLERS; i++) { 322 308 if (cs553x_mtd[i]) { 323 - add_mtd_device(cs553x_mtd[i]); 324 309 325 310 /* If any devices registered, return success. Else the last error. */ 311 + #ifdef CONFIG_MTD_PARTITIONS 312 + mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0); 313 + if (mtd_parts_nb > 0) { 314 + printk(KERN_NOTICE "Using command line partition definition\n"); 315 + add_mtd_partitions(cs553x_mtd[i], mtd_parts, mtd_parts_nb); 316 + } else { 317 + add_mtd_device(cs553x_mtd[i]); 318 + } 319 + #else 320 + add_mtd_device(cs553x_mtd[i]); 321 + #endif 326 322 err = 0; 327 323 } 328 324 } ··· 352 328 void __iomem *mmio_base; 353 329 354 330 if (!mtd) 355 - break; 331 + continue; 356 332 357 333 this = cs553x_mtd[i]->priv; 358 334 mmio_base = this->IO_ADDR_R; 359 335 360 336 /* Release resources, unregister device */ 361 337 nand_release(cs553x_mtd[i]); 338 + kfree(cs553x_mtd[i]->name); 362 339 cs553x_mtd[i] = NULL; 363 340 364 341 /* unmap physical address */