projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d63d05
)
leds: max5970: Make use of dev_err_probe()
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Thu, 14 Dec 2023 18:40:10 +0000
(20:40 +0200)
committer
Lee Jones
<lee@kernel.org>
Thu, 21 Dec 2023 14:42:59 +0000
(14:42 +0000)
Simplify the error handling in probe function by switching from
dev_err() to dev_err_probe().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link:
https://lore.kernel.org/r/20231214184050.1272848-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-max5970.c
patch
|
blob
|
history
diff --git
a/drivers/leds/leds-max5970.c
b/drivers/leds/leds-max5970.c
index de57b385b4f63e4a303822209dd09754caef483b..60db3c28d7d97082734a3b6a6c51c82684413879 100644
(file)
--- a/
drivers/leds/leds-max5970.c
+++ b/
drivers/leds/leds-max5970.c
@@
-62,7
+62,7
@@
static int max5970_led_probe(struct platform_device *pdev)
continue;
if (reg >= MAX5970_NUM_LEDS) {
- dev_err
(dev
, "invalid LED (%u >= %d)\n", reg, MAX5970_NUM_LEDS);
+ dev_err
_probe(dev, -EINVAL
, "invalid LED (%u >= %d)\n", reg, MAX5970_NUM_LEDS);
continue;
}
@@
-86,8
+86,7
@@
static int max5970_led_probe(struct platform_device *pdev)
ret = devm_led_classdev_register(dev, &ddata->cdev);
if (ret < 0) {
fwnode_handle_put(child);
- dev_err(dev, "Failed to initialize LED %u\n", reg);
- return ret;
+ return dev_err_probe(dev, ret, "Failed to initialize LED %u\n", reg);
}
}