diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-01-28 09:53:55 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-31 15:57:00 -0500 |
commit | 0e5a768008f0b27d4cd75ed3d03794fe4672902b (patch) | |
tree | 50ab90d1f070284edfa11719bb2871be28368bca | |
parent | d00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff) |
regulator: palmas-regulator: constify regulator_ops structure
Declare regulator_ops structure as const as it is only stored in the ops
field of a regulator_desc structure. This field is of type const, so
regulator_ops structures having this property can be made const too.
File size before: drivers/regulator/palmas-regulator.o
text data bss dec hex filename
9752 6296 288 16336 3fd0 regulator/palmas-regulator.o
File size after: drivers/regulator/palmas-regulator.o
text data bss dec hex filename
12856 3480 8 16344 3fd0 regulator/palmas-regulator.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/palmas-regulator.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index f11d41dad9c1..31ae5ee3a80d 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -528,7 +528,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, | |||
528 | return ret; | 528 | return ret; |
529 | } | 529 | } |
530 | 530 | ||
531 | static struct regulator_ops palmas_ops_smps = { | 531 | static const struct regulator_ops palmas_ops_smps = { |
532 | .is_enabled = regulator_is_enabled_regmap, | 532 | .is_enabled = regulator_is_enabled_regmap, |
533 | .enable = regulator_enable_regmap, | 533 | .enable = regulator_enable_regmap, |
534 | .disable = regulator_disable_regmap, | 534 | .disable = regulator_disable_regmap, |
@@ -542,7 +542,7 @@ static struct regulator_ops palmas_ops_smps = { | |||
542 | .set_ramp_delay = palmas_smps_set_ramp_delay, | 542 | .set_ramp_delay = palmas_smps_set_ramp_delay, |
543 | }; | 543 | }; |
544 | 544 | ||
545 | static struct regulator_ops palmas_ops_ext_control_smps = { | 545 | static const struct regulator_ops palmas_ops_ext_control_smps = { |
546 | .set_mode = palmas_set_mode_smps, | 546 | .set_mode = palmas_set_mode_smps, |
547 | .get_mode = palmas_get_mode_smps, | 547 | .get_mode = palmas_get_mode_smps, |
548 | .get_voltage_sel = regulator_get_voltage_sel_regmap, | 548 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
@@ -553,7 +553,7 @@ static struct regulator_ops palmas_ops_ext_control_smps = { | |||
553 | .set_ramp_delay = palmas_smps_set_ramp_delay, | 553 | .set_ramp_delay = palmas_smps_set_ramp_delay, |
554 | }; | 554 | }; |
555 | 555 | ||
556 | static struct regulator_ops palmas_ops_smps10 = { | 556 | static const struct regulator_ops palmas_ops_smps10 = { |
557 | .is_enabled = regulator_is_enabled_regmap, | 557 | .is_enabled = regulator_is_enabled_regmap, |
558 | .enable = regulator_enable_regmap, | 558 | .enable = regulator_enable_regmap, |
559 | .disable = regulator_disable_regmap, | 559 | .disable = regulator_disable_regmap, |
@@ -565,7 +565,7 @@ static struct regulator_ops palmas_ops_smps10 = { | |||
565 | .get_bypass = regulator_get_bypass_regmap, | 565 | .get_bypass = regulator_get_bypass_regmap, |
566 | }; | 566 | }; |
567 | 567 | ||
568 | static struct regulator_ops tps65917_ops_smps = { | 568 | static const struct regulator_ops tps65917_ops_smps = { |
569 | .is_enabled = regulator_is_enabled_regmap, | 569 | .is_enabled = regulator_is_enabled_regmap, |
570 | .enable = regulator_enable_regmap, | 570 | .enable = regulator_enable_regmap, |
571 | .disable = regulator_disable_regmap, | 571 | .disable = regulator_disable_regmap, |
@@ -578,7 +578,7 @@ static struct regulator_ops tps65917_ops_smps = { | |||
578 | .set_voltage_time_sel = regulator_set_voltage_time_sel, | 578 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
579 | }; | 579 | }; |
580 | 580 | ||
581 | static struct regulator_ops tps65917_ops_ext_control_smps = { | 581 | static const struct regulator_ops tps65917_ops_ext_control_smps = { |
582 | .set_mode = palmas_set_mode_smps, | 582 | .set_mode = palmas_set_mode_smps, |
583 | .get_mode = palmas_get_mode_smps, | 583 | .get_mode = palmas_get_mode_smps, |
584 | .get_voltage_sel = regulator_get_voltage_sel_regmap, | 584 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
@@ -602,7 +602,7 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) | |||
602 | return !!(reg); | 602 | return !!(reg); |
603 | } | 603 | } |
604 | 604 | ||
605 | static struct regulator_ops palmas_ops_ldo = { | 605 | static const struct regulator_ops palmas_ops_ldo = { |
606 | .is_enabled = palmas_is_enabled_ldo, | 606 | .is_enabled = palmas_is_enabled_ldo, |
607 | .enable = regulator_enable_regmap, | 607 | .enable = regulator_enable_regmap, |
608 | .disable = regulator_disable_regmap, | 608 | .disable = regulator_disable_regmap, |
@@ -612,7 +612,7 @@ static struct regulator_ops palmas_ops_ldo = { | |||
612 | .map_voltage = regulator_map_voltage_linear, | 612 | .map_voltage = regulator_map_voltage_linear, |
613 | }; | 613 | }; |
614 | 614 | ||
615 | static struct regulator_ops palmas_ops_ldo9 = { | 615 | static const struct regulator_ops palmas_ops_ldo9 = { |
616 | .is_enabled = palmas_is_enabled_ldo, | 616 | .is_enabled = palmas_is_enabled_ldo, |
617 | .enable = regulator_enable_regmap, | 617 | .enable = regulator_enable_regmap, |
618 | .disable = regulator_disable_regmap, | 618 | .disable = regulator_disable_regmap, |
@@ -624,23 +624,23 @@ static struct regulator_ops palmas_ops_ldo9 = { | |||
624 | .get_bypass = regulator_get_bypass_regmap, | 624 | .get_bypass = regulator_get_bypass_regmap, |
625 | }; | 625 | }; |
626 | 626 | ||
627 | static struct regulator_ops palmas_ops_ext_control_ldo = { | 627 | static const struct regulator_ops palmas_ops_ext_control_ldo = { |
628 | .get_voltage_sel = regulator_get_voltage_sel_regmap, | 628 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
629 | .set_voltage_sel = regulator_set_voltage_sel_regmap, | 629 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
630 | .list_voltage = regulator_list_voltage_linear, | 630 | .list_voltage = regulator_list_voltage_linear, |
631 | .map_voltage = regulator_map_voltage_linear, | 631 | .map_voltage = regulator_map_voltage_linear, |
632 | }; | 632 | }; |
633 | 633 | ||
634 | static struct regulator_ops palmas_ops_extreg = { | 634 | static const struct regulator_ops palmas_ops_extreg = { |
635 | .is_enabled = regulator_is_enabled_regmap, | 635 | .is_enabled = regulator_is_enabled_regmap, |
636 | .enable = regulator_enable_regmap, | 636 | .enable = regulator_enable_regmap, |
637 | .disable = regulator_disable_regmap, | 637 | .disable = regulator_disable_regmap, |
638 | }; | 638 | }; |
639 | 639 | ||
640 | static struct regulator_ops palmas_ops_ext_control_extreg = { | 640 | static const struct regulator_ops palmas_ops_ext_control_extreg = { |
641 | }; | 641 | }; |
642 | 642 | ||
643 | static struct regulator_ops tps65917_ops_ldo = { | 643 | static const struct regulator_ops tps65917_ops_ldo = { |
644 | .is_enabled = palmas_is_enabled_ldo, | 644 | .is_enabled = palmas_is_enabled_ldo, |
645 | .enable = regulator_enable_regmap, | 645 | .enable = regulator_enable_regmap, |
646 | .disable = regulator_disable_regmap, | 646 | .disable = regulator_disable_regmap, |
@@ -651,7 +651,7 @@ static struct regulator_ops tps65917_ops_ldo = { | |||
651 | .set_voltage_time_sel = regulator_set_voltage_time_sel, | 651 | .set_voltage_time_sel = regulator_set_voltage_time_sel, |
652 | }; | 652 | }; |
653 | 653 | ||
654 | static struct regulator_ops tps65917_ops_ldo_1_2 = { | 654 | static const struct regulator_ops tps65917_ops_ldo_1_2 = { |
655 | .is_enabled = palmas_is_enabled_ldo, | 655 | .is_enabled = palmas_is_enabled_ldo, |
656 | .enable = regulator_enable_regmap, | 656 | .enable = regulator_enable_regmap, |
657 | .disable = regulator_disable_regmap, | 657 | .disable = regulator_disable_regmap, |