* [PATCH 1/3] mtd: FSMC NAND remove PARTITION macro and fix compile noise
@ 2010-11-29 12:52 Linus Walleij
2010-12-02 3:31 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2010-11-29 12:52 UTC (permalink / raw)
To: linux-arm-kernel
This removes the PARTITION macro that David didn't like and also
removes a local variable that was dangling unused in some #ifdefs
by being a bit more clever.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
drivers/mtd/nand/fsmc_nand.c | 66 ++++++++++++++++++++++++++++++-----------
1 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 02edfba..5af4b3c 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -119,21 +119,36 @@ static struct fsmc_eccplace fsmc_ecc4_sp_place = {
}
};
-/*
- * Default partition tables to be used if the partition information not
- * provided through platform data
- */
-#define PARTITION(n, off, sz) {.name = n, .offset = off, .size = sz}
+#ifdef CONFIG_MTD_PARTITIONS
/*
+ * Default partition tables to be used if the partition information not
+ * provided through platform data.
+ *
* Default partition layout for small page(= 512 bytes) devices
* Size for "Root file system" is updated in driver based on actual device size
*/
static struct mtd_partition partition_info_16KB_blk[] = {
- PARTITION("X-loader", 0, 4 * 0x4000),
- PARTITION("U-Boot", 0x10000, 20 * 0x4000),
- PARTITION("Kernel", 0x60000, 256 * 0x4000),
- PARTITION("Root File System", 0x460000, 0),
+ {
+ .name = "X-loader",
+ .offset = 0,
+ .size = 4*0x4000,
+ },
+ {
+ .name = "U-Boot",
+ .offset = 0x10000,
+ .size = 20*0x4000,
+ },
+ {
+ .name = "Kernel",
+ .offset = 0x60000,
+ .size = 256*0x4000,
+ },
+ {
+ .name = "Root File System",
+ .offset = 0x460000,
+ .size = 0,
+ },
};
/*
@@ -141,15 +156,32 @@ static struct mtd_partition partition_info_16KB_blk[] = {
* Size for "Root file system" is updated in driver based on actual device size
*/
static struct mtd_partition partition_info_128KB_blk[] = {
- PARTITION("X-loader", 0, 4 * 0x20000),
- PARTITION("U-Boot", 0x80000, 12 * 0x20000),
- PARTITION("Kernel", 0x200000, 48 * 0x20000),
- PARTITION("Root File System", 0x800000, 0),
+ {
+ .name = "X-loader",
+ .offset = 0,
+ .size = 4*0x20000,
+ },
+ {
+ .name = "U-Boot",
+ .offset = 0x80000,
+ .size = 12*0x20000,
+ },
+ {
+ .name = "Kernel",
+ .offset = 0x200000,
+ .size = 48*0x20000,
+ },
+ {
+ .name = "Root File System",
+ .offset = 0x800000,
+ .size = 0,
+ },
};
#ifdef CONFIG_MTD_CMDLINE_PARTS
const char *part_probes[] = { "cmdlinepart", NULL };
#endif
+#endif
/**
* struct fsmc_nand_data - atructure for FSMC NAND device state
@@ -508,7 +540,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
struct nand_chip *nand;
struct fsmc_regs *regs;
struct resource *res;
- int nr_parts, ret = 0;
+ int ret = 0;
if (!pdata) {
dev_err(&pdev->dev, "platform data is NULL\n");
@@ -676,11 +708,9 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
* Check if partition info passed via command line
*/
host->mtd.name = "nand";
- nr_parts = parse_mtd_partitions(&host->mtd, part_probes,
+ host->nr_partitions = parse_mtd_partitions(&host->mtd, part_probes,
&host->partitions, 0);
- if (nr_parts > 0) {
- host->nr_partitions = nr_parts;
- } else {
+ if (host->nr_partitions <= 0) {
#endif
/*
* Check if partition info passed via command line
--
1.7.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 1/3] mtd: FSMC NAND remove PARTITION macro and fix compile noise
2010-11-29 12:52 [PATCH 1/3] mtd: FSMC NAND remove PARTITION macro and fix compile noise Linus Walleij
@ 2010-12-02 3:31 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-12-02 3:31 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-11-29 at 13:52 +0100, Linus Walleij wrote:
> This removes the PARTITION macro that David didn't like and also
> removes a local variable that was dangling unused in some #ifdefs
> by being a bit more clever.
>
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Pushed this to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (???????? ?????)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-02 3:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29 12:52 [PATCH 1/3] mtd: FSMC NAND remove PARTITION macro and fix compile noise Linus Walleij
2010-12-02 3:31 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).