diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-29 07:07:30 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-29 07:07:30 +0200 |
commit | 3fc17ce4c88d713d369fb255165f24c85aea81c1 (patch) | |
tree | f33896f49d870cf9037d524833e588ea73f3129e | |
parent | 5f11e80670a7cf9acfca05b91b3ccf054b8457ae (diff) | |
download | barebox-3fc17ce4c88d713d369fb255165f24c85aea81c1.tar.gz barebox-3fc17ce4c88d713d369fb255165f24c85aea81c1.tar.xz |
mtd: m25p80: make flash_name const
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 11 |
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; |