Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: rtc-ds1374: fix 'no irq' case handling

On a PowerPC board with ds1374 RTC I'm getting this error while RTC tries
to probe:

rtc-ds1374 0-0068: unable to request IRQ

This happens because I2C probing code (drivers/of/of_i2c.c) is specifying
IRQ0 for 'no irq' case, which is correct.

The driver handles this incorrectly, though. This patch fixes it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Anton Vorontsov and committed by
Linus Torvalds
b42f9317 14bac5ac

+5 -5
+5 -5
drivers/rtc/rtc-ds1374.c
··· 173 173 int cr, sr; 174 174 int ret = 0; 175 175 176 - if (client->irq < 0) 176 + if (client->irq <= 0) 177 177 return -EINVAL; 178 178 179 179 mutex_lock(&ds1374->mutex); ··· 212 212 int cr; 213 213 int ret = 0; 214 214 215 - if (client->irq < 0) 215 + if (client->irq <= 0) 216 216 return -EINVAL; 217 217 218 218 ret = ds1374_read_time(dev, &now); ··· 381 381 if (ret) 382 382 goto out_free; 383 383 384 - if (client->irq >= 0) { 384 + if (client->irq > 0) { 385 385 ret = request_irq(client->irq, ds1374_irq, 0, 386 386 "ds1374", client); 387 387 if (ret) { ··· 401 401 return 0; 402 402 403 403 out_irq: 404 - if (client->irq >= 0) 404 + if (client->irq > 0) 405 405 free_irq(client->irq, client); 406 406 407 407 out_free: ··· 414 414 { 415 415 struct ds1374 *ds1374 = i2c_get_clientdata(client); 416 416 417 - if (client->irq >= 0) { 417 + if (client->irq > 0) { 418 418 mutex_lock(&ds1374->mutex); 419 419 ds1374->exiting = 1; 420 420 mutex_unlock(&ds1374->mutex);