summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/m25p80.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-29 07:07:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-29 07:07:30 +0200
commit3fc17ce4c88d713d369fb255165f24c85aea81c1 (patch)
treef33896f49d870cf9037d524833e588ea73f3129e /drivers/mtd/devices/m25p80.c
parent5f11e80670a7cf9acfca05b91b3ccf054b8457ae (diff)
downloadbarebox-3fc17ce4c88d713d369fb255165f24c85aea81c1.tar.gz
barebox-3fc17ce4c88d713d369fb255165f24c85aea81c1.tar.xz
mtd: m25p80: make flash_name const
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/devices/m25p80.c')
-rw-r--r--drivers/mtd/devices/m25p80.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 231d139789..794c9dbd82 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -233,7 +233,7 @@ static int m25p_probe(struct device_d *dev)
struct m25p *flash;
struct spi_nor *nor;
enum read_mode mode = SPI_NOR_NORMAL;
- char *flash_name = NULL;
+ const char *flash_name = NULL;
int device_id;
int ret;
@@ -277,13 +277,10 @@ static int m25p_probe(struct device_d *dev)
return ret;
device_id = DEVICE_ID_SINGLE;
- if (dev->device_node) {
- const char *alias = of_alias_get(dev->device_node);
- if (alias)
- flash_name = xstrdup(alias);
- } else if (data && data->name) {
+ if (dev->device_node)
+ flash_name = of_alias_get(dev->device_node);
+ else if (data && data->name)
flash_name = data->name;
- }
if (!flash_name) {
device_id = DEVICE_ID_DYNAMIC;