提交 d4930cf0 编写于 作者: B Bernhard Walle 提交者: 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: NBernhard Walle <bernhard@bwalle.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 92e963f5
...@@ -520,12 +520,15 @@ static int ltc3589_probe(struct i2c_client *client, ...@@ -520,12 +520,15 @@ static int ltc3589_probe(struct i2c_client *client,
} }
} }
ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr, if (client->irq) {
IRQF_TRIGGER_LOW | IRQF_ONESHOT, ret = devm_request_threaded_irq(dev, client->irq, NULL,
client->name, ltc3589); ltc3589_isr,
if (ret) { IRQF_TRIGGER_LOW | IRQF_ONESHOT,
dev_err(dev, "Failed to request IRQ: %d\n", ret); client->name, ltc3589);
return ret; if (ret) {
dev_err(dev, "Failed to request IRQ: %d\n", ret);
return ret;
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册