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 <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent b4c385b commit c9128ed

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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)