Commit 03eb2ca4 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Pavel Machek

leds: tlc591xx: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 4582e783
...@@ -213,12 +213,10 @@ tlc591xx_probe(struct i2c_client *client, ...@@ -213,12 +213,10 @@ tlc591xx_probe(struct i2c_client *client,
led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS; led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
err = devm_led_classdev_register_ext(dev, &led->ldev, err = devm_led_classdev_register_ext(dev, &led->ldev,
&init_data); &init_data);
if (err < 0) { if (err < 0)
if (err != -EPROBE_DEFER) return dev_err_probe(dev, err,
dev_err(dev, "couldn't register LED %s\n", "couldn't register LED %s\n",
led->ldev.name); led->ldev.name);
return err;
}
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment