Skip to content

Commit d9b3ffa

Browse files
Balaji SrinivasanMaureenHelm
authored andcommitted
drivers: regulator: npm6001: Fix compiler warning
This patch fixes a compiler warning about the val being used uninitialized. The previously present if check did not seem to satisfy compiler. Hence the val is now explictly initialized. Signed-off-by: Balaji Srinivasan <[email protected]>
1 parent a859191 commit d9b3ffa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/regulator_npm6001.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int regulator_npm6001_ldo0_set_voltage(const struct device *dev, int32_t
211211
int32_t max_uv)
212212
{
213213
const struct regulator_npm6001_config *config = dev->config;
214-
uint8_t val;
214+
uint8_t val = 0U;
215215
size_t i;
216216

217217
for (i = 0U; i < ARRAY_SIZE(ldo0_voltages); i++) {

0 commit comments

Comments
 (0)