===================================================================
@@ -291,8 +291,13 @@ static int pmcmsptwi_probe(struct platfo
}
/* request the irq */
- pmcmsptwi_data.irq = platform_get_irq(pldev, 0);
- if (pmcmsptwi_data.irq) {
+ rc = platform_get_irq(pldev, 0);
+ if (rc == -EPROBE_DEFER)
+ return rc;
+ if (rc <= 0) {
+ pmcmsptwi_data.irq = 0;
+ } else {
+ pmcmsptwi_data.irq = rc;
rc = request_irq(pmcmsptwi_data.irq, &pmcmsptwi_interrupt,
IRQF_SHARED, pldev->name, &pmcmsptwi_data);
if (rc == 0) {
The driver's probe() method is written as if platform_get_irq() returns 0 on error, while actually it returns a negative error code (with all the other values considered valid IRQs). Rewrite the driver's IRQ checking code to pass the positive IRQ #s to request_irq(), propagate -EPROBE_DEFER upstream, and use the polling mode when platform_get_irq() returns negative error code or 0... Fixes: 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver") Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- drivers/i2c/busses/i2c-pmcmsp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)