From: Jamie Iles <jamie@jamieiles.com>
To: linux-mtd@lists.infradead.org
Cc: Jamie Iles <jamie@jamieiles.com>,
Artem Bityutskiy <dedekind1@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Chuanxiao Dong <chuanxiao.dong@intel.com>
Subject: [PATCH 5/6] nand/denali: support MTD partitioning
Date: Fri, 3 Jun 2011 11:17:17 +0100 [thread overview]
Message-ID: <1307096238-25751-6-git-send-email-jamie@jamieiles.com> (raw)
In-Reply-To: <1307096238-25751-1-git-send-email-jamie@jamieiles.com>
Allow the platform to specify partitions through platform data. If
there are no partitions specified then the whole device will be
registered.
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
drivers/mtd/nand/denali.c | 8 +++++++-
include/linux/platform_data/denali.h | 8 ++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index fb8e49e..19998ed 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
#include <linux/module.h>
#include <linux/platform_data/denali.h>
@@ -1644,7 +1645,12 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto failed_req_irq;
}
- ret = mtd_device_register(&denali->mtd, NULL, 0);
+ if (pdata && pdata->parts)
+ ret = mtd_device_register(&denali->mtd, pdata->parts,
+ pdata->nr_parts);
+ else
+ ret = mtd_device_register(&denali->mtd, NULL, 0);
+
if (ret) {
dev_err(denali->dev, "Spectra: Failed to register MTD: %d\n",
ret);
diff --git a/include/linux/platform_data/denali.h b/include/linux/platform_data/denali.h
index 3767333..141da35 100644
--- a/include/linux/platform_data/denali.h
+++ b/include/linux/platform_data/denali.h
@@ -14,9 +14,13 @@
#ifndef __DENALI_PDATA_H__
#define __DENALI_PDATA_H__
+struct mtd_partition;
+
struct denali_nand_pdata {
- int nr_ecc_bits;
- bool have_hw_ecc_fixup;
+ int nr_ecc_bits;
+ bool have_hw_ecc_fixup;
+ const struct mtd_partition *parts;
+ unsigned int nr_parts;
};
#endif /* __DENALI_PDATA_H__ */
--
1.7.4.1
next prev parent reply other threads:[~2011-06-03 10:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 10:17 [PATCH 0/6] Further Denali NAND enhancements Jamie Iles
2011-06-03 10:17 ` [PATCH 1/6] nand/denali: convert to dev_() printk helpers Jamie Iles
2011-06-03 10:17 ` [PATCH 2/6] nand/denali: annotate pci init/exit functions with correct section Jamie Iles
2011-06-03 10:17 ` [PATCH 3/6] nand/denali: allow the number of ECC bits to be set by pdata Jamie Iles
2011-06-03 10:17 ` [PATCH 4/6] nand/denali: support hardware with internal ECC fixup Jamie Iles
2011-06-03 10:17 ` Jamie Iles [this message]
2011-06-03 10:17 ` [PATCH 6/6] mtd/denali: support for cmdline partitioning Jamie Iles
2011-06-03 10:31 ` [PATCH 0/6] Further Denali NAND enhancements 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=1307096238-25751-6-git-send-email-jamie@jamieiles.com \
--to=jamie@jamieiles.com \
--cc=chuanxiao.dong@intel.com \
--cc=dedekind1@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox