2020-12-07 17:18:31

by Adam Ward

[permalink] [raw]
Subject: [PATCH 0/2] regulator: da9121: bug fixes

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


2020-12-07 17:18:31

by Adam Ward

[permalink] [raw]
Subject: [PATCH 1/2] regulator: da9121: Remove uninitialised string variable

Erroneously left in when switched to using of_parse_cb()

Signed-off-by: Adam Ward <[email protected]>
---
drivers/regulator/da9121-regulator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index db1c2cc..ed68259 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -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;
}
--
1.9.1

2020-12-07 17:20:56

by Adam Ward

[permalink] [raw]
Subject: [PATCH 2/2] regulator: da9121: Fix index used for DT property

Signed-off-by: Adam Ward <[email protected]>
---
drivers/regulator/da9121-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index ed68259..9d5b02f 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;
--
1.9.1

2020-12-08 17:15:41

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/2] regulator: da9121: bug fixes

On Mon, 7 Dec 2020 17:15:14 +0000, Adam Ward wrote:
> 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
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/2] regulator: da9121: Remove uninitialised string variable
commit: 416c29e9ce1347ba9a4ef7aeb4f30c8d9a3ada49
[2/2] regulator: da9121: Fix index used for DT property
commit: 9536ce63705952be5214544e3b048c78f932e794

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark