Skip to content

Commit c642e87

Browse files
committed
Merge branch 'regulator-5.4' into regulator-linus
2 parents af42d34 + 3f1a9e6 commit c642e87

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

drivers/regulator/bd70528-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,4 @@ module_platform_driver(bd70528_regulator);
286286
MODULE_AUTHOR("Matti Vaittinen <[email protected]>");
287287
MODULE_DESCRIPTION("BD70528 voltage regulator driver");
288288
MODULE_LICENSE("GPL");
289+
MODULE_ALIAS("platform:bd70528-pmic");

drivers/regulator/core.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,7 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
18441844
struct regulator_dev *rdev;
18451845
struct regulator *regulator;
18461846
const char *devname = dev ? dev_name(dev) : "deviceless";
1847+
struct device_link *link;
18471848
int ret;
18481849

18491850
if (get_type >= MAX_GET_TYPE) {
@@ -1951,7 +1952,9 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
19511952
rdev->use_count = 0;
19521953
}
19531954

1954-
device_link_add(dev, &rdev->dev, DL_FLAG_STATELESS);
1955+
link = device_link_add(dev, &rdev->dev, DL_FLAG_STATELESS);
1956+
if (!IS_ERR_OR_NULL(link))
1957+
regulator->device_link = true;
19551958

19561959
return regulator;
19571960
}
@@ -2046,7 +2049,8 @@ static void _regulator_put(struct regulator *regulator)
20462049
debugfs_remove_recursive(regulator->debugfs);
20472050

20482051
if (regulator->dev) {
2049-
device_link_remove(regulator->dev, &rdev->dev);
2052+
if (regulator->device_link)
2053+
device_link_remove(regulator->dev, &rdev->dev);
20502054

20512055
/* remove any sysfs entries */
20522056
sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name);
@@ -5198,6 +5202,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
51985202
regulator_remove_coupling(rdev);
51995203
mutex_unlock(&regulator_list_mutex);
52005204
wash:
5205+
kfree(rdev->coupling_desc.coupled_rdevs);
52015206
kfree(rdev->constraints);
52025207
mutex_lock(&regulator_list_mutex);
52035208
regulator_ena_gpio_free(rdev);

drivers/regulator/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct regulator {
3636
struct list_head list;
3737
unsigned int always_on:1;
3838
unsigned int bypass:1;
39+
unsigned int device_link:1;
3940
int uA_load;
4041
unsigned int enable_count;
4142
unsigned int deferred_disables;

drivers/regulator/rn5t618-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static const struct regulator_desc rc5t619_regulators[] = {
9090
REG(LDO7, LDOEN1, BIT(6), LDO7DAC, 0x7f, 900000, 3500000, 25000),
9191
REG(LDO8, LDOEN1, BIT(7), LDO8DAC, 0x7f, 900000, 3500000, 25000),
9292
REG(LDO9, LDOEN2, BIT(0), LDO9DAC, 0x7f, 900000, 3500000, 25000),
93-
REG(LDO10, LDOEN2, BIT(0), LDO10DAC, 0x7f, 900000, 3500000, 25000),
93+
REG(LDO10, LDOEN2, BIT(1), LDO10DAC, 0x7f, 900000, 3500000, 25000),
9494
/* LDO RTC */
9595
REG(LDORTC1, LDOEN2, BIT(4), LDORTCDAC, 0x7f, 1700000, 3500000, 25000),
9696
REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000),

0 commit comments

Comments
 (0)