aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorBernhard Walle <bernhard@bwalle.de>2016-02-10 21:37:30 +0100
committerMark Brown <broonie@kernel.org>2016-02-12 22:35:00 +0000
commitd4930cf0ae33e944427f974f33bc43b8e6c56456 (patch)
tree1dd14a3a118d8549154e3e2d8ed37a6f53210347 /drivers/regulator
parentLinux 4.5-rc1 (diff)
downloadlinux-dev-d4930cf0ae33e944427f974f33bc43b8e6c56456.tar.xz
linux-dev-d4930cf0ae33e944427f974f33bc43b8e6c56456.zip
regulator: ltc3589: Make IRQ optional
It's perfectly valid to use the LTC3589 without an interrupt pin connected to it. Currently, the driver probing fails when client->irq is 0 (which means "no interrupt"). Don't register the interrupt handler in that case but successfully finish the device probing instead. Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/ltc3589.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c
index 972c386b2690..47bef328fb58 100644
--- a/drivers/regulator/ltc3589.c
+++ b/drivers/regulator/ltc3589.c
@@ -520,12 +520,15 @@ static int ltc3589_probe(struct i2c_client *client,
}
}
- ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- client->name, ltc3589);
- if (ret) {
- dev_err(dev, "Failed to request IRQ: %d\n", ret);
- return ret;
+ if (client->irq) {
+ ret = devm_request_threaded_irq(dev, client->irq, NULL,
+ ltc3589_isr,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ client->name, ltc3589);
+ if (ret) {
+ dev_err(dev, "Failed to request IRQ: %d\n", ret);
+ return ret;
+ }
}
return 0;