From: Jamie Iles <jamie@jamieiles.com>
To: linux-mtd@lists.infradead.org
Cc: Jamie Iles <jamie@jamieiles.com>,
dwmw2@infradead.org, chuanxiao.dong@intel.com
Subject: [RFC PATCH 9/9] nand/denali: support MTD partitioning
Date: Fri, 6 May 2011 15:29:03 +0100 [thread overview]
Message-ID: <1304692143-22432-10-git-send-email-jamie@jamieiles.com> (raw)
In-Reply-To: <1304692143-22432-1-git-send-email-jamie@jamieiles.com>
If CONFIG_MTD_PARTITION is enabled then take the partitions from the
platform data.
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
drivers/mtd/nand/denali.c | 8 ++++++++
include/linux/platform_data/denali.h | 6 +++++-
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index c79009f..ae954de 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -23,6 +23,7 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
#include <linux/module.h>
#include <linux/platform_data/denali.h>
@@ -1563,7 +1564,14 @@ int denali_init(struct denali_nand_info *denali)
goto failed_req_irq;
}
+#ifdef CONFIG_MTD_PARTITIONS
+ if (pdata && pdata->parts) {
+ ret = add_mtd_partitions(&denali->mtd, pdata->parts,
+ pdata->nr_parts);
+ } else
+#endif /* CONFIG_MTD_PARTITIONS */
ret = add_mtd_device(&denali->mtd);
+
if (ret) {
dev_err(denali->dev, "failed to register MTD: %d\n", ret);
goto failed_req_irq;
diff --git a/include/linux/platform_data/denali.h b/include/linux/platform_data/denali.h
index cfdb775..e9e415b 100644
--- a/include/linux/platform_data/denali.h
+++ b/include/linux/platform_data/denali.h
@@ -14,8 +14,12 @@
#ifndef __DENALI_PDATA_H__
#define __DENALI_PDATA_H__
+struct mtd_partition;
+
struct denali_nand_pdata {
- int nr_ecc_bits;
+ int nr_ecc_bits;
+ const struct mtd_partition *parts;
+ unsigned int nr_parts;
};
#endif /* __DENALI_PDATA_H__ */
--
1.7.4.4
next prev parent reply other threads:[~2011-05-06 14:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 14:28 [RFC PATCH 0/9] Support for MMIO based Denali NAND controller Jamie Iles
2011-05-06 14:28 ` [RFC PATCH 1/9] nand/denali: convert to generic DMA API Jamie Iles
2011-05-12 8:05 ` Artem Bityutskiy
2011-05-06 14:28 ` [RFC PATCH 2/9] nand/denali: remove nearly-duplicated register definitions Jamie Iles
2011-05-12 8:05 ` Artem Bityutskiy
2011-05-06 14:28 ` [RFC PATCH 3/9] nand/denali: detect the number of banks Jamie Iles
2011-05-12 8:05 ` Artem Bityutskiy
2011-05-06 14:28 ` [RFC PATCH 4/9] nand/denali: split the generic driver and PCI layer Jamie Iles
2011-05-12 8:08 ` Artem Bityutskiy
2011-05-12 8:15 ` David Woodhouse
2011-05-12 8:31 ` Jamie Iles
2011-05-06 14:28 ` [RFC PATCH 5/9] nand/denali: convert to dev_() printk helpers Jamie Iles
2011-05-12 8:10 ` Artem Bityutskiy
2011-05-06 14:29 ` [RFC PATCH 6/9] nand/denali: add an mmio driver Jamie Iles
2011-05-06 14:29 ` [RFC PATCH 7/9] nand/denali: annotate pci init/exit functions with correct section Jamie Iles
2011-05-06 14:29 ` [RFC PATCH 8/9] nand/denali: allow the number of ECC bits to be set by pdata Jamie Iles
2011-05-06 14:29 ` Jamie Iles [this message]
2011-05-06 14:33 ` [RFC PATCH 9/9] nand/denali: support MTD partitioning Artem Bityutskiy
[not found] ` <BANLkTi=9u5bH3eoCasxMhO05Qvh0cJxyqQ@mail.gmail.com>
[not found] ` <1304707397.7222.100.camel@localhost>
2011-05-06 19:33 ` Jamie Iles
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304692143-22432-10-git-send-email-jamie@jamieiles.com \
--to=jamie@jamieiles.com \
--cc=chuanxiao.dong@intel.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.