regulator: max8998: Constify regulator_ops
authorAxel Lin <axel.lin@ingics.com>
Sun, 14 Apr 2019 12:48:17 +0000 (20:48 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 15 Apr 2019 08:44:58 +0000 (09:44 +0100)
These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max8998.c

index 271bb736f3f55782c50bb3d2b6a73d0ddfe958b8..43b69ebd086b7fc608d02557f0aa7c923913399d 100644 (file)
@@ -427,7 +427,7 @@ static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
        return 0;
 }
 
-static struct regulator_ops max8998_ldo_ops = {
+static const struct regulator_ops max8998_ldo_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = max8998_ldo_is_enabled,
@@ -437,7 +437,7 @@ static struct regulator_ops max8998_ldo_ops = {
        .set_voltage_sel        = max8998_set_voltage_ldo_sel,
 };
 
-static struct regulator_ops max8998_buck_ops = {
+static const struct regulator_ops max8998_buck_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = max8998_ldo_is_enabled,
@@ -448,7 +448,7 @@ static struct regulator_ops max8998_buck_ops = {
        .set_voltage_time_sel   = max8998_set_voltage_buck_time_sel,
 };
 
-static struct regulator_ops max8998_others_ops = {
+static const struct regulator_ops max8998_others_ops = {
        .is_enabled             = max8998_ldo_is_enabled,
        .enable                 = max8998_ldo_enable,
        .disable                = max8998_ldo_disable,