diff options
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/st_spi_fsm.c | 6 |
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 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/mfd/syscon.h> | 19 | #include <linux/mfd/syscon.h> |
20 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
21 | #include <linux/mtd/partitions.h> | ||
21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
22 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
@@ -1997,6 +1998,7 @@ boot_device_fail: | |||
1997 | static int stfsm_probe(struct platform_device *pdev) | 1998 | static int stfsm_probe(struct platform_device *pdev) |
1998 | { | 1999 | { |
1999 | struct device_node *np = pdev->dev.of_node; | 2000 | struct device_node *np = pdev->dev.of_node; |
2001 | struct mtd_part_parser_data ppdata; | ||
2000 | struct flash_info *info; | 2002 | struct flash_info *info; |
2001 | struct resource *res; | 2003 | struct resource *res; |
2002 | struct stfsm *fsm; | 2004 | struct stfsm *fsm; |
@@ -2006,6 +2008,7 @@ static int stfsm_probe(struct platform_device *pdev) | |||
2006 | dev_err(&pdev->dev, "No DT found\n"); | 2008 | dev_err(&pdev->dev, "No DT found\n"); |
2007 | return -EINVAL; | 2009 | return -EINVAL; |
2008 | } | 2010 | } |
2011 | ppdata.of_node = np; | ||
2009 | 2012 | ||
2010 | fsm = devm_kzalloc(&pdev->dev, sizeof(*fsm), GFP_KERNEL); | 2013 | fsm = devm_kzalloc(&pdev->dev, sizeof(*fsm), GFP_KERNEL); |
2011 | if (!fsm) | 2014 | if (!fsm) |
@@ -2062,6 +2065,7 @@ static int stfsm_probe(struct platform_device *pdev) | |||
2062 | return ret; | 2065 | return ret; |
2063 | } | 2066 | } |
2064 | 2067 | ||
2068 | fsm->mtd.name = info->name; | ||
2065 | fsm->mtd.dev.parent = &pdev->dev; | 2069 | fsm->mtd.dev.parent = &pdev->dev; |
2066 | fsm->mtd.type = MTD_NORFLASH; | 2070 | fsm->mtd.type = MTD_NORFLASH; |
2067 | fsm->mtd.writesize = 4; | 2071 | fsm->mtd.writesize = 4; |
@@ -2081,7 +2085,7 @@ static int stfsm_probe(struct platform_device *pdev) | |||
2081 | (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20), | 2085 | (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20), |
2082 | fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10)); | 2086 | fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10)); |
2083 | 2087 | ||
2084 | return mtd_device_parse_register(&fsm->mtd, NULL, NULL, NULL, 0); | 2088 | return mtd_device_parse_register(&fsm->mtd, NULL, &ppdata, NULL, 0); |
2085 | } | 2089 | } |
2086 | 2090 | ||
2087 | static int stfsm_remove(struct platform_device *pdev) | 2091 | static int stfsm_remove(struct platform_device *pdev) |