Skip to content

Commit ddc239a

Browse files
committed
Merge remote-tracking branches 'regulator/fix/axp20x', 'regulator/fix/cpcap' and 'regulator/fix/of' into regulator-linus
4 parents a69064e + da26296 + 4ebb9d7 + 423a116 commit ddc239a

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

drivers/regulator/axp20x-regulator.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
691691
(regulators == axp809_regulators && i == AXP809_DC1SW)) {
692692
new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc),
693693
GFP_KERNEL);
694+
if (!new_desc)
695+
return -ENOMEM;
696+
694697
*new_desc = regulators[i];
695698
new_desc->supply_name = dcdc1_name;
696699
desc = new_desc;
@@ -700,6 +703,9 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
700703
(regulators == axp809_regulators && i == AXP809_DC5LDO)) {
701704
new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc),
702705
GFP_KERNEL);
706+
if (!new_desc)
707+
return -ENOMEM;
708+
703709
*new_desc = regulators[i];
704710
new_desc->supply_name = dcdc5_name;
705711
desc = new_desc;

drivers/regulator/cpcap-regulator.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
#define CPCAP_BIT_VAUDIO_MODE0 BIT(1)
7878
#define CPCAP_BIT_V_AUDIO_EN BIT(0)
7979

80+
#define CPCAP_BIT_AUDIO_NORMAL_MODE 0x00
81+
8082
/*
8183
* Off mode configuration bit. Used currently only by SW5 on omap4. There's
8284
* the following comment in Motorola Linux kernel tree for it:
@@ -217,7 +219,7 @@ static unsigned int cpcap_regulator_get_mode(struct regulator_dev *rdev)
217219

218220
regmap_read(rdev->regmap, rdev->desc->enable_reg, &value);
219221

220-
if (!(value & CPCAP_BIT_AUDIO_LOW_PWR))
222+
if (value & CPCAP_BIT_AUDIO_LOW_PWR)
221223
return REGULATOR_MODE_STANDBY;
222224

223225
return REGULATOR_MODE_NORMAL;
@@ -230,10 +232,10 @@ static int cpcap_regulator_set_mode(struct regulator_dev *rdev,
230232

231233
switch (mode) {
232234
case REGULATOR_MODE_NORMAL:
233-
value = CPCAP_BIT_AUDIO_LOW_PWR;
235+
value = CPCAP_BIT_AUDIO_NORMAL_MODE;
234236
break;
235237
case REGULATOR_MODE_STANDBY:
236-
value = 0;
238+
value = CPCAP_BIT_AUDIO_LOW_PWR;
237239
break;
238240
default:
239241
return -EINVAL;

drivers/regulator/of_regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
333333
search = of_get_child_by_name(dev->of_node,
334334
desc->regulators_node);
335335
else
336-
search = dev->of_node;
336+
search = of_node_get(dev->of_node);
337337

338338
if (!search) {
339339
dev_dbg(dev, "Failed to find regulator container node '%s'\n",

0 commit comments

Comments
 (0)