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

mfd: Constify struct mfd_cell where possible

As of commit 03e361b25ee8dfb1fd9b890072c23c4aae01c6c7 ("mfd: Stop setting
refcounting pointers in original mfd_cell arrays"), the "cell" parameter of
mfd_add_devices() is "const" again. Hence make all cell data passed to
mfd_add_devices() const where possible.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Geert Uytterhoeven and committed by
Lee Jones
5ac98553 2977dc92

+37 -37
+7 -7
drivers/mfd/ab8500-core.c
··· 1017 1017 }, 1018 1018 }; 1019 1019 1020 - static struct mfd_cell ab8500_bm_devs[] = { 1020 + static const struct mfd_cell ab8500_bm_devs[] = { 1021 1021 { 1022 1022 .name = "ab8500-charger", 1023 1023 .of_compatible = "stericsson,ab8500-charger", ··· 1052 1052 }, 1053 1053 }; 1054 1054 1055 - static struct mfd_cell ab8500_devs[] = { 1055 + static const struct mfd_cell ab8500_devs[] = { 1056 1056 #ifdef CONFIG_DEBUG_FS 1057 1057 { 1058 1058 .name = "ab8500-debug", ··· 1143 1143 }, 1144 1144 }; 1145 1145 1146 - static struct mfd_cell ab9540_devs[] = { 1146 + static const struct mfd_cell ab9540_devs[] = { 1147 1147 #ifdef CONFIG_DEBUG_FS 1148 1148 { 1149 1149 .name = "ab8500-debug", ··· 1214 1214 }; 1215 1215 1216 1216 /* Device list for ab8505 */ 1217 - static struct mfd_cell ab8505_devs[] = { 1217 + static const struct mfd_cell ab8505_devs[] = { 1218 1218 #ifdef CONFIG_DEBUG_FS 1219 1219 { 1220 1220 .name = "ab8500-debug", ··· 1275 1275 }, 1276 1276 }; 1277 1277 1278 - static struct mfd_cell ab8540_devs[] = { 1278 + static const struct mfd_cell ab8540_devs[] = { 1279 1279 #ifdef CONFIG_DEBUG_FS 1280 1280 { 1281 1281 .name = "ab8500-debug", ··· 1339 1339 }, 1340 1340 }; 1341 1341 1342 - static struct mfd_cell ab8540_cut1_devs[] = { 1342 + static const struct mfd_cell ab8540_cut1_devs[] = { 1343 1343 { 1344 1344 .name = "ab8500-rtc", 1345 1345 .of_compatible = "stericsson,ab8500-rtc", ··· 1348 1348 }, 1349 1349 }; 1350 1350 1351 - static struct mfd_cell ab8540_cut2_devs[] = { 1351 + static const struct mfd_cell ab8540_cut2_devs[] = { 1352 1352 { 1353 1353 .name = "ab8540-rtc", 1354 1354 .of_compatible = "stericsson,ab8540-rtc",
+4 -4
drivers/mfd/arizona-core.c
··· 565 565 } 566 566 #endif 567 567 568 - static struct mfd_cell early_devs[] = { 568 + static const struct mfd_cell early_devs[] = { 569 569 { .name = "arizona-ldo1" }, 570 570 }; 571 571 ··· 577 577 "SPKVDDR", 578 578 }; 579 579 580 - static struct mfd_cell wm5102_devs[] = { 580 + static const struct mfd_cell wm5102_devs[] = { 581 581 { .name = "arizona-micsupp" }, 582 582 { .name = "arizona-extcon" }, 583 583 { .name = "arizona-gpio" }, ··· 590 590 }, 591 591 }; 592 592 593 - static struct mfd_cell wm5110_devs[] = { 593 + static const struct mfd_cell wm5110_devs[] = { 594 594 { .name = "arizona-micsupp" }, 595 595 { .name = "arizona-extcon" }, 596 596 { .name = "arizona-gpio" }, ··· 609 609 "SPKVDD", 610 610 }; 611 611 612 - static struct mfd_cell wm8997_devs[] = { 612 + static const struct mfd_cell wm8997_devs[] = { 613 613 { .name = "arizona-micsupp" }, 614 614 { .name = "arizona-extcon" }, 615 615 { .name = "arizona-gpio" },
+1 -1
drivers/mfd/as3722.c
··· 54 54 }, 55 55 }; 56 56 57 - static struct mfd_cell as3722_devs[] = { 57 + static const struct mfd_cell as3722_devs[] = { 58 58 { 59 59 .name = "as3722-pinctrl", 60 60 },
+2 -2
drivers/mfd/asic3.c
··· 695 695 return 0; 696 696 } 697 697 698 - static struct mfd_cell asic3_cell_ds1wm = { 698 + static const struct mfd_cell asic3_cell_ds1wm = { 699 699 .name = "ds1wm", 700 700 .enable = ds1wm_enable, 701 701 .disable = ds1wm_disable, ··· 797 797 return 0; 798 798 } 799 799 800 - static struct mfd_cell asic3_cell_mmc = { 800 + static const struct mfd_cell asic3_cell_mmc = { 801 801 .name = "tmio-mmc", 802 802 .enable = asic3_mmc_enable, 803 803 .disable = asic3_mmc_disable,
+1 -1
drivers/mfd/cros_ec.c
··· 84 84 return IRQ_HANDLED; 85 85 } 86 86 87 - static struct mfd_cell cros_devs[] = { 87 + static const struct mfd_cell cros_devs[] = { 88 88 { 89 89 .name = "cros-ec-keyb", 90 90 .id = 1,
+2 -2
drivers/mfd/db8500-prcmu.c
··· 3070 3070 .num_trips = 4, 3071 3071 }; 3072 3072 3073 - static struct mfd_cell common_prcmu_devs[] = { 3073 + static const struct mfd_cell common_prcmu_devs[] = { 3074 3074 { 3075 3075 .name = "ux500_wdt", 3076 3076 .platform_data = &db8500_wdt_pdata, ··· 3079 3079 }, 3080 3080 }; 3081 3081 3082 - static struct mfd_cell db8500_prcmu_devs[] = { 3082 + static const struct mfd_cell db8500_prcmu_devs[] = { 3083 3083 { 3084 3084 .name = "db8500-prcmu-regulators", 3085 3085 .of_compatible = "stericsson,db8500-prcmu-regulator",
+1 -1
drivers/mfd/htc-pasic3.c
··· 114 114 }, 115 115 }; 116 116 117 - static struct mfd_cell ds1wm_cell __initdata = { 117 + static const struct mfd_cell ds1wm_cell __initconst = { 118 118 .name = "ds1wm", 119 119 .enable = ds1wm_enable, 120 120 .disable = ds1wm_disable,
+1 -1
drivers/mfd/jz4740-adc.c
··· 181 181 }, 182 182 }; 183 183 184 - static struct mfd_cell jz4740_adc_cells[] = { 184 + static const struct mfd_cell jz4740_adc_cells[] = { 185 185 { 186 186 .id = 0, 187 187 .name = "jz4740-hwmon",
+1 -1
drivers/mfd/lp8788.c
··· 71 71 }, 72 72 }; 73 73 74 - static struct mfd_cell lp8788_devs[] = { 74 + static const struct mfd_cell lp8788_devs[] = { 75 75 /* 4 bucks */ 76 76 MFD_DEV_WITH_ID(BUCK, 1), 77 77 MFD_DEV_WITH_ID(BUCK, 2),
+1 -1
drivers/mfd/rc5t583.c
··· 74 74 #define EXT_PWR_REQ \ 75 75 (RC5T583_EXT_PWRREQ1_CONTROL | RC5T583_EXT_PWRREQ2_CONTROL) 76 76 77 - static struct mfd_cell rc5t583_subdevs[] = { 77 + static const struct mfd_cell rc5t583_subdevs[] = { 78 78 {.name = "rc5t583-gpio",}, 79 79 {.name = "rc5t583-regulator",}, 80 80 {.name = "rc5t583-rtc", },
+1 -1
drivers/mfd/rdc321x-southbridge.c
··· 56 56 } 57 57 }; 58 58 59 - static struct mfd_cell rdc321x_sb_cells[] = { 59 + static const struct mfd_cell rdc321x_sb_cells[] = { 60 60 { 61 61 .name = "rdc321x-wdt", 62 62 .resources = rdc321x_wdt_resource,
+3 -3
drivers/mfd/retu-mfd.c
··· 55 55 }, 56 56 }; 57 57 58 - static struct mfd_cell retu_devs[] = { 58 + static const struct mfd_cell retu_devs[] = { 59 59 { 60 60 .name = "retu-wdt" 61 61 }, ··· 94 94 }, 95 95 }; 96 96 97 - static struct mfd_cell tahvo_devs[] = { 97 + static const struct mfd_cell tahvo_devs[] = { 98 98 { 99 99 .name = "tahvo-usb", 100 100 .resources = tahvo_usb_res, ··· 122 122 char *chip_name; 123 123 char *companion_name; 124 124 struct regmap_irq_chip *irq_chip; 125 - struct mfd_cell *children; 125 + const struct mfd_cell *children; 126 126 int nchildren; 127 127 } retu_data[] = { 128 128 [0] = {
+4 -4
drivers/mfd/sec-core.c
··· 31 31 #include <linux/mfd/samsung/s5m8767.h> 32 32 #include <linux/regmap.h> 33 33 34 - static struct mfd_cell s5m8751_devs[] = { 34 + static const struct mfd_cell s5m8751_devs[] = { 35 35 { 36 36 .name = "s5m8751-pmic", 37 37 }, { ··· 41 41 }, 42 42 }; 43 43 44 - static struct mfd_cell s5m8763_devs[] = { 44 + static const struct mfd_cell s5m8763_devs[] = { 45 45 { 46 46 .name = "s5m8763-pmic", 47 47 }, { ··· 51 51 }, 52 52 }; 53 53 54 - static struct mfd_cell s5m8767_devs[] = { 54 + static const struct mfd_cell s5m8767_devs[] = { 55 55 { 56 56 .name = "s5m8767-pmic", 57 57 }, { ··· 59 59 }, 60 60 }; 61 61 62 - static struct mfd_cell s2mps11_devs[] = { 62 + static const struct mfd_cell s2mps11_devs[] = { 63 63 { 64 64 .name = "s2mps11-pmic", 65 65 }, {
+6 -6
drivers/mfd/timberdale.c
··· 374 374 }, 375 375 }; 376 376 377 - static struct mfd_cell timberdale_cells_bar0_cfg0[] = { 377 + static const struct mfd_cell timberdale_cells_bar0_cfg0[] = { 378 378 { 379 379 .name = "timb-dma", 380 380 .num_resources = ARRAY_SIZE(timberdale_dma_resources), ··· 431 431 }, 432 432 }; 433 433 434 - static struct mfd_cell timberdale_cells_bar0_cfg1[] = { 434 + static const struct mfd_cell timberdale_cells_bar0_cfg1[] = { 435 435 { 436 436 .name = "timb-dma", 437 437 .num_resources = ARRAY_SIZE(timberdale_dma_resources), ··· 498 498 }, 499 499 }; 500 500 501 - static struct mfd_cell timberdale_cells_bar0_cfg2[] = { 501 + static const struct mfd_cell timberdale_cells_bar0_cfg2[] = { 502 502 { 503 503 .name = "timb-dma", 504 504 .num_resources = ARRAY_SIZE(timberdale_dma_resources), ··· 548 548 }, 549 549 }; 550 550 551 - static struct mfd_cell timberdale_cells_bar0_cfg3[] = { 551 + static const struct mfd_cell timberdale_cells_bar0_cfg3[] = { 552 552 { 553 553 .name = "timb-dma", 554 554 .num_resources = ARRAY_SIZE(timberdale_dma_resources), ··· 619 619 }, 620 620 }; 621 621 622 - static struct mfd_cell timberdale_cells_bar1[] = { 622 + static const struct mfd_cell timberdale_cells_bar1[] = { 623 623 { 624 624 .name = "sdhci", 625 625 .num_resources = ARRAY_SIZE(timberdale_sdhc_resources), ··· 627 627 }, 628 628 }; 629 629 630 - static struct mfd_cell timberdale_cells_bar2[] = { 630 + static const struct mfd_cell timberdale_cells_bar2[] = { 631 631 { 632 632 .name = "sdhci", 633 633 .num_resources = ARRAY_SIZE(timberdale_sdhc_resources),
+1 -1
drivers/mfd/viperboard.c
··· 37 37 38 38 MODULE_DEVICE_TABLE(usb, vprbrd_table); 39 39 40 - static struct mfd_cell vprbrd_devs[] = { 40 + static const struct mfd_cell vprbrd_devs[] = { 41 41 { 42 42 .name = "viperboard-gpio", 43 43 },
+1 -1
drivers/mfd/vx855.c
··· 60 60 }, 61 61 }; 62 62 63 - static struct mfd_cell vx855_cells[] = { 63 + static const struct mfd_cell vx855_cells[] = { 64 64 { 65 65 .name = "vx855_gpio", 66 66 .num_resources = ARRAY_SIZE(vx855_gpio_resources),