Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: wm8*: constify regulator_ops structures

The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Julia Lawall and committed by
Mark Brown
b0d6dd3b 71242b49

+16 -16
+4 -4
drivers/regulator/wm831x-dcdc.c
··· 365 365 return wm831x_dcdc_ilim[val]; 366 366 } 367 367 368 - static struct regulator_ops wm831x_buckv_ops = { 368 + static const struct regulator_ops wm831x_buckv_ops = { 369 369 .set_voltage_sel = wm831x_buckv_set_voltage_sel, 370 370 .get_voltage_sel = wm831x_buckv_get_voltage_sel, 371 371 .list_voltage = wm831x_buckv_list_voltage, ··· 585 585 return wm831x_set_bits(wm831x, reg, WM831X_DC3_ON_VSEL_MASK, sel); 586 586 } 587 587 588 - static struct regulator_ops wm831x_buckp_ops = { 588 + static const struct regulator_ops wm831x_buckp_ops = { 589 589 .set_voltage_sel = regulator_set_voltage_sel_regmap, 590 590 .get_voltage_sel = regulator_get_voltage_sel_regmap, 591 591 .list_voltage = regulator_list_voltage_linear, ··· 725 725 return REGULATOR_STATUS_OFF; 726 726 } 727 727 728 - static struct regulator_ops wm831x_boostp_ops = { 728 + static const struct regulator_ops wm831x_boostp_ops = { 729 729 .get_status = wm831x_boostp_get_status, 730 730 731 731 .is_enabled = regulator_is_enabled_regmap, ··· 818 818 819 819 #define WM831X_EPE_BASE 6 820 820 821 - static struct regulator_ops wm831x_epe_ops = { 821 + static const struct regulator_ops wm831x_epe_ops = { 822 822 .is_enabled = regulator_is_enabled_regmap, 823 823 .enable = regulator_enable_regmap, 824 824 .disable = regulator_disable_regmap,
+1 -1
drivers/regulator/wm831x-isink.c
··· 128 128 return wm831x_isinkv_values[ret]; 129 129 } 130 130 131 - static struct regulator_ops wm831x_isink_ops = { 131 + static const struct regulator_ops wm831x_isink_ops = { 132 132 .is_enabled = wm831x_isink_is_enabled, 133 133 .enable = wm831x_isink_enable, 134 134 .disable = wm831x_isink_disable,
+3 -3
drivers/regulator/wm831x-ldo.c
··· 198 198 } 199 199 200 200 201 - static struct regulator_ops wm831x_gp_ldo_ops = { 201 + static const struct regulator_ops wm831x_gp_ldo_ops = { 202 202 .list_voltage = regulator_list_voltage_linear_range, 203 203 .map_voltage = regulator_map_voltage_linear_range, 204 204 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 409 409 return regulator_mode_to_status(ret); 410 410 } 411 411 412 - static struct regulator_ops wm831x_aldo_ops = { 412 + static const struct regulator_ops wm831x_aldo_ops = { 413 413 .list_voltage = regulator_list_voltage_linear_range, 414 414 .map_voltage = regulator_map_voltage_linear_range, 415 415 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 557 557 return REGULATOR_STATUS_OFF; 558 558 } 559 559 560 - static struct regulator_ops wm831x_alive_ldo_ops = { 560 + static const struct regulator_ops wm831x_alive_ldo_ops = { 561 561 .list_voltage = regulator_list_voltage_linear, 562 562 .map_voltage = regulator_map_voltage_linear, 563 563 .get_voltage_sel = regulator_get_voltage_sel_regmap,
+4 -4
drivers/regulator/wm8350-regulator.c
··· 941 941 return mode; 942 942 } 943 943 944 - static struct regulator_ops wm8350_dcdc_ops = { 944 + static const struct regulator_ops wm8350_dcdc_ops = { 945 945 .set_voltage_sel = regulator_set_voltage_sel_regmap, 946 946 .get_voltage_sel = regulator_get_voltage_sel_regmap, 947 947 .list_voltage = regulator_list_voltage_linear, ··· 958 958 .set_suspend_mode = wm8350_dcdc_set_suspend_mode, 959 959 }; 960 960 961 - static struct regulator_ops wm8350_dcdc2_5_ops = { 961 + static const struct regulator_ops wm8350_dcdc2_5_ops = { 962 962 .enable = regulator_enable_regmap, 963 963 .disable = regulator_disable_regmap, 964 964 .is_enabled = regulator_is_enabled_regmap, ··· 966 966 .set_suspend_disable = wm8350_dcdc25_set_suspend_disable, 967 967 }; 968 968 969 - static struct regulator_ops wm8350_ldo_ops = { 969 + static const struct regulator_ops wm8350_ldo_ops = { 970 970 .map_voltage = regulator_map_voltage_linear_range, 971 971 .set_voltage_sel = regulator_set_voltage_sel_regmap, 972 972 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 980 980 .set_suspend_disable = wm8350_ldo_set_suspend_disable, 981 981 }; 982 982 983 - static struct regulator_ops wm8350_isink_ops = { 983 + static const struct regulator_ops wm8350_isink_ops = { 984 984 .set_current_limit = wm8350_isink_set_current, 985 985 .get_current_limit = wm8350_isink_get_current, 986 986 .enable = wm8350_isink_enable,
+2 -2
drivers/regulator/wm8400-regulator.c
··· 24 24 REGULATOR_LINEAR_RANGE(1700000, 15, 31, 100000), 25 25 }; 26 26 27 - static struct regulator_ops wm8400_ldo_ops = { 27 + static const struct regulator_ops wm8400_ldo_ops = { 28 28 .is_enabled = regulator_is_enabled_regmap, 29 29 .enable = regulator_enable_regmap, 30 30 .disable = regulator_disable_regmap, ··· 106 106 return REGULATOR_MODE_NORMAL; 107 107 } 108 108 109 - static struct regulator_ops wm8400_dcdc_ops = { 109 + static const struct regulator_ops wm8400_dcdc_ops = { 110 110 .is_enabled = regulator_is_enabled_regmap, 111 111 .enable = regulator_enable_regmap, 112 112 .disable = regulator_disable_regmap,
+2 -2
drivers/regulator/wm8994-regulator.c
··· 36 36 #define WM8994_LDO1_MAX_SELECTOR 0x7 37 37 #define WM8994_LDO2_MAX_SELECTOR 0x3 38 38 39 - static struct regulator_ops wm8994_ldo1_ops = { 39 + static const struct regulator_ops wm8994_ldo1_ops = { 40 40 .list_voltage = regulator_list_voltage_linear, 41 41 .map_voltage = regulator_map_voltage_linear, 42 42 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 69 69 } 70 70 } 71 71 72 - static struct regulator_ops wm8994_ldo2_ops = { 72 + static const struct regulator_ops wm8994_ldo2_ops = { 73 73 .list_voltage = wm8994_ldo2_list_voltage, 74 74 .get_voltage_sel = regulator_get_voltage_sel_regmap, 75 75 .set_voltage_sel = regulator_set_voltage_sel_regmap,