summaryrefslogtreecommitdiff
path: root/drivers/mfd/wcd934x.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-26 17:49:35 +0300
committerLee Jones <lee.jones@linaro.org>2020-09-30 18:25:01 +0300
commit0f1b1b899521e3380a01f9f88a1bcb6163b7ee9f (patch)
tree8867ef511207cf43b4c0ace193d85a0459d3e4db /drivers/mfd/wcd934x.c
parent41c9c06c491a92e186e41ff64163fa74f08e15e6 (diff)
downloadlinux-0f1b1b899521e3380a01f9f88a1bcb6163b7ee9f.tar.xz
mfd: wcd934x: 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: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/wcd934x.c')
-rw-r--r--drivers/mfd/wcd934x.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index da910302d51a..c274d733b656 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -219,12 +219,9 @@ static int wcd934x_slim_probe(struct slim_device *sdev)
return -ENOMEM;
ddata->irq = of_irq_get(np, 0);
- if (ddata->irq < 0) {
- if (ddata->irq != -EPROBE_DEFER)
- dev_err(ddata->dev, "Failed to get IRQ: err = %d\n",
- ddata->irq);
- return ddata->irq;
- }
+ if (ddata->irq < 0)
+ return dev_err_probe(ddata->dev, ddata->irq,
+ "Failed to get IRQ\n");
reset_gpio = of_get_named_gpio(np, "reset-gpios", 0);
if (reset_gpio < 0) {