Skip to contentSkip to conversation

hwmon: pmbus: Constify pmbus_regulator_ops

PATCH Applied Axel Lin 2 participants 2 messages Jul 10, 2015 Hardware monitoring

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 2/2 hwmon: pmbus: Constify pmbus_regulator_ops

pmbus_regulator_ops is not modified after initialized, so make it const.

---
 drivers/hwmon/pmbus/pmbus.h      | 2 +-
 drivers/hwmon/pmbus/pmbus_core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/pmbus/pmbus.h +1 -1
index 21f8b2f..58262b5 100644
@@ -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)				\
drivers/hwmon/pmbus/pmbus_core.c +1 -1
index f2e47c7..12d85b1 100644
@@ -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,
Signature · 9 lines
2.1.0




_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors