projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
530719b
)
mtd/m25p80: add support to parse the partitions by OF node
author
Mingkai Hu
<Mingkai.hu@freescale.com>
Tue, 12 Oct 2010 10:18:34 +0000
(18:18 +0800)
committer
Grant Likely
<grant.likely@secretlab.ca>
Fri, 22 Oct 2010 07:37:16 +0000
(
01:37
-0600)
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
[grant.likely@secretlab.ca: wrap hunk with #ifdef CONFIG_OF]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/mtd/devices/m25p80.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mtd/devices/m25p80.c
b/drivers/mtd/devices/m25p80.c
index 6f512b5c117b54ef0dddbe647cdfd53a52100541..ea22520c0406ed6a7c7a3537ee7ce64adf558481 100644
(file)
--- a/
drivers/mtd/devices/m25p80.c
+++ b/
drivers/mtd/devices/m25p80.c
@@
-924,6
+924,13
@@
static int __devinit m25p_probe(struct spi_device *spi)
nr_parts = data->nr_parts;
}
+#ifdef CONFIG_OF
+ if (nr_parts <= 0 && spi->dev.of_node) {
+ nr_parts = of_mtd_parse_partitions(&spi->dev,
+ spi->dev.of_node, &parts);
+ }
+#endif
+
if (nr_parts > 0) {
for (i = 0; i < nr_parts; i++) {
DEBUG(MTD_DEBUG_LEVEL2, "partitions[%d] = "