Skip to content

Commit c4b02c9

Browse files
jdelvarebroonie
authored andcommitted
regulator: Drop obsolete dependencies on COMPILE_TEST
Since commit 0166dc1 ("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 <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Icenowy Zheng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c9f9ef1 commit c4b02c9

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed

drivers/regulator/Kconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ config REGULATOR_FAN53555
377377

378378
config REGULATOR_FAN53880
379379
tristate "Fairchild FAN53880 Regulator"
380-
depends on I2C && (OF || COMPILE_TEST)
380+
depends on I2C && OF
381381
select REGMAP_I2C
382382
help
383383
This driver supports Fairchild (ON Semiconductor) FAN53880
@@ -743,7 +743,7 @@ config REGULATOR_MP8859
743743

744744
config REGULATOR_MP886X
745745
tristate "MPS MP8869 regulator driver"
746-
depends on I2C && (OF || COMPILE_TEST)
746+
depends on I2C && OF
747747
select REGMAP_I2C
748748
help
749749
This driver supports the MP8869 voltage regulator.
@@ -1299,21 +1299,21 @@ config REGULATOR_SY7636A
12991299

13001300
config REGULATOR_SY8106A
13011301
tristate "Silergy SY8106A regulator"
1302-
depends on I2C && (OF || COMPILE_TEST)
1302+
depends on I2C && OF
13031303
select REGMAP_I2C
13041304
help
13051305
This driver supports SY8106A single output regulator.
13061306

13071307
config REGULATOR_SY8824X
13081308
tristate "Silergy SY8824C/SY8824E regulator"
1309-
depends on I2C && (OF || COMPILE_TEST)
1309+
depends on I2C && OF
13101310
select REGMAP_I2C
13111311
help
13121312
This driver supports SY8824C single output regulator.
13131313

13141314
config REGULATOR_SY8827N
13151315
tristate "Silergy SY8827N regulator"
1316-
depends on I2C && (OF || COMPILE_TEST)
1316+
depends on I2C && OF
13171317
select REGMAP_I2C
13181318
help
13191319
This driver supports SY8827N single output regulator.

drivers/regulator/fan53880.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ static const struct regulator_ops fan53880_ops = {
4242
#define FAN53880_LDO(_num, _supply, _default) \
4343
[FAN53880_LDO ## _num] = { \
4444
.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", \
4747
.type = REGULATOR_VOLTAGE, \
4848
.owner = THIS_MODULE, \
4949
.linear_ranges = (struct linear_range[]) { \
@@ -68,8 +68,8 @@ static const struct regulator_desc fan53880_regulators[] = {
6868
FAN53880_LDO(4, "VIN4", 1800000),
6969
[FAN53880_BUCK] = {
7070
.name = "BUCK",
71-
.of_match = of_match_ptr("BUCK"),
72-
.regulators_node = of_match_ptr("regulators"),
71+
.of_match = "BUCK",
72+
.regulators_node = "regulators",
7373
.type = REGULATOR_VOLTAGE,
7474
.owner = THIS_MODULE,
7575
.linear_ranges = (struct linear_range[]) {
@@ -88,8 +88,8 @@ static const struct regulator_desc fan53880_regulators[] = {
8888
},
8989
[FAN53880_BOOST] = {
9090
.name = "BOOST",
91-
.of_match = of_match_ptr("BOOST"),
92-
.regulators_node = of_match_ptr("regulators"),
91+
.of_match = "BOOST",
92+
.regulators_node = "regulators",
9393
.type = REGULATOR_VOLTAGE,
9494
.owner = THIS_MODULE,
9595
.linear_ranges = (struct linear_range[]) {
@@ -157,13 +157,11 @@ static int fan53880_i2c_probe(struct i2c_client *i2c)
157157
return 0;
158158
}
159159

160-
#ifdef CONFIG_OF
161160
static const struct of_device_id fan53880_dt_ids[] = {
162161
{ .compatible = "onnn,fan53880", },
163162
{}
164163
};
165164
MODULE_DEVICE_TABLE(of, fan53880_dt_ids);
166-
#endif
167165

168166
static const struct i2c_device_id fan53880_i2c_id[] = {
169167
{ "fan53880", },
@@ -174,7 +172,7 @@ MODULE_DEVICE_TABLE(i2c, fan53880_i2c_id);
174172
static struct i2c_driver fan53880_regulator_driver = {
175173
.driver = {
176174
.name = "fan53880",
177-
.of_match_table = of_match_ptr(fan53880_dt_ids),
175+
.of_match_table = fan53880_dt_ids,
178176
},
179177
.probe_new = fan53880_i2c_probe,
180178
.id_table = fan53880_i2c_id,

drivers/regulator/mp886x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ MODULE_DEVICE_TABLE(i2c, mp886x_id);
362362
static struct i2c_driver mp886x_regulator_driver = {
363363
.driver = {
364364
.name = "mp886x-regulator",
365-
.of_match_table = of_match_ptr(mp886x_dt_ids),
365+
.of_match_table = mp886x_dt_ids,
366366
},
367367
.probe_new = mp886x_i2c_probe,
368368
.id_table = mp886x_id,

drivers/regulator/sy8106a-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int sy8106a_i2c_probe(struct i2c_client *i2c)
123123
return 0;
124124
}
125125

126-
static const struct of_device_id __maybe_unused sy8106a_i2c_of_match[] = {
126+
static const struct of_device_id sy8106a_i2c_of_match[] = {
127127
{ .compatible = "silergy,sy8106a" },
128128
{ },
129129
};
@@ -138,7 +138,7 @@ MODULE_DEVICE_TABLE(i2c, sy8106a_i2c_id);
138138
static struct i2c_driver sy8106a_regulator_driver = {
139139
.driver = {
140140
.name = "sy8106a",
141-
.of_match_table = of_match_ptr(sy8106a_i2c_of_match),
141+
.of_match_table = sy8106a_i2c_of_match,
142142
},
143143
.probe_new = sy8106a_i2c_probe,
144144
.id_table = sy8106a_i2c_id,

drivers/regulator/sy8824x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ MODULE_DEVICE_TABLE(i2c, sy8824_id);
233233
static struct i2c_driver sy8824_regulator_driver = {
234234
.driver = {
235235
.name = "sy8824-regulator",
236-
.of_match_table = of_match_ptr(sy8824_dt_ids),
236+
.of_match_table = sy8824_dt_ids,
237237
},
238238
.probe_new = sy8824_i2c_probe,
239239
.id_table = sy8824_id,

drivers/regulator/sy8827n.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,13 @@ static int sy8827n_i2c_probe(struct i2c_client *client)
170170
return ret;
171171
}
172172

173-
#ifdef CONFIG_OF
174173
static const struct of_device_id sy8827n_dt_ids[] = {
175174
{
176175
.compatible = "silergy,sy8827n",
177176
},
178177
{ }
179178
};
180179
MODULE_DEVICE_TABLE(of, sy8827n_dt_ids);
181-
#endif
182180

183181
static const struct i2c_device_id sy8827n_id[] = {
184182
{ "sy8827n", },
@@ -189,7 +187,7 @@ MODULE_DEVICE_TABLE(i2c, sy8827n_id);
189187
static struct i2c_driver sy8827n_regulator_driver = {
190188
.driver = {
191189
.name = "sy8827n-regulator",
192-
.of_match_table = of_match_ptr(sy8827n_dt_ids),
190+
.of_match_table = sy8827n_dt_ids,
193191
},
194192
.probe_new = sy8827n_i2c_probe,
195193
.id_table = sy8827n_id,

0 commit comments

Comments
 (0)