diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-08-20 17:09:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-20 18:40:32 -0400 |
commit | b42f931737bea8ca3982449d63ec46410d13e891 (patch) | |
tree | e14f8a0b2ad65049aad10e79d1305ff33be74672 /drivers/rtc/rtc-ds1374.c | |
parent | 14bac5acfdb6a40be64acc042c6db73f1a68f6a4 (diff) |
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>
Diffstat (limited to 'drivers/rtc/rtc-ds1374.c')
-rw-r--r-- | drivers/rtc/rtc-ds1374.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 640acd20fdde..a150418fba76 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -173,7 +173,7 @@ static int ds1374_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
173 | int cr, sr; | 173 | int cr, sr; |
174 | int ret = 0; | 174 | int ret = 0; |
175 | 175 | ||
176 | if (client->irq < 0) | 176 | if (client->irq <= 0) |
177 | return -EINVAL; | 177 | return -EINVAL; |
178 | 178 | ||
179 | mutex_lock(&ds1374->mutex); | 179 | mutex_lock(&ds1374->mutex); |
@@ -212,7 +212,7 @@ static int ds1374_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
212 | int cr; | 212 | int cr; |
213 | int ret = 0; | 213 | int ret = 0; |
214 | 214 | ||
215 | if (client->irq < 0) | 215 | if (client->irq <= 0) |
216 | return -EINVAL; | 216 | return -EINVAL; |
217 | 217 | ||
218 | ret = ds1374_read_time(dev, &now); | 218 | ret = ds1374_read_time(dev, &now); |
@@ -381,7 +381,7 @@ static int ds1374_probe(struct i2c_client *client, | |||
381 | if (ret) | 381 | if (ret) |
382 | goto out_free; | 382 | goto out_free; |
383 | 383 | ||
384 | if (client->irq >= 0) { | 384 | if (client->irq > 0) { |
385 | ret = request_irq(client->irq, ds1374_irq, 0, | 385 | ret = request_irq(client->irq, ds1374_irq, 0, |
386 | "ds1374", client); | 386 | "ds1374", client); |
387 | if (ret) { | 387 | if (ret) { |
@@ -401,7 +401,7 @@ static int ds1374_probe(struct i2c_client *client, | |||
401 | return 0; | 401 | return 0; |
402 | 402 | ||
403 | out_irq: | 403 | out_irq: |
404 | if (client->irq >= 0) | 404 | if (client->irq > 0) |
405 | free_irq(client->irq, client); | 405 | free_irq(client->irq, client); |
406 | 406 | ||
407 | out_free: | 407 | out_free: |
@@ -414,7 +414,7 @@ static int __devexit ds1374_remove(struct i2c_client *client) | |||
414 | { | 414 | { |
415 | struct ds1374 *ds1374 = i2c_get_clientdata(client); | 415 | struct ds1374 *ds1374 = i2c_get_clientdata(client); |
416 | 416 | ||
417 | if (client->irq >= 0) { | 417 | if (client->irq > 0) { |
418 | mutex_lock(&ds1374->mutex); | 418 | mutex_lock(&ds1374->mutex); |
419 | ds1374->exiting = 1; | 419 | ds1374->exiting = 1; |
420 | mutex_unlock(&ds1374->mutex); | 420 | mutex_unlock(&ds1374->mutex); |