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

regulator: tps80031: Constify regulator_ops and tps80031_dcdc_voltages array

These regulator_ops variables and tps80031_dcdc_voltages array 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>

authored by

Axel Lin and committed by
Mark Brown
4b77a49c de110f38

+6 -6
+6 -6
drivers/regulator/tps80031-regulator.c
··· 154 154 } 155 155 156 156 /* DCDC voltages for the selector of 58 to 63 */ 157 - static int tps80031_dcdc_voltages[4][5] = { 157 + static const int tps80031_dcdc_voltages[4][5] = { 158 158 { 1350, 1500, 1800, 1900, 2100}, 159 159 { 1350, 1500, 1800, 1900, 2100}, 160 160 { 2084, 2315, 2778, 2932, 3241}, ··· 377 377 return ret; 378 378 } 379 379 380 - static struct regulator_ops tps80031_dcdc_ops = { 380 + static const struct regulator_ops tps80031_dcdc_ops = { 381 381 .list_voltage = tps80031_dcdc_list_voltage, 382 382 .set_voltage_sel = tps80031_dcdc_set_voltage_sel, 383 383 .get_voltage_sel = tps80031_dcdc_get_voltage_sel, ··· 386 386 .is_enabled = tps80031_reg_is_enabled, 387 387 }; 388 388 389 - static struct regulator_ops tps80031_ldo_ops = { 389 + static const struct regulator_ops tps80031_ldo_ops = { 390 390 .list_voltage = tps80031_ldo_list_voltage, 391 391 .map_voltage = tps80031_ldo_map_voltage, 392 392 .set_voltage_sel = regulator_set_voltage_sel_regmap, ··· 396 396 .is_enabled = tps80031_reg_is_enabled, 397 397 }; 398 398 399 - static struct regulator_ops tps80031_vbus_sw_ops = { 399 + static const struct regulator_ops tps80031_vbus_sw_ops = { 400 400 .list_voltage = regulator_list_voltage_linear, 401 401 .enable = tps80031_vbus_enable, 402 402 .disable = tps80031_vbus_disable, 403 403 .is_enabled = tps80031_vbus_is_enabled, 404 404 }; 405 405 406 - static struct regulator_ops tps80031_vbus_hw_ops = { 406 + static const struct regulator_ops tps80031_vbus_hw_ops = { 407 407 .list_voltage = regulator_list_voltage_linear, 408 408 }; 409 409 410 - static struct regulator_ops tps80031_ext_reg_ops = { 410 + static const struct regulator_ops tps80031_ext_reg_ops = { 411 411 .list_voltage = regulator_list_voltage_linear, 412 412 .enable = tps80031_reg_enable, 413 413 .disable = tps80031_reg_disable,