diff options
author | Chen-Yu Tsai <wens@csie.org> | 2018-03-29 00:31:13 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2018-05-16 04:21:48 -0400 |
commit | 531a469ead6ad1e79e8c84ffd4787c0747336e5a (patch) | |
tree | a8ca5779ac5f8e491a73009b8f16d45b81d325e5 | |
parent | b16d23931b7ee5acf17432c3a6b5c6edb204aa35 (diff) |
mfd: axp20x: Constify struct mfd_cell and struct resource
The axp20x driver has lots of mfd_cell and resource structs.
These can all be const-ified.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/mfd/axp20x.c | 44 | ||||
-rw-r--r-- | include/linux/mfd/axp20x.h | 2 |
2 files changed, 23 insertions, 23 deletions
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index aaf2acbef701..14be0f658d74 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c | |||
@@ -169,18 +169,18 @@ static const struct regmap_access_table axp806_volatile_table = { | |||
169 | .n_yes_ranges = ARRAY_SIZE(axp806_volatile_ranges), | 169 | .n_yes_ranges = ARRAY_SIZE(axp806_volatile_ranges), |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static struct resource axp152_pek_resources[] = { | 172 | static const struct resource axp152_pek_resources[] = { |
173 | DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_RIS_EDGE, "PEK_DBR"), | 173 | DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_RIS_EDGE, "PEK_DBR"), |
174 | DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_FAL_EDGE, "PEK_DBF"), | 174 | DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_FAL_EDGE, "PEK_DBF"), |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static struct resource axp20x_ac_power_supply_resources[] = { | 177 | static const struct resource axp20x_ac_power_supply_resources[] = { |
178 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_PLUGIN, "ACIN_PLUGIN"), | 178 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_PLUGIN, "ACIN_PLUGIN"), |
179 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_REMOVAL, "ACIN_REMOVAL"), | 179 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_REMOVAL, "ACIN_REMOVAL"), |
180 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_OVER_V, "ACIN_OVER_V"), | 180 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_OVER_V, "ACIN_OVER_V"), |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static struct resource axp20x_pek_resources[] = { | 183 | static const struct resource axp20x_pek_resources[] = { |
184 | { | 184 | { |
185 | .name = "PEK_DBR", | 185 | .name = "PEK_DBR", |
186 | .start = AXP20X_IRQ_PEK_RIS_EDGE, | 186 | .start = AXP20X_IRQ_PEK_RIS_EDGE, |
@@ -194,19 +194,19 @@ static struct resource axp20x_pek_resources[] = { | |||
194 | }, | 194 | }, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | static struct resource axp20x_usb_power_supply_resources[] = { | 197 | static const struct resource axp20x_usb_power_supply_resources[] = { |
198 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"), | 198 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"), |
199 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), | 199 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), |
200 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_VALID, "VBUS_VALID"), | 200 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_VALID, "VBUS_VALID"), |
201 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_NOT_VALID, "VBUS_NOT_VALID"), | 201 | DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_NOT_VALID, "VBUS_NOT_VALID"), |
202 | }; | 202 | }; |
203 | 203 | ||
204 | static struct resource axp22x_usb_power_supply_resources[] = { | 204 | static const struct resource axp22x_usb_power_supply_resources[] = { |
205 | DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"), | 205 | DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"), |
206 | DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), | 206 | DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), |
207 | }; | 207 | }; |
208 | 208 | ||
209 | static struct resource axp22x_pek_resources[] = { | 209 | static const struct resource axp22x_pek_resources[] = { |
210 | { | 210 | { |
211 | .name = "PEK_DBR", | 211 | .name = "PEK_DBR", |
212 | .start = AXP22X_IRQ_PEK_RIS_EDGE, | 212 | .start = AXP22X_IRQ_PEK_RIS_EDGE, |
@@ -220,7 +220,7 @@ static struct resource axp22x_pek_resources[] = { | |||
220 | }, | 220 | }, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | static struct resource axp288_power_button_resources[] = { | 223 | static const struct resource axp288_power_button_resources[] = { |
224 | { | 224 | { |
225 | .name = "PEK_DBR", | 225 | .name = "PEK_DBR", |
226 | .start = AXP288_IRQ_POKP, | 226 | .start = AXP288_IRQ_POKP, |
@@ -235,7 +235,7 @@ static struct resource axp288_power_button_resources[] = { | |||
235 | }, | 235 | }, |
236 | }; | 236 | }; |
237 | 237 | ||
238 | static struct resource axp288_fuel_gauge_resources[] = { | 238 | static const struct resource axp288_fuel_gauge_resources[] = { |
239 | { | 239 | { |
240 | .start = AXP288_IRQ_QWBTU, | 240 | .start = AXP288_IRQ_QWBTU, |
241 | .end = AXP288_IRQ_QWBTU, | 241 | .end = AXP288_IRQ_QWBTU, |
@@ -268,7 +268,7 @@ static struct resource axp288_fuel_gauge_resources[] = { | |||
268 | }, | 268 | }, |
269 | }; | 269 | }; |
270 | 270 | ||
271 | static struct resource axp803_pek_resources[] = { | 271 | static const struct resource axp803_pek_resources[] = { |
272 | { | 272 | { |
273 | .name = "PEK_DBR", | 273 | .name = "PEK_DBR", |
274 | .start = AXP803_IRQ_PEK_RIS_EDGE, | 274 | .start = AXP803_IRQ_PEK_RIS_EDGE, |
@@ -282,7 +282,7 @@ static struct resource axp803_pek_resources[] = { | |||
282 | }, | 282 | }, |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static struct resource axp809_pek_resources[] = { | 285 | static const struct resource axp809_pek_resources[] = { |
286 | { | 286 | { |
287 | .name = "PEK_DBR", | 287 | .name = "PEK_DBR", |
288 | .start = AXP809_IRQ_PEK_RIS_EDGE, | 288 | .start = AXP809_IRQ_PEK_RIS_EDGE, |
@@ -648,7 +648,7 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = { | |||
648 | .num_regs = 5, | 648 | .num_regs = 5, |
649 | }; | 649 | }; |
650 | 650 | ||
651 | static struct mfd_cell axp20x_cells[] = { | 651 | static const struct mfd_cell axp20x_cells[] = { |
652 | { | 652 | { |
653 | .name = "axp20x-gpio", | 653 | .name = "axp20x-gpio", |
654 | .of_compatible = "x-powers,axp209-gpio", | 654 | .of_compatible = "x-powers,axp209-gpio", |
@@ -677,7 +677,7 @@ static struct mfd_cell axp20x_cells[] = { | |||
677 | }, | 677 | }, |
678 | }; | 678 | }; |
679 | 679 | ||
680 | static struct mfd_cell axp221_cells[] = { | 680 | static const struct mfd_cell axp221_cells[] = { |
681 | { | 681 | { |
682 | .name = "axp221-pek", | 682 | .name = "axp221-pek", |
683 | .num_resources = ARRAY_SIZE(axp22x_pek_resources), | 683 | .num_resources = ARRAY_SIZE(axp22x_pek_resources), |
@@ -703,7 +703,7 @@ static struct mfd_cell axp221_cells[] = { | |||
703 | }, | 703 | }, |
704 | }; | 704 | }; |
705 | 705 | ||
706 | static struct mfd_cell axp223_cells[] = { | 706 | static const struct mfd_cell axp223_cells[] = { |
707 | { | 707 | { |
708 | .name = "axp221-pek", | 708 | .name = "axp221-pek", |
709 | .num_resources = ARRAY_SIZE(axp22x_pek_resources), | 709 | .num_resources = ARRAY_SIZE(axp22x_pek_resources), |
@@ -729,7 +729,7 @@ static struct mfd_cell axp223_cells[] = { | |||
729 | }, | 729 | }, |
730 | }; | 730 | }; |
731 | 731 | ||
732 | static struct mfd_cell axp152_cells[] = { | 732 | static const struct mfd_cell axp152_cells[] = { |
733 | { | 733 | { |
734 | .name = "axp20x-pek", | 734 | .name = "axp20x-pek", |
735 | .num_resources = ARRAY_SIZE(axp152_pek_resources), | 735 | .num_resources = ARRAY_SIZE(axp152_pek_resources), |
@@ -737,7 +737,7 @@ static struct mfd_cell axp152_cells[] = { | |||
737 | }, | 737 | }, |
738 | }; | 738 | }; |
739 | 739 | ||
740 | static struct resource axp288_adc_resources[] = { | 740 | static const struct resource axp288_adc_resources[] = { |
741 | { | 741 | { |
742 | .name = "GPADC", | 742 | .name = "GPADC", |
743 | .start = AXP288_IRQ_GPADC, | 743 | .start = AXP288_IRQ_GPADC, |
@@ -746,7 +746,7 @@ static struct resource axp288_adc_resources[] = { | |||
746 | }, | 746 | }, |
747 | }; | 747 | }; |
748 | 748 | ||
749 | static struct resource axp288_extcon_resources[] = { | 749 | static const struct resource axp288_extcon_resources[] = { |
750 | { | 750 | { |
751 | .start = AXP288_IRQ_VBUS_FALL, | 751 | .start = AXP288_IRQ_VBUS_FALL, |
752 | .end = AXP288_IRQ_VBUS_FALL, | 752 | .end = AXP288_IRQ_VBUS_FALL, |
@@ -769,7 +769,7 @@ static struct resource axp288_extcon_resources[] = { | |||
769 | }, | 769 | }, |
770 | }; | 770 | }; |
771 | 771 | ||
772 | static struct resource axp288_charger_resources[] = { | 772 | static const struct resource axp288_charger_resources[] = { |
773 | { | 773 | { |
774 | .start = AXP288_IRQ_OV, | 774 | .start = AXP288_IRQ_OV, |
775 | .end = AXP288_IRQ_OV, | 775 | .end = AXP288_IRQ_OV, |
@@ -817,7 +817,7 @@ static struct resource axp288_charger_resources[] = { | |||
817 | }, | 817 | }, |
818 | }; | 818 | }; |
819 | 819 | ||
820 | static struct mfd_cell axp288_cells[] = { | 820 | static const struct mfd_cell axp288_cells[] = { |
821 | { | 821 | { |
822 | .name = "axp288_adc", | 822 | .name = "axp288_adc", |
823 | .num_resources = ARRAY_SIZE(axp288_adc_resources), | 823 | .num_resources = ARRAY_SIZE(axp288_adc_resources), |
@@ -848,7 +848,7 @@ static struct mfd_cell axp288_cells[] = { | |||
848 | }, | 848 | }, |
849 | }; | 849 | }; |
850 | 850 | ||
851 | static struct mfd_cell axp803_cells[] = { | 851 | static const struct mfd_cell axp803_cells[] = { |
852 | { | 852 | { |
853 | .name = "axp221-pek", | 853 | .name = "axp221-pek", |
854 | .num_resources = ARRAY_SIZE(axp803_pek_resources), | 854 | .num_resources = ARRAY_SIZE(axp803_pek_resources), |
@@ -857,14 +857,14 @@ static struct mfd_cell axp803_cells[] = { | |||
857 | { .name = "axp20x-regulator" }, | 857 | { .name = "axp20x-regulator" }, |
858 | }; | 858 | }; |
859 | 859 | ||
860 | static struct mfd_cell axp806_cells[] = { | 860 | static const struct mfd_cell axp806_cells[] = { |
861 | { | 861 | { |
862 | .id = 2, | 862 | .id = 2, |
863 | .name = "axp20x-regulator", | 863 | .name = "axp20x-regulator", |
864 | }, | 864 | }, |
865 | }; | 865 | }; |
866 | 866 | ||
867 | static struct mfd_cell axp809_cells[] = { | 867 | static const struct mfd_cell axp809_cells[] = { |
868 | { | 868 | { |
869 | .name = "axp221-pek", | 869 | .name = "axp221-pek", |
870 | .num_resources = ARRAY_SIZE(axp809_pek_resources), | 870 | .num_resources = ARRAY_SIZE(axp809_pek_resources), |
@@ -875,7 +875,7 @@ static struct mfd_cell axp809_cells[] = { | |||
875 | }, | 875 | }, |
876 | }; | 876 | }; |
877 | 877 | ||
878 | static struct mfd_cell axp813_cells[] = { | 878 | static const struct mfd_cell axp813_cells[] = { |
879 | { | 879 | { |
880 | .name = "axp221-pek", | 880 | .name = "axp221-pek", |
881 | .num_resources = ARRAY_SIZE(axp803_pek_resources), | 881 | .num_resources = ARRAY_SIZE(axp803_pek_resources), |
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 82bf7747b312..a2489363a998 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h | |||
@@ -642,7 +642,7 @@ struct axp20x_dev { | |||
642 | struct regmap_irq_chip_data *regmap_irqc; | 642 | struct regmap_irq_chip_data *regmap_irqc; |
643 | long variant; | 643 | long variant; |
644 | int nr_cells; | 644 | int nr_cells; |
645 | struct mfd_cell *cells; | 645 | const struct mfd_cell *cells; |
646 | const struct regmap_config *regmap_cfg; | 646 | const struct regmap_config *regmap_cfg; |
647 | const struct regmap_irq_chip *regmap_irq_chip; | 647 | const struct regmap_irq_chip *regmap_irq_chip; |
648 | }; | 648 | }; |