summaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-11-14 22:37:12 +0000
committerGrant Likely <grant.likely@secretlab.ca>2012-11-17 12:05:57 +0000
commitc22618a11d1ba2966bd2cfd5e4918ed4f2dad13e (patch)
treee317e1413afd8f80ea4ddc036703ff447c1c0901 /include/linux/of.h
parent31982e52f0f5d6d51e69d5c4c4a7be5d52307c6e (diff)
drivers/of: Constify device_node->name and ->path_component_name
Neither of these should ever be changed once set. Make them const and fix up the users that try to modify it in-place. In one case kmalloc+memcpy is replaced with kstrdup() to avoid modifying the string. Build tested with defconfigs on ARM, PowerPC, Sparc, MIPS, x86 among others. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Julian Calaby <julian.calaby@gmail.com>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index b4e50d56fc7..857dde984a6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -46,7 +46,7 @@ struct device_node {
const char *name;
const char *type;
phandle phandle;
- char *full_name;
+ const char *full_name;
struct property *properties;
struct property *deadprops; /* removed properties */
@@ -60,7 +60,7 @@ struct device_node {
unsigned long _flags;
void *data;
#if defined(CONFIG_SPARC)
- char *path_component_name;
+ const char *path_component_name;
unsigned int unique_id;
struct of_irq_controller *irq_trans;
#endif