aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Kozlowski2024-03-05 09:12:01 +0100
committerLee Jones2024-03-07 09:03:29 +0000
commitc9128ed7b9edeb2b6f1faec06d96b2fd5bc72cb8 (patch)
treeb8cfc0971960f2ad781e0f0dfe684b45a927c753 /drivers/video
parentb4c385b294a48502d9654a1910e6a9976a1165c6 (diff)
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/lm3630a_bl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
index bb80ad51ca0d..76d47e2e8242 100644
--- a/drivers/video/backlight/lm3630a_bl.c
+++ b/drivers/video/backlight/lm3630a_bl.c
@@ -540,10 +540,8 @@ static int lm3630a_probe(struct i2c_client *client)
pchip->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
GPIOD_OUT_HIGH);
- if (IS_ERR(pchip->enable_gpio)) {
- rval = PTR_ERR(pchip->enable_gpio);
- return rval;
- }
+ if (IS_ERR(pchip->enable_gpio))
+ return PTR_ERR(pchip->enable_gpio);
/* chip initialize */
rval = lm3630a_chip_init(pchip);