diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2014-11-17 12:43:00 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-11-17 19:54:25 +0100 |
commit | 6f34be7400c68d3f761ceca405edabb94ccfcd03 (patch) | |
tree | c9b17e94a3b608c186d139fb2befe5c3c33d5c8d /drivers/i2c | |
parent | 27bce457d5884dcae96df9a0d71de3647a538118 (diff) | |
download | talos-op-linux-6f34be7400c68d3f761ceca405edabb94ccfcd03.tar.gz talos-op-linux-6f34be7400c68d3f761ceca405edabb94ccfcd03.zip |
i2c: core: Fix probing of i2c slaves without interrupts
Since commit 2fd36c55264926e2 ("i2c: core: Map OF IRQ at probe time"),
i2c slaves without interrupts (e.g. da9210 and at24 on r8a7791/koelsch)
fail to probe:
at24: probe of 2-0050 failed with error -22
da9210: probe of 6-0068 failed with error -22
This happens because the call to of_irq_get() in i2c_device_probe()
returns -EINVAL.
If a device node does not have an "interrupts" property,
of_irq_parse_one() fails. Unlike irq_of_parse_and_map(), of_irq_get()
does not ignore errors from of_irq_parse_one(), but forwards them.
Make i2c_device_probe() ignore all errors but -EPROBE_DEFER to fix this,
just like platform_get_irq() and platform_get_irq_byname() already do.
Fixes: 2fd36c55264926e2 ("i2c: core: Map OF IRQ at probe time")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index a0768d6dffc2..cf830915713b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -629,8 +629,10 @@ static int i2c_device_probe(struct device *dev) if (!client->irq && dev->of_node) { int irq = of_irq_get(dev->of_node, 0); - if (irq < 0) + if (irq == -EPROBE_DEFER) return irq; + if (irq < 0) + irq = 0; client->irq = irq; } |