Skip to content

Commit 9d12538

Browse files
committed
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
2 parents 8db0642 + 9536ce6 commit 9d12538

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/regulator/da9121-regulator.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int da9121_of_parse_cb(struct device_node *np,
381381
uint32_t ripple_reg;
382382
int ret;
383383

384-
if (of_property_read_u32(da9121_matches[pdata->num_buck].of_node,
384+
if (of_property_read_u32(da9121_matches[pdata->num_buck-1].of_node,
385385
"dlg,ripple-cancel", &ripple_cancel)) {
386386
if (pdata->num_buck > 1)
387387
ripple_reg = DA9xxx_REG_BUCK_BUCK2_7;
@@ -816,7 +816,6 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
816816
u32 variant_id;
817817
u8 variant_mrc, variant_vrc;
818818
char *type;
819-
const char *name;
820819
bool config_match = false;
821820
int ret = 0;
822821

@@ -867,7 +866,7 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
867866
device_id, variant_id, type);
868867

869868
if (!config_match) {
870-
dev_err(chip->dev, "Device tree configuration '%s' does not match detected device.\n", name);
869+
dev_err(chip->dev, "Device tree configuration does not match detected device.\n");
871870
ret = -EINVAL;
872871
goto error;
873872
}

0 commit comments

Comments
 (0)