mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/2] mtd: m25p80: make flash_name const
Date: Mon, 29 Jun 2015 07:16:21 +0200	[thread overview]
Message-ID: <1435554981-30388-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1435554981-30388-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/devices/m25p80.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 231d139..794c9db 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;
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2015-06-29  5:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29  5:16 [PATCH 1/2] mtd: Make devname argument to add_mtd_device const Sascha Hauer
2015-06-29  5:16 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435554981-30388-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox