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 <[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 588d9f4 commit a2cd3ab

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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)