mirror of https://gitee.com/openkylin/linux.git
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: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
4582e783a2
commit
03eb2ca44a
|
@ -213,12 +213,10 @@ tlc591xx_probe(struct i2c_client *client,
|
|||
led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
|
||||
err = devm_led_classdev_register_ext(dev, &led->ldev,
|
||||
&init_data);
|
||||
if (err < 0) {
|
||||
if (err != -EPROBE_DEFER)
|
||||
dev_err(dev, "couldn't register LED %s\n",
|
||||
led->ldev.name);
|
||||
return err;
|
||||
}
|
||||
if (err < 0)
|
||||
return dev_err_probe(dev, err,
|
||||
"couldn't register LED %s\n",
|
||||
led->ldev.name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue