]> Pileus Git - ~andy/linux/commitdiff
of: constify property name parameters for helper functions
authorJamie Iles <jamie@jamieiles.com>
Tue, 2 Aug 2011 14:45:07 +0000 (15:45 +0100)
committerGrant Likely <grant.likely@secretlab.ca>
Tue, 2 Aug 2011 15:50:47 +0000 (16:50 +0100)
The helper functions for reading u32 integers, u32 arrays and strings
should have the property name as a const pointer.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/of/base.c
include/linux/of.h

index 02ed36719defce57fb30f8182a02903ad2b16445..3ff22e32b6020c5f325a1e25f97c68ea84ee3221 100644 (file)
@@ -610,8 +610,9 @@ EXPORT_SYMBOL(of_find_node_by_phandle);
  *
  * The out_value is modified only if a valid u32 value can be decoded.
  */
-int of_property_read_u32_array(const struct device_node *np, char *propname,
-                              u32 *out_values, size_t sz)
+int of_property_read_u32_array(const struct device_node *np,
+                              const char *propname, u32 *out_values,
+                              size_t sz)
 {
        struct property *prop = of_find_property(np, propname, NULL);
        const __be32 *val;
@@ -645,7 +646,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_array);
  *
  * The out_string pointer is modified only if a valid string can be decoded.
  */
-int of_property_read_string(struct device_node *np, char *propname,
+int of_property_read_string(struct device_node *np, const char *propname,
                                const char **out_string)
 {
        struct property *prop = of_find_property(np, propname, NULL);
index bd716f8908de022b1b391401c5c877aed9a85ba8..0085bb01c041e969276b2ab5107dc4e2446d445c 100644 (file)
@@ -196,12 +196,13 @@ extern struct property *of_find_property(const struct device_node *np,
                                         const char *name,
                                         int *lenp);
 extern int of_property_read_u32_array(const struct device_node *np,
-                                     char *propname,
+                                     const char *propname,
                                      u32 *out_values,
                                      size_t sz);
 
-extern int of_property_read_string(struct device_node *np, char *propname,
-                                       const char **out_string);
+extern int of_property_read_string(struct device_node *np,
+                                  const char *propname,
+                                  const char **out_string);
 extern int of_device_is_compatible(const struct device_node *device,
                                   const char *);
 extern int of_device_is_available(const struct device_node *device);
@@ -242,13 +243,15 @@ static inline bool of_have_populated_dt(void)
 }
 
 static inline int of_property_read_u32_array(const struct device_node *np,
-                               char *propname, u32 *out_values, size_t sz)
+                                            const char *propname,
+                                            u32 *out_values, size_t sz)
 {
        return -ENOSYS;
 }
 
 static inline int of_property_read_string(struct device_node *np,
-                               char *propname, const char **out_string)
+                                         const char *propname,
+                                         const char **out_string)
 {
        return -ENOSYS;
 }
@@ -256,7 +259,7 @@ static inline int of_property_read_string(struct device_node *np,
 #endif /* CONFIG_OF */
 
 static inline int of_property_read_u32(const struct device_node *np,
-                                      char *propname,
+                                      const char *propname,
                                       u32 *out_value)
 {
        return of_property_read_u32_array(np, propname, out_value, 1);