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

Merge series "regulator/qcom: Constify static structs" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:

Constify some static structs to allow the compiler to put them in
read-only memory.

Rikard Falkeborn (2):
regulator: qcom_rpm: Constify struct regulator_ops
regulator: qcom_spmi: Constify struct regulator_ops

drivers/regulator/qcom_rpm-regulator.c | 6 +++---
drivers/regulator/qcom_spmi-regulator.c | 24 ++++++++++++------------
2 files changed, 15 insertions(+), 15 deletions(-)

--
2.27.0

+15 -15
+3 -3
drivers/regulator/qcom_rpm-regulator.c
··· 407 407 return ret; 408 408 } 409 409 410 - static struct regulator_ops uV_ops = { 410 + static const struct regulator_ops uV_ops = { 411 411 .list_voltage = regulator_list_voltage_linear_range, 412 412 413 413 .set_voltage_sel = rpm_reg_set_uV_sel, ··· 420 420 .set_load = rpm_reg_set_load, 421 421 }; 422 422 423 - static struct regulator_ops mV_ops = { 423 + static const struct regulator_ops mV_ops = { 424 424 .list_voltage = regulator_list_voltage_linear_range, 425 425 426 426 .set_voltage_sel = rpm_reg_set_mV_sel, ··· 433 433 .set_load = rpm_reg_set_load, 434 434 }; 435 435 436 - static struct regulator_ops switch_ops = { 436 + static const struct regulator_ops switch_ops = { 437 437 .enable = rpm_reg_switch_enable, 438 438 .disable = rpm_reg_switch_disable, 439 439 .is_enabled = rpm_reg_is_enabled,
+12 -12
drivers/regulator/qcom_spmi-regulator.c
··· 380 380 enum spmi_regulator_logical_type logical_type; 381 381 u32 revision_min; 382 382 u32 revision_max; 383 - struct regulator_ops *ops; 383 + const struct regulator_ops *ops; 384 384 struct spmi_voltage_set_points *set_points; 385 385 int hpm_min_load; 386 386 }; ··· 1261 1261 1262 1262 static struct regulator_ops spmi_saw_ops = {}; 1263 1263 1264 - static struct regulator_ops spmi_smps_ops = { 1264 + static const struct regulator_ops spmi_smps_ops = { 1265 1265 .enable = regulator_enable_regmap, 1266 1266 .disable = regulator_disable_regmap, 1267 1267 .is_enabled = regulator_is_enabled_regmap, ··· 1276 1276 .set_pull_down = spmi_regulator_common_set_pull_down, 1277 1277 }; 1278 1278 1279 - static struct regulator_ops spmi_ldo_ops = { 1279 + static const struct regulator_ops spmi_ldo_ops = { 1280 1280 .enable = regulator_enable_regmap, 1281 1281 .disable = regulator_disable_regmap, 1282 1282 .is_enabled = regulator_is_enabled_regmap, ··· 1293 1293 .set_soft_start = spmi_regulator_common_set_soft_start, 1294 1294 }; 1295 1295 1296 - static struct regulator_ops spmi_ln_ldo_ops = { 1296 + static const struct regulator_ops spmi_ln_ldo_ops = { 1297 1297 .enable = regulator_enable_regmap, 1298 1298 .disable = regulator_disable_regmap, 1299 1299 .is_enabled = regulator_is_enabled_regmap, ··· 1305 1305 .get_bypass = spmi_regulator_common_get_bypass, 1306 1306 }; 1307 1307 1308 - static struct regulator_ops spmi_vs_ops = { 1308 + static const struct regulator_ops spmi_vs_ops = { 1309 1309 .enable = spmi_regulator_vs_enable, 1310 1310 .disable = regulator_disable_regmap, 1311 1311 .is_enabled = regulator_is_enabled_regmap, ··· 1316 1316 .get_mode = spmi_regulator_common_get_mode, 1317 1317 }; 1318 1318 1319 - static struct regulator_ops spmi_boost_ops = { 1319 + static const struct regulator_ops spmi_boost_ops = { 1320 1320 .enable = regulator_enable_regmap, 1321 1321 .disable = regulator_disable_regmap, 1322 1322 .is_enabled = regulator_is_enabled_regmap, ··· 1327 1327 .set_input_current_limit = spmi_regulator_set_ilim, 1328 1328 }; 1329 1329 1330 - static struct regulator_ops spmi_ftsmps_ops = { 1330 + static const struct regulator_ops spmi_ftsmps_ops = { 1331 1331 .enable = regulator_enable_regmap, 1332 1332 .disable = regulator_disable_regmap, 1333 1333 .is_enabled = regulator_is_enabled_regmap, ··· 1342 1342 .set_pull_down = spmi_regulator_common_set_pull_down, 1343 1343 }; 1344 1344 1345 - static struct regulator_ops spmi_ult_lo_smps_ops = { 1345 + static const struct regulator_ops spmi_ult_lo_smps_ops = { 1346 1346 .enable = regulator_enable_regmap, 1347 1347 .disable = regulator_disable_regmap, 1348 1348 .is_enabled = regulator_is_enabled_regmap, ··· 1356 1356 .set_pull_down = spmi_regulator_common_set_pull_down, 1357 1357 }; 1358 1358 1359 - static struct regulator_ops spmi_ult_ho_smps_ops = { 1359 + static const struct regulator_ops spmi_ult_ho_smps_ops = { 1360 1360 .enable = regulator_enable_regmap, 1361 1361 .disable = regulator_disable_regmap, 1362 1362 .is_enabled = regulator_is_enabled_regmap, ··· 1371 1371 .set_pull_down = spmi_regulator_common_set_pull_down, 1372 1372 }; 1373 1373 1374 - static struct regulator_ops spmi_ult_ldo_ops = { 1374 + static const struct regulator_ops spmi_ult_ldo_ops = { 1375 1375 .enable = regulator_enable_regmap, 1376 1376 .disable = regulator_disable_regmap, 1377 1377 .is_enabled = regulator_is_enabled_regmap, ··· 1388 1388 .set_soft_start = spmi_regulator_common_set_soft_start, 1389 1389 }; 1390 1390 1391 - static struct regulator_ops spmi_ftsmps426_ops = { 1391 + static const struct regulator_ops spmi_ftsmps426_ops = { 1392 1392 .enable = regulator_enable_regmap, 1393 1393 .disable = regulator_disable_regmap, 1394 1394 .is_enabled = regulator_is_enabled_regmap, ··· 1403 1403 .set_pull_down = spmi_regulator_common_set_pull_down, 1404 1404 }; 1405 1405 1406 - static struct regulator_ops spmi_hfs430_ops = { 1406 + static const struct regulator_ops spmi_hfs430_ops = { 1407 1407 .enable = regulator_enable_regmap, 1408 1408 .disable = regulator_disable_regmap, 1409 1409 .is_enabled = regulator_is_enabled_regmap,