summaryrefslogtreecommitdiff
path: root/drivers/regulator/da9121-regulator.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-12-08 20:06:43 +0300
committerMark Brown <broonie@kernel.org>2020-12-08 20:06:43 +0300
commit9d125387d92bf68b14acee0297e10c5f382fd62f (patch)
tree264e063b8864a754e8201c37277a3eb8780a6954 /drivers/regulator/da9121-regulator.c
parent8db06423e079b1f6c0657e5bebda0006acf75c3c (diff)
parent9536ce63705952be5214544e3b048c78f932e794 (diff)
downloadlinux-9d125387d92bf68b14acee0297e10c5f382fd62f.tar.xz
Merge series "regulator: da9121: bug fixes" from Adam Ward <Adam.Ward.opensource@diasemi.com>:
This patch fixes a couple of bugs in the DA9121 driver. One in an uninialised string I forgot to remove when changing to of_parse_cb() The other is an index for an optional DT property which overflows Adam Ward (2): regulator: da9121: Remove uninitialised string variable regulator: da9121: Fix index used for DT property drivers/regulator/da9121-regulator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.1
Diffstat (limited to 'drivers/regulator/da9121-regulator.c')
-rw-r--r--drivers/regulator/da9121-regulator.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index e4fc3a7cd5d8..a2ede7d7897e 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -381,7 +381,7 @@ static int da9121_of_parse_cb(struct device_node *np,
uint32_t ripple_reg;
int ret;
- if (of_property_read_u32(da9121_matches[pdata->num_buck].of_node,
+ if (of_property_read_u32(da9121_matches[pdata->num_buck-1].of_node,
"dlg,ripple-cancel", &ripple_cancel)) {
if (pdata->num_buck > 1)
ripple_reg = DA9xxx_REG_BUCK_BUCK2_7;
@@ -816,7 +816,6 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
u32 variant_id;
u8 variant_mrc, variant_vrc;
char *type;
- const char *name;
bool config_match = false;
int ret = 0;
@@ -867,7 +866,7 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
device_id, variant_id, type);
if (!config_match) {
- dev_err(chip->dev, "Device tree configuration '%s' does not match detected device.\n", name);
+ dev_err(chip->dev, "Device tree configuration does not match detected device.\n");
ret = -EINVAL;
goto error;
}