Skip to content

Commit a2cd3ab

Browse files
krzklag-linaro
authored andcommitted
backlight: bd6107: Handle deferred probe
Don't pollute dmesg on deferred probe and simplify the code with dev_err_probe(). 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-3-609b0cf24bde@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 588d9f4 commit a2cd3ab

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/video/backlight/bd6107.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static int bd6107_probe(struct i2c_client *client)
119119
struct backlight_device *backlight;
120120
struct backlight_properties props;
121121
struct bd6107 *bd;
122-
int ret;
123122

124123
if (pdata == NULL) {
125124
dev_err(&client->dev, "No platform data\n");
@@ -147,11 +146,9 @@ static int bd6107_probe(struct i2c_client *client)
147146
* the reset.
148147
*/
149148
bd->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
150-
if (IS_ERR(bd->reset)) {
151-
dev_err(&client->dev, "unable to request reset GPIO\n");
152-
ret = PTR_ERR(bd->reset);
153-
return ret;
154-
}
149+
if (IS_ERR(bd->reset))
150+
return dev_err_probe(&client->dev, PTR_ERR(bd->reset),
151+
"unable to request reset GPIO\n");
155152

156153
memset(&props, 0, sizeof(props));
157154
props.type = BACKLIGHT_RAW;

0 commit comments

Comments
 (0)