diff options
author | Bernhard Walle <bernhard@bwalle.de> | 2016-02-10 15:37:30 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-12 17:35:00 -0500 |
commit | d4930cf0ae33e944427f974f33bc43b8e6c56456 (patch) | |
tree | 1dd14a3a118d8549154e3e2d8ed37a6f53210347 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
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>
-rw-r--r-- | drivers/regulator/ltc3589.c | 15 |
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, | |||
520 | } | 520 | } |
521 | } | 521 | } |
522 | 522 | ||
523 | ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr, | 523 | if (client->irq) { |
524 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, | 524 | ret = devm_request_threaded_irq(dev, client->irq, NULL, |
525 | client->name, ltc3589); | 525 | ltc3589_isr, |
526 | if (ret) { | 526 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, |
527 | dev_err(dev, "Failed to request IRQ: %d\n", ret); | 527 | client->name, ltc3589); |
528 | return ret; | 528 | if (ret) { |
529 | dev_err(dev, "Failed to request IRQ: %d\n", ret); | ||
530 | return ret; | ||
531 | } | ||
529 | } | 532 | } |
530 | 533 | ||
531 | return 0; | 534 | return 0; |