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: Drop obsolete dependencies on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

It is actually better to always build such drivers with OF enabled,
so that the test builds are closer to how each driver will actually be
built on its intended target. Building them without OF may not test
much as the compiler will optimize out potentially large parts of the
code. In the worst case, this could even pop false positive warnings.
Dropping COMPILE_TEST here improves the quality of our testing and
avoids wasting time on non-existent issues.

As a minor optimization, this also lets us drop several occurrences of
of_match_ptr(), __maybe_unused and some ifdef guarding, as we now know
what all of this will resolve to, we might as well save cpp some work.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Icenowy Zheng <icenowy@aosc.io>
Link: https://lore.kernel.org/r/20221124144708.64371b98@endymion.delvare
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jean Delvare and committed by
Mark Brown
c4b02c92 c9f9ef15

+17 -21
+5 -5
drivers/regulator/Kconfig
··· 377 377 378 378 config REGULATOR_FAN53880 379 379 tristate "Fairchild FAN53880 Regulator" 380 - depends on I2C && (OF || COMPILE_TEST) 380 + depends on I2C && OF 381 381 select REGMAP_I2C 382 382 help 383 383 This driver supports Fairchild (ON Semiconductor) FAN53880 ··· 743 743 744 744 config REGULATOR_MP886X 745 745 tristate "MPS MP8869 regulator driver" 746 - depends on I2C && (OF || COMPILE_TEST) 746 + depends on I2C && OF 747 747 select REGMAP_I2C 748 748 help 749 749 This driver supports the MP8869 voltage regulator. ··· 1299 1299 1300 1300 config REGULATOR_SY8106A 1301 1301 tristate "Silergy SY8106A regulator" 1302 - depends on I2C && (OF || COMPILE_TEST) 1302 + depends on I2C && OF 1303 1303 select REGMAP_I2C 1304 1304 help 1305 1305 This driver supports SY8106A single output regulator. 1306 1306 1307 1307 config REGULATOR_SY8824X 1308 1308 tristate "Silergy SY8824C/SY8824E regulator" 1309 - depends on I2C && (OF || COMPILE_TEST) 1309 + depends on I2C && OF 1310 1310 select REGMAP_I2C 1311 1311 help 1312 1312 This driver supports SY8824C single output regulator. 1313 1313 1314 1314 config REGULATOR_SY8827N 1315 1315 tristate "Silergy SY8827N regulator" 1316 - depends on I2C && (OF || COMPILE_TEST) 1316 + depends on I2C && OF 1317 1317 select REGMAP_I2C 1318 1318 help 1319 1319 This driver supports SY8827N single output regulator.
+7 -9
drivers/regulator/fan53880.c
··· 42 42 #define FAN53880_LDO(_num, _supply, _default) \ 43 43 [FAN53880_LDO ## _num] = { \ 44 44 .name = "LDO"#_num, \ 45 - .of_match = of_match_ptr("LDO"#_num), \ 46 - .regulators_node = of_match_ptr("regulators"), \ 45 + .of_match = "LDO"#_num, \ 46 + .regulators_node = "regulators", \ 47 47 .type = REGULATOR_VOLTAGE, \ 48 48 .owner = THIS_MODULE, \ 49 49 .linear_ranges = (struct linear_range[]) { \ ··· 68 68 FAN53880_LDO(4, "VIN4", 1800000), 69 69 [FAN53880_BUCK] = { 70 70 .name = "BUCK", 71 - .of_match = of_match_ptr("BUCK"), 72 - .regulators_node = of_match_ptr("regulators"), 71 + .of_match = "BUCK", 72 + .regulators_node = "regulators", 73 73 .type = REGULATOR_VOLTAGE, 74 74 .owner = THIS_MODULE, 75 75 .linear_ranges = (struct linear_range[]) { ··· 88 88 }, 89 89 [FAN53880_BOOST] = { 90 90 .name = "BOOST", 91 - .of_match = of_match_ptr("BOOST"), 92 - .regulators_node = of_match_ptr("regulators"), 91 + .of_match = "BOOST", 92 + .regulators_node = "regulators", 93 93 .type = REGULATOR_VOLTAGE, 94 94 .owner = THIS_MODULE, 95 95 .linear_ranges = (struct linear_range[]) { ··· 157 157 return 0; 158 158 } 159 159 160 - #ifdef CONFIG_OF 161 160 static const struct of_device_id fan53880_dt_ids[] = { 162 161 { .compatible = "onnn,fan53880", }, 163 162 {} 164 163 }; 165 164 MODULE_DEVICE_TABLE(of, fan53880_dt_ids); 166 - #endif 167 165 168 166 static const struct i2c_device_id fan53880_i2c_id[] = { 169 167 { "fan53880", }, ··· 172 174 static struct i2c_driver fan53880_regulator_driver = { 173 175 .driver = { 174 176 .name = "fan53880", 175 - .of_match_table = of_match_ptr(fan53880_dt_ids), 177 + .of_match_table = fan53880_dt_ids, 176 178 }, 177 179 .probe_new = fan53880_i2c_probe, 178 180 .id_table = fan53880_i2c_id,
+1 -1
drivers/regulator/mp886x.c
··· 362 362 static struct i2c_driver mp886x_regulator_driver = { 363 363 .driver = { 364 364 .name = "mp886x-regulator", 365 - .of_match_table = of_match_ptr(mp886x_dt_ids), 365 + .of_match_table = mp886x_dt_ids, 366 366 }, 367 367 .probe_new = mp886x_i2c_probe, 368 368 .id_table = mp886x_id,
+2 -2
drivers/regulator/sy8106a-regulator.c
··· 123 123 return 0; 124 124 } 125 125 126 - static const struct of_device_id __maybe_unused sy8106a_i2c_of_match[] = { 126 + static const struct of_device_id sy8106a_i2c_of_match[] = { 127 127 { .compatible = "silergy,sy8106a" }, 128 128 { }, 129 129 }; ··· 138 138 static struct i2c_driver sy8106a_regulator_driver = { 139 139 .driver = { 140 140 .name = "sy8106a", 141 - .of_match_table = of_match_ptr(sy8106a_i2c_of_match), 141 + .of_match_table = sy8106a_i2c_of_match, 142 142 }, 143 143 .probe_new = sy8106a_i2c_probe, 144 144 .id_table = sy8106a_i2c_id,
+1 -1
drivers/regulator/sy8824x.c
··· 233 233 static struct i2c_driver sy8824_regulator_driver = { 234 234 .driver = { 235 235 .name = "sy8824-regulator", 236 - .of_match_table = of_match_ptr(sy8824_dt_ids), 236 + .of_match_table = sy8824_dt_ids, 237 237 }, 238 238 .probe_new = sy8824_i2c_probe, 239 239 .id_table = sy8824_id,
+1 -3
drivers/regulator/sy8827n.c
··· 170 170 return ret; 171 171 } 172 172 173 - #ifdef CONFIG_OF 174 173 static const struct of_device_id sy8827n_dt_ids[] = { 175 174 { 176 175 .compatible = "silergy,sy8827n", ··· 177 178 { } 178 179 }; 179 180 MODULE_DEVICE_TABLE(of, sy8827n_dt_ids); 180 - #endif 181 181 182 182 static const struct i2c_device_id sy8827n_id[] = { 183 183 { "sy8827n", }, ··· 187 189 static struct i2c_driver sy8827n_regulator_driver = { 188 190 .driver = { 189 191 .name = "sy8827n-regulator", 190 - .of_match_table = of_match_ptr(sy8827n_dt_ids), 192 + .of_match_table = sy8827n_dt_ids, 191 193 }, 192 194 .probe_new = sy8827n_i2c_probe, 193 195 .id_table = sy8827n_id,