Commit d4930cf0 authored by Bernhard Walle's avatar Bernhard Walle Committed by Mark Brown

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: default avatarBernhard Walle <bernhard@bwalle.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92e963f5
......@@ -520,13 +520,16 @@ static int ltc3589_probe(struct i2c_client *client,
}
}
ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment