Skip to content

Commit 6e3779e

Browse files
Len Baolag-linaro
authored andcommitted
leds: max77705: Function return instead of variable assignment
Coverity noticed that assigning value -EINVAL to 'ret' in the if statement is useless because 'ret' is overwritten a few lines later. However, after inspect the code, this warning reveals that we need to return -EINVAL instead of the variable assignment. So, fix it. Coverity-id: 1646104 Fixes: aebb5fc ("leds: max77705: Add LEDs support") Signed-off-by: Len Bao <len.bao@gmx.us> Link: https://lore.kernel.org/r/20250727075649.34496-1-len.bao@gmx.us Signed-off-by: Lee Jones <lee@kernel.org>
1 parent f4fc2d8 commit 6e3779e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/leds/leds-max77705.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fw
180180

181181
ret = fwnode_property_read_u32(np, "reg", &reg);
182182
if (ret || reg >= MAX77705_LED_NUM_LEDS)
183-
ret = -EINVAL;
183+
return -EINVAL;
184184

185185
info = devm_kcalloc(dev, num_channels, sizeof(*info), GFP_KERNEL);
186186
if (!info)

0 commit comments

Comments
 (0)