regulator: Constify the pointer to alias name array
authorLee Jones <lee.jones@linaro.org>
Fri, 23 May 2014 15:44:10 +0000 (16:44 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 23 May 2014 17:55:23 +0000 (18:55 +0100)
Toughen-up checks for read-only regulator names.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/core.c
drivers/regulator/devres.c
include/linux/mfd/core.h
include/linux/regulator/consumer.h

index 9a09f3cdbabb85cec71e7afece30308e4ccead7b..ba28d29b66d25e8e32a37dc36ed3c931b3908520 100644 (file)
@@ -1597,9 +1597,10 @@ EXPORT_SYMBOL_GPL(regulator_unregister_supply_alias);
  * registered any aliases that were registered will be removed
  * before returning to the caller.
  */
-int regulator_bulk_register_supply_alias(struct device *dev, const char **id,
+int regulator_bulk_register_supply_alias(struct device *dev,
+                                        const char *const *id,
                                         struct device *alias_dev,
-                                        const char **alias_id,
+                                        const char *const *alias_id,
                                         int num_id)
 {
        int i;
@@ -1637,7 +1638,7 @@ EXPORT_SYMBOL_GPL(regulator_bulk_register_supply_alias);
  * aliases in one operation.
  */
 void regulator_bulk_unregister_supply_alias(struct device *dev,
-                                           const char **id,
+                                           const char *const *id,
                                            int num_id)
 {
        int i;
index f44818b838dc2d2da8fba4833e7e8d2e8893e8a1..8f785bc9e5108519525f0908b3d3e3d097b67816 100644 (file)
@@ -360,9 +360,9 @@ EXPORT_SYMBOL_GPL(devm_regulator_unregister_supply_alias);
  * will be removed before returning to the caller.
  */
 int devm_regulator_bulk_register_supply_alias(struct device *dev,
-                                             const char **id,
+                                             const char *const *id,
                                              struct device *alias_dev,
-                                             const char **alias_id,
+                                             const char *const *alias_id,
                                              int num_id)
 {
        int i;
@@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(devm_regulator_bulk_register_supply_alias);
  * will ensure that the resource is freed.
  */
 void devm_regulator_bulk_unregister_supply_alias(struct device *dev,
-                                                const char **id,
+                                                const char *const *id,
                                                 int num_id)
 {
        int i;
index bdba8c61207bb7b892e63eff49d81cfdf2f3538a..f543de91ce19d91ae6c0eb065f8687061581ea64 100644 (file)
@@ -63,7 +63,7 @@ struct mfd_cell {
        /* A list of regulator supplies that should be mapped to the MFD
         * device rather than the child device when requested
         */
-       const char              **parent_supplies;
+       const char * const      *parent_supplies;
        int                     num_parent_supplies;
 };
 
index e530681bea7049cfa818e66acea0bf863952d281..10d0a53f4cd3eeb9c53b2db96213071611beb9cf 100644 (file)
@@ -151,11 +151,13 @@ int regulator_register_supply_alias(struct device *dev, const char *id,
                                    const char *alias_id);
 void regulator_unregister_supply_alias(struct device *dev, const char *id);
 
-int regulator_bulk_register_supply_alias(struct device *dev, const char **id,
+int regulator_bulk_register_supply_alias(struct device *dev,
+                                        const char *const *id,
                                         struct device *alias_dev,
-                                        const char **alias_id, int num_id);
+                                        const char *const *alias_id,
+                                        int num_id);
 void regulator_bulk_unregister_supply_alias(struct device *dev,
-                                           const char **id, int num_id);
+                                           const char * const *id, int num_id);
 
 int devm_regulator_register_supply_alias(struct device *dev, const char *id,
                                         struct device *alias_dev,
@@ -164,12 +166,12 @@ void devm_regulator_unregister_supply_alias(struct device *dev,
                                            const char *id);
 
 int devm_regulator_bulk_register_supply_alias(struct device *dev,
-                                             const char **id,
+                                             const char *const *id,
                                              struct device *alias_dev,
-                                             const char **alias_id,
+                                             const char *const *alias_id,
                                              int num_id);
 void devm_regulator_bulk_unregister_supply_alias(struct device *dev,
-                                                const char **id,
+                                                const char *const *id,
                                                 int num_id);
 
 /* regulator output control and status */
@@ -290,17 +292,17 @@ static inline void regulator_unregister_supply_alias(struct device *dev,
 }
 
 static inline int regulator_bulk_register_supply_alias(struct device *dev,
-                                                      const char **id,
-                                                      struct device *alias_dev,
-                                                      const char **alias_id,
-                                                      int num_id)
+                                               const char *const *id,
+                                               struct device *alias_dev,
+                                               const char * const *alias_id,
+                                               int num_id)
 {
        return 0;
 }
 
 static inline void regulator_bulk_unregister_supply_alias(struct device *dev,
-                                                         const char **id,
-                                                         int num_id)
+                                               const char * const *id,
+                                               int num_id)
 {
 }
 
@@ -317,15 +319,17 @@ static inline void devm_regulator_unregister_supply_alias(struct device *dev,
 {
 }
 
-static inline int devm_regulator_bulk_register_supply_alias(
-               struct device *dev, const char **id, struct device *alias_dev,
-               const char **alias_id, int num_id)
+static inline int devm_regulator_bulk_register_supply_alias(struct device *dev,
+                                               const char *const *id,
+                                               struct device *alias_dev,
+                                               const char *const *alias_id,
+                                               int num_id)
 {
        return 0;
 }
 
 static inline void devm_regulator_bulk_unregister_supply_alias(
-               struct device *dev, const char **id, int num_id)
+       struct device *dev, const char *const *id, int num_id)
 {
 }