#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-@@ -184,6 +185,10 @@ static int m25p_probe(struct spi_device
+@@ -182,6 +183,10 @@ static int m25p_probe(struct spi_device
enum read_mode mode = SPI_NOR_NORMAL;
char *flash_name = NULL;
int ret;
data = dev_get_platdata(&spi->dev);
-@@ -215,6 +220,8 @@ static int m25p_probe(struct spi_device
+@@ -212,6 +217,8 @@ static int m25p_probe(struct spi_device
if (data && data->name)
- flash->mtd.name = data->name;
+ nor->mtd.name = data->name;
+ else if (of_mtd_name)
+ flash->mtd.name = of_mtd_name;