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

regulator: da9*: 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>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Julia Lawall and committed by
Mark Brown
71242b49 8005c49d

+15 -15
+5 -5
drivers/regulator/da903x.c
··· 257 257 REGULATOR_LINEAR_RANGE(2700000, 8, 15, 50000), 258 258 }; 259 259 260 - static struct regulator_ops da903x_regulator_ldo_ops = { 260 + static const struct regulator_ops da903x_regulator_ldo_ops = { 261 261 .set_voltage_sel = da903x_set_voltage_sel, 262 262 .get_voltage_sel = da903x_get_voltage_sel, 263 263 .list_voltage = regulator_list_voltage_linear, ··· 268 268 }; 269 269 270 270 /* NOTE: this is dedicated for the insane DA9030 LDO14 */ 271 - static struct regulator_ops da9030_regulator_ldo14_ops = { 271 + static const struct regulator_ops da9030_regulator_ldo14_ops = { 272 272 .set_voltage_sel = da903x_set_voltage_sel, 273 273 .get_voltage_sel = da903x_get_voltage_sel, 274 274 .list_voltage = da9030_list_ldo14_voltage, ··· 279 279 }; 280 280 281 281 /* NOTE: this is dedicated for the DA9030 LDO1 and LDO15 that have locks */ 282 - static struct regulator_ops da9030_regulator_ldo1_15_ops = { 282 + static const struct regulator_ops da9030_regulator_ldo1_15_ops = { 283 283 .set_voltage_sel = da9030_set_ldo1_15_voltage_sel, 284 284 .get_voltage_sel = da903x_get_voltage_sel, 285 285 .list_voltage = regulator_list_voltage_linear, ··· 289 289 .is_enabled = da903x_is_enabled, 290 290 }; 291 291 292 - static struct regulator_ops da9034_regulator_dvc_ops = { 292 + static const struct regulator_ops da9034_regulator_dvc_ops = { 293 293 .set_voltage_sel = da9034_set_dvc_voltage_sel, 294 294 .get_voltage_sel = da903x_get_voltage_sel, 295 295 .list_voltage = regulator_list_voltage_linear, ··· 300 300 }; 301 301 302 302 /* NOTE: this is dedicated for the insane LDO12 */ 303 - static struct regulator_ops da9034_regulator_ldo12_ops = { 303 + static const struct regulator_ops da9034_regulator_ldo12_ops = { 304 304 .set_voltage_sel = da903x_set_voltage_sel, 305 305 .get_voltage_sel = da903x_get_voltage_sel, 306 306 .list_voltage = regulator_list_voltage_linear_range,
+2 -2
drivers/regulator/da9052-regulator.c
··· 265 265 return ret; 266 266 } 267 267 268 - static struct regulator_ops da9052_dcdc_ops = { 268 + static const struct regulator_ops da9052_dcdc_ops = { 269 269 .get_current_limit = da9052_dcdc_get_current_limit, 270 270 .set_current_limit = da9052_dcdc_set_current_limit, 271 271 ··· 279 279 .disable = regulator_disable_regmap, 280 280 }; 281 281 282 - static struct regulator_ops da9052_ldo_ops = { 282 + static const struct regulator_ops da9052_ldo_ops = { 283 283 .list_voltage = da9052_list_voltage, 284 284 .map_voltage = da9052_map_voltage, 285 285 .get_voltage_sel = regulator_get_voltage_sel_regmap,
+2 -2
drivers/regulator/da9055-regulator.c
··· 324 324 return 0; 325 325 } 326 326 327 - static struct regulator_ops da9055_buck_ops = { 327 + static const struct regulator_ops da9055_buck_ops = { 328 328 .get_mode = da9055_buck_get_mode, 329 329 .set_mode = da9055_buck_set_mode, 330 330 ··· 345 345 .set_suspend_mode = da9055_buck_set_mode, 346 346 }; 347 347 348 - static struct regulator_ops da9055_ldo_ops = { 348 + static const struct regulator_ops da9055_ldo_ops = { 349 349 .get_mode = da9055_ldo_get_mode, 350 350 .set_mode = da9055_ldo_set_mode, 351 351
+2 -2
drivers/regulator/da9062-regulator.c
··· 371 371 return regmap_field_write(regl->suspend_sleep, val); 372 372 } 373 373 374 - static struct regulator_ops da9062_buck_ops = { 374 + static const struct regulator_ops da9062_buck_ops = { 375 375 .enable = regulator_enable_regmap, 376 376 .disable = regulator_disable_regmap, 377 377 .is_enabled = regulator_is_enabled_regmap, ··· 389 389 .set_suspend_mode = da9062_buck_set_suspend_mode, 390 390 }; 391 391 392 - static struct regulator_ops da9062_ldo_ops = { 392 + static const struct regulator_ops da9062_ldo_ops = { 393 393 .enable = regulator_enable_regmap, 394 394 .disable = regulator_disable_regmap, 395 395 .is_enabled = regulator_is_enabled_regmap,
+2 -2
drivers/regulator/da9063-regulator.c
··· 427 427 return regmap_field_write(regl->suspend_sleep, val); 428 428 } 429 429 430 - static struct regulator_ops da9063_buck_ops = { 430 + static const struct regulator_ops da9063_buck_ops = { 431 431 .enable = regulator_enable_regmap, 432 432 .disable = regulator_disable_regmap, 433 433 .is_enabled = regulator_is_enabled_regmap, ··· 445 445 .set_suspend_mode = da9063_buck_set_suspend_mode, 446 446 }; 447 447 448 - static struct regulator_ops da9063_ldo_ops = { 448 + static const struct regulator_ops da9063_ldo_ops = { 449 449 .enable = regulator_enable_regmap, 450 450 .disable = regulator_disable_regmap, 451 451 .is_enabled = regulator_is_enabled_regmap,
+1 -1
drivers/regulator/da9210-regulator.c
··· 46 46 int max_uA); 47 47 static int da9210_get_current_limit(struct regulator_dev *rdev); 48 48 49 - static struct regulator_ops da9210_buck_ops = { 49 + static const struct regulator_ops da9210_buck_ops = { 50 50 .enable = regulator_enable_regmap, 51 51 .disable = regulator_disable_regmap, 52 52 .is_enabled = regulator_is_enabled_regmap,
+1 -1
drivers/regulator/da9211-regulator.c
··· 219 219 return current_limits[data]; 220 220 } 221 221 222 - static struct regulator_ops da9211_buck_ops = { 222 + static const struct regulator_ops da9211_buck_ops = { 223 223 .get_mode = da9211_buck_get_mode, 224 224 .set_mode = da9211_buck_set_mode, 225 225 .enable = regulator_enable_regmap,