Skip to content

Commit c9128ed

Browse files
krzklag-linaro
authored andcommitted
backlight: lm3630a_bl: Simplify probe return on gpio request error
Code can be simpler: return directly when devm_gpiod_get_optional() failed. Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240305-backlight-probe-v2-6-609b0cf24bde@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent b4c385b commit c9128ed

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/lm3630a_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,8 @@ static int lm3630a_probe(struct i2c_client *client)
540540

541541
pchip->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
542542
GPIOD_OUT_HIGH);
543-
if (IS_ERR(pchip->enable_gpio)) {
544-
rval = PTR_ERR(pchip->enable_gpio);
545-
return rval;
546-
}
543+
if (IS_ERR(pchip->enable_gpio))
544+
return PTR_ERR(pchip->enable_gpio);
547545

548546
/* chip initialize */
549547
rval = lm3630a_chip_init(pchip);

0 commit comments

Comments
 (0)