summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2014-03-20 09:21:07 +0000
committerBrian Norris <computersforpeace@gmail.com>2014-03-20 04:17:22 -0700
commit221cff13cacc55b495bac33bf0f79abe59a6f265 (patch)
tree999a8ef5cc4208202a375fc57ae50cec761df963 /drivers/mtd
parente6b1bb4e18919b969cd876d48b40733993c2a7c7 (diff)
downloadlinux-221cff13cacc55b495bac33bf0f79abe59a6f265.tar.bz2
mtd: st_spi_fsm: Convert ST SPI FSM (NOR) Flash driver to new DT partitions
The old API expected a "partitions" property provided a phandle to a separate partitions node, which itself contained yet more nodes each representing one partition. The new API rids the requirement for the superfluous intermediary partitions node. This patch provides the added information required for automatic parsing by the core. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/st_spi_fsm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index dccbac013340..aefd48db7ade 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -18,6 +18,7 @@
#include <linux/platform_device.h>
#include <linux/mfd/syscon.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/io.h>
@@ -1997,6 +1998,7 @@ boot_device_fail:
static int stfsm_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
+ struct mtd_part_parser_data ppdata;
struct flash_info *info;
struct resource *res;
struct stfsm *fsm;
@@ -2006,6 +2008,7 @@ static int stfsm_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "No DT found\n");
return -EINVAL;
}
+ ppdata.of_node = np;
fsm = devm_kzalloc(&pdev->dev, sizeof(*fsm), GFP_KERNEL);
if (!fsm)
@@ -2062,6 +2065,7 @@ static int stfsm_probe(struct platform_device *pdev)
return ret;
}
+ fsm->mtd.name = info->name;
fsm->mtd.dev.parent = &pdev->dev;
fsm->mtd.type = MTD_NORFLASH;
fsm->mtd.writesize = 4;
@@ -2081,7 +2085,7 @@ static int stfsm_probe(struct platform_device *pdev)
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
- return mtd_device_parse_register(&fsm->mtd, NULL, NULL, NULL, 0);
+ return mtd_device_parse_register(&fsm->mtd, NULL, &ppdata, NULL, 0);
}
static int stfsm_remove(struct platform_device *pdev)