Skip to content

Commit 0106679

Browse files
committed
Merge tag 'regulator-fix-v6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "There's a few simple driver specific fixes here, plus some core cleanups from Matti which fix issues found with client drivers due to the API being confusing. The two fixes for the stubs provide more constructive behaviour with !REGULATOR configurations, issues were noticed with some hwmon drivers which would otherwise have needed confusing bodges in the users. The irq_helpers fix to duplicate the provided name for the interrupt controller was found because a driver got this wrong and it's again a case where the core is the sensible place to put the fix" * tag 'regulator-fix-v6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: change devm_regulator_get_enable_optional() stub to return Ok regulator: change stubbed devm_regulator_get_enable to return Ok regulator: vqmmc-ipq4019: fix module autoloading regulator: qcom-refgen: fix module autoloading regulator: mt6360: De-capitalize devicetree regulator subnodes regulator: irq_helpers: duplicate IRQ name
2 parents 18daea7 + ff33132 commit 0106679

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

drivers/regulator/irq_helpers.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ void *regulator_irq_helper(struct device *dev,
352352

353353
h->irq = irq;
354354
h->desc = *d;
355+
h->desc.name = devm_kstrdup(dev, d->name, GFP_KERNEL);
356+
if (!h->desc.name)
357+
return ERR_PTR(-ENOMEM);
355358

356359
ret = init_rdev_state(dev, h, rdev, common_errs, per_rdev_errs,
357360
rdev_amount);

drivers/regulator/mt6360-regulator.c

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
319319
}
320320
}
321321

322-
#define MT6360_REGULATOR_DESC(_name, _sname, ereg, emask, vreg, vmask, \
323-
mreg, mmask, streg, stmask, vranges, \
324-
vcnts, offon_delay, irq_tbls) \
322+
#define MT6360_REGULATOR_DESC(match, _name, _sname, ereg, emask, vreg, \
323+
vmask, mreg, mmask, streg, stmask, \
324+
vranges, vcnts, offon_delay, irq_tbls) \
325325
{ \
326326
.desc = { \
327327
.name = #_name, \
328328
.supply_name = #_sname, \
329329
.id = MT6360_REGULATOR_##_name, \
330-
.of_match = of_match_ptr(#_name), \
330+
.of_match = of_match_ptr(match), \
331331
.regulators_node = of_match_ptr("regulator"), \
332332
.of_map_mode = mt6360_regulator_of_map_mode, \
333333
.owner = THIS_MODULE, \
@@ -351,21 +351,29 @@ static unsigned int mt6360_regulator_of_map_mode(unsigned int hw_mode)
351351
}
352352

353353
static const struct mt6360_regulator_desc mt6360_regulator_descs[] = {
354-
MT6360_REGULATOR_DESC(BUCK1, BUCK1_VIN, 0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
354+
MT6360_REGULATOR_DESC("buck1", BUCK1, BUCK1_VIN,
355+
0x117, 0x40, 0x110, 0xff, 0x117, 0x30, 0x117, 0x04,
355356
buck_vout_ranges, 256, 0, buck1_irq_tbls),
356-
MT6360_REGULATOR_DESC(BUCK2, BUCK2_VIN, 0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
357+
MT6360_REGULATOR_DESC("buck2", BUCK2, BUCK2_VIN,
358+
0x127, 0x40, 0x120, 0xff, 0x127, 0x30, 0x127, 0x04,
357359
buck_vout_ranges, 256, 0, buck2_irq_tbls),
358-
MT6360_REGULATOR_DESC(LDO6, LDO_VIN3, 0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
360+
MT6360_REGULATOR_DESC("ldo6", LDO6, LDO_VIN3,
361+
0x137, 0x40, 0x13B, 0xff, 0x137, 0x30, 0x137, 0x04,
359362
ldo_vout_ranges1, 256, 0, ldo6_irq_tbls),
360-
MT6360_REGULATOR_DESC(LDO7, LDO_VIN3, 0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
363+
MT6360_REGULATOR_DESC("ldo7", LDO7, LDO_VIN3,
364+
0x131, 0x40, 0x135, 0xff, 0x131, 0x30, 0x131, 0x04,
361365
ldo_vout_ranges1, 256, 0, ldo7_irq_tbls),
362-
MT6360_REGULATOR_DESC(LDO1, LDO_VIN1, 0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
366+
MT6360_REGULATOR_DESC("ldo1", LDO1, LDO_VIN1,
367+
0x217, 0x40, 0x21B, 0xff, 0x217, 0x30, 0x217, 0x04,
363368
ldo_vout_ranges2, 256, 0, ldo1_irq_tbls),
364-
MT6360_REGULATOR_DESC(LDO2, LDO_VIN1, 0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
369+
MT6360_REGULATOR_DESC("ldo2", LDO2, LDO_VIN1,
370+
0x211, 0x40, 0x215, 0xff, 0x211, 0x30, 0x211, 0x04,
365371
ldo_vout_ranges2, 256, 0, ldo2_irq_tbls),
366-
MT6360_REGULATOR_DESC(LDO3, LDO_VIN1, 0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
372+
MT6360_REGULATOR_DESC("ldo3", LDO3, LDO_VIN1,
373+
0x205, 0x40, 0x209, 0xff, 0x205, 0x30, 0x205, 0x04,
367374
ldo_vout_ranges2, 256, 100, ldo3_irq_tbls),
368-
MT6360_REGULATOR_DESC(LDO5, LDO_VIN2, 0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
375+
MT6360_REGULATOR_DESC("ldo5", LDO5, LDO_VIN2,
376+
0x20B, 0x40, 0x20F, 0x7f, 0x20B, 0x30, 0x20B, 0x04,
369377
ldo_vout_ranges3, 128, 100, ldo5_irq_tbls),
370378
};
371379

drivers/regulator/qcom-refgen-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ static const struct of_device_id qcom_refgen_match_table[] = {
140140
{ .compatible = "qcom,sm8250-refgen-regulator", .data = &sm8250_refgen_desc },
141141
{ }
142142
};
143+
MODULE_DEVICE_TABLE(of, qcom_refgen_match_table);
143144

144145
static struct platform_driver qcom_refgen_driver = {
145146
.probe = qcom_refgen_probe,

drivers/regulator/vqmmc-ipq4019-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static const struct of_device_id regulator_ipq4019_of_match[] = {
8484
{ .compatible = "qcom,vqmmc-ipq4019-regulator", },
8585
{},
8686
};
87+
MODULE_DEVICE_TABLE(of, regulator_ipq4019_of_match);
8788

8889
static struct platform_driver ipq4019_regulator_driver = {
8990
.probe = ipq4019_regulator_probe,

include/linux/regulator/consumer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ devm_regulator_get_exclusive(struct device *dev, const char *id)
320320

321321
static inline int devm_regulator_get_enable(struct device *dev, const char *id)
322322
{
323-
return -ENODEV;
323+
return 0;
324324
}
325325

326326
static inline int devm_regulator_get_enable_optional(struct device *dev,
327327
const char *id)
328328
{
329-
return -ENODEV;
329+
return 0;
330330
}
331331

332332
static inline struct regulator *__must_check

0 commit comments

Comments
 (0)