Skip to content

Commit

Permalink
regulator: ltc3589: Make IRQ optional
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bernhard Walle authored and Mark Brown committed Feb 12, 2016
1 parent 92e963f commit d4930cf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/regulator/ltc3589.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d4930cf

Please sign in to comment.