hwmon: (pmbus_core) Constify pmbus_regulator_ops
authorAxel Lin <axel.lin@ingics.com>
Fri, 10 Jul 2015 05:00:08 +0000 (13:00 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 9 Aug 2015 20:44:26 +0000 (13:44 -0700)
pmbus_regulator_ops is not modified after initialized, so make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c

index 21f8b2fa7fc45a7c9dc6bac4e51f022331146de5..58262b54f09f46f2454fdcd19a354dc1f921e83b 100644 (file)
@@ -380,7 +380,7 @@ struct pmbus_driver_info {
 
 /* Regulator ops */
 
-extern struct regulator_ops pmbus_regulator_ops;
+extern const struct regulator_ops pmbus_regulator_ops;
 
 /* Macro for filling in array of struct regulator_desc */
 #define PMBUS_REGULATOR(_name, _id)                            \
index f2e47c7dd808becd444512c74dc5738c9e544955..12d85b178358207c7ffe65bb5ffbc1a7886e02c1 100644 (file)
@@ -1796,7 +1796,7 @@ static int pmbus_regulator_disable(struct regulator_dev *rdev)
        return _pmbus_regulator_on_off(rdev, 0);
 }
 
-struct regulator_ops pmbus_regulator_ops = {
+const struct regulator_ops pmbus_regulator_ops = {
        .enable = pmbus_regulator_enable,
        .disable = pmbus_regulator_disable,
        .is_enabled = pmbus_regulator_is_enabled,