mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 11:54:10 +00:00
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>
This commit is contained in:
parent
14bac5acfd
commit
b42f931737
1 changed files with 5 additions and 5 deletions
|
@ -173,7 +173,7 @@ static int ds1374_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
|
||||||
int cr, sr;
|
int cr, sr;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (client->irq < 0)
|
if (client->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&ds1374->mutex);
|
mutex_lock(&ds1374->mutex);
|
||||||
|
@ -212,7 +212,7 @@ static int ds1374_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
|
||||||
int cr;
|
int cr;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (client->irq < 0)
|
if (client->irq <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = ds1374_read_time(dev, &now);
|
ret = ds1374_read_time(dev, &now);
|
||||||
|
@ -381,7 +381,7 @@ static int ds1374_probe(struct i2c_client *client,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
if (client->irq >= 0) {
|
if (client->irq > 0) {
|
||||||
ret = request_irq(client->irq, ds1374_irq, 0,
|
ret = request_irq(client->irq, ds1374_irq, 0,
|
||||||
"ds1374", client);
|
"ds1374", client);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -401,7 +401,7 @@ static int ds1374_probe(struct i2c_client *client,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_irq:
|
out_irq:
|
||||||
if (client->irq >= 0)
|
if (client->irq > 0)
|
||||||
free_irq(client->irq, client);
|
free_irq(client->irq, client);
|
||||||
|
|
||||||
out_free:
|
out_free:
|
||||||
|
@ -414,7 +414,7 @@ static int __devexit ds1374_remove(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
struct ds1374 *ds1374 = i2c_get_clientdata(client);
|
struct ds1374 *ds1374 = i2c_get_clientdata(client);
|
||||||
|
|
||||||
if (client->irq >= 0) {
|
if (client->irq > 0) {
|
||||||
mutex_lock(&ds1374->mutex);
|
mutex_lock(&ds1374->mutex);
|
||||||
ds1374->exiting = 1;
|
ds1374->exiting = 1;
|
||||||
mutex_unlock(&ds1374->mutex);
|
mutex_unlock(&ds1374->mutex);
|
||||||
|
|
Loading…
Add table
Reference in a new issue