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

Configure Feed

Select the types of activity you want to include in your feed.

regulator: ab3100: Constify regulator_ops and ab3100_regulator_desc

These regulator_ops variables and ab3100_regulator_desc 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
95602d7d 0ae3b061

+7 -7
+7 -7
drivers/regulator/ab3100.c
··· 353 353 return 0; 354 354 } 355 355 356 - static struct regulator_ops regulator_ops_fixed = { 356 + static const struct regulator_ops regulator_ops_fixed = { 357 357 .list_voltage = regulator_list_voltage_linear, 358 358 .enable = ab3100_enable_regulator, 359 359 .disable = ab3100_disable_regulator, 360 360 .is_enabled = ab3100_is_enabled_regulator, 361 361 }; 362 362 363 - static struct regulator_ops regulator_ops_variable = { 363 + static const struct regulator_ops regulator_ops_variable = { 364 364 .enable = ab3100_enable_regulator, 365 365 .disable = ab3100_disable_regulator, 366 366 .is_enabled = ab3100_is_enabled_regulator, ··· 369 369 .list_voltage = regulator_list_voltage_table, 370 370 }; 371 371 372 - static struct regulator_ops regulator_ops_variable_sleepable = { 372 + static const struct regulator_ops regulator_ops_variable_sleepable = { 373 373 .enable = ab3100_enable_regulator, 374 374 .disable = ab3100_disable_regulator, 375 375 .is_enabled = ab3100_is_enabled_regulator, ··· 385 385 * is an on/off switch plain an simple. The external 386 386 * voltage is defined in the board set-up if any. 387 387 */ 388 - static struct regulator_ops regulator_ops_external = { 388 + static const struct regulator_ops regulator_ops_external = { 389 389 .enable = ab3100_enable_regulator, 390 390 .disable = ab3100_disable_regulator, 391 391 .is_enabled = ab3100_is_enabled_regulator, 392 392 .get_voltage = ab3100_get_voltage_regulator_external, 393 393 }; 394 394 395 - static struct regulator_desc 395 + static const struct regulator_desc 396 396 ab3100_regulator_desc[AB3100_NUM_REGULATORS] = { 397 397 { 398 398 .name = "LDO_A", ··· 499 499 struct device_node *np, 500 500 unsigned long id) 501 501 { 502 - struct regulator_desc *desc; 502 + const struct regulator_desc *desc; 503 503 struct ab3100_regulator *reg; 504 504 struct regulator_dev *rdev; 505 505 struct regulator_config config = { }; ··· 688 688 689 689 /* Register the regulators */ 690 690 for (i = 0; i < AB3100_NUM_REGULATORS; i++) { 691 - struct regulator_desc *desc = &ab3100_regulator_desc[i]; 691 + const struct regulator_desc *desc = &ab3100_regulator_desc[i]; 692 692 693 693 err = ab3100_regulator_register(pdev, plfdata, NULL, NULL, 694 694 desc->id);