* PATCH - add cmdline partition support to cafe (eg mtdparts= boot command)
@ 2008-10-01 21:00 Philip Rakity
2008-10-08 12:34 ` Josh Boyer
0 siblings, 1 reply; 2+ messages in thread
From: Philip Rakity @ 2008-10-01 21:00 UTC (permalink / raw)
To: linux-mtd
Folks,
Could we please incorporate this info the main line linux code. Adds command line mtdparts= support for cafe_nand flash.
NOTE: I changed where add_mtd_device was done so that there is NOT a complete flash mount point following by the partitions that were added. Before this n+1 partitions were added. 1 partition for the complete flash and then n partitions.
Philip
--- cafe_nand.c.ORIGINAL 2008-10-01 13:53:11.000000000 -0700
+++ cafe_nand.c 2008-10-01 13:55:01.000000000 -0700
@@ -87,8 +87,12 @@
module_param_array(timing, int, &numtimings, 0644);
#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
+#else
static const char *part_probes[] = { "RedBoot", NULL };
#endif
+#endif
/* Hrm. Why isn't this already conditional on something in the struct device? */
#define cafe_dev_dbg(dev, args...) do { if (debug) dev_dbg(dev, ##args); } while(0)
@@ -628,7 +632,7 @@
struct cafe_priv *cafe;
struct mtd_partition *parts;
uint32_t ctrl;
- int nr_parts;
+ int nr_parts = 0;
int err = 0;
/* Very old versions shared the same PCI ident for all three
@@ -796,17 +800,21 @@
pci_set_drvdata(pdev, mtd);
- /* We register the whole device first, separate from the partitions */
- add_mtd_device(mtd);
-
#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+ mtd->name = "cafe_nand";
+#endif
nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
if (nr_parts > 0) {
cafe->parts = parts;
- dev_info(&cafe->pdev->dev, "%d RedBoot partitions found\n", nr_parts);
+ dev_info(&cafe->pdev->dev, "%d partitions found\n", nr_parts);
add_mtd_partitions(mtd, parts, nr_parts);
}
#endif
+
+ /* We register the whole device first, separate from the partitions */
+ if (nr_parts <= 0)
+ add_mtd_device(mtd);
goto out;
Signed off by Philip Rakity -- October 1, 2008
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH - add cmdline partition support to cafe (eg mtdparts= boot command)
2008-10-01 21:00 PATCH - add cmdline partition support to cafe (eg mtdparts= boot command) Philip Rakity
@ 2008-10-08 12:34 ` Josh Boyer
0 siblings, 0 replies; 2+ messages in thread
From: Josh Boyer @ 2008-10-08 12:34 UTC (permalink / raw)
To: Philip Rakity; +Cc: linux-mtd
On Wed, Oct 01, 2008 at 02:00:51PM -0700, Philip Rakity wrote:
>Folks,
>
>Could we please incorporate this info the main line linux code. Adds command line mtdparts= support for cafe_nand flash.
>
>NOTE: I changed where add_mtd_device was done so that there is NOT a complete flash mount point following by the partitions that were added. Before this n+1 partitions were added. 1 partition for the complete flash and then n partitions.
You need to add a proper Signed-off-by line to your patch before
it can be included. Read Documenation/SubmittingPatches in the
kernel tree.
josh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-08 12:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01 21:00 PATCH - add cmdline partition support to cafe (eg mtdparts= boot command) Philip Rakity
2008-10-08 12:34 ` Josh Boyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox