[PATCH] eeprom: at24: fix discarding const qualifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fixes:
at24.c:434:10: warning: assignment discards 'const' qualifier from pointer
target type

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/eeprom/at24.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/eeprom/at24.c b/drivers/eeprom/at24.c
index 49eef6a..fd6307d 100644
--- a/drivers/eeprom/at24.c
+++ b/drivers/eeprom/at24.c
@@ -380,6 +380,7 @@ static int at24_probe(struct device_d *dev)
 	int err;
 	unsigned i, num_addresses;
 	char *devname;
+	const char *alias;
 
 	if (dev->platform_data) {
 		chip = *(struct at24_platform_data *)dev->platform_data;
@@ -431,8 +432,10 @@ static int at24_probe(struct device_d *dev)
 	at24->chip = chip;
 	at24->num_addresses = num_addresses;
 
-	devname = of_alias_get(dev->device_node);
-	if (!devname) {
+	alias = of_alias_get(dev->device_node);
+	if (alias) {
+		devname = xstrdup(alias);
+	} else {
 		err = cdev_find_free_index("eeprom");
 		if (err < 0) {
 			dev_err(&client->dev, "no index found to name device\n");
-- 
2.8.1


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux