diff options
author | Jon Smirl <jonsmirl@gmail.com> | 2008-05-11 14:37:04 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-05-11 14:37:04 -0400 |
commit | f5fff3602a67ff8c98fccdbf15959780be542802 (patch) | |
tree | 16c93feec5711eb5139466156b680c2d68f50785 /drivers/i2c/busses | |
parent | 9662369786b9d07fd46d65b0f9e3938a3e01a5d9 (diff) |
i2c-mpc: Compare to NO_IRQ instead of zero
Alter the mpc i2c driver to use the NO_IRQ symbol instead of the constant
zero when checking for valid interrupts. NO_IRQ=-1 on ppc and NO_IRQ=0 on
powerpc so the checks against zero are not correct.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-mpc.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 18beb0ad7bf3..a076129de7e8 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing) | |||
99 | u32 x; | 99 | u32 x; |
100 | int result = 0; | 100 | int result = 0; |
101 | 101 | ||
102 | if (i2c->irq == 0) | 102 | if (i2c->irq == NO_IRQ) |
103 | { | 103 | { |
104 | while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) { | 104 | while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) { |
105 | schedule(); | 105 | schedule(); |
@@ -329,10 +329,9 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
329 | return -ENOMEM; | 329 | return -ENOMEM; |
330 | 330 | ||
331 | i2c->irq = platform_get_irq(pdev, 0); | 331 | i2c->irq = platform_get_irq(pdev, 0); |
332 | if (i2c->irq < 0) { | 332 | if (i2c->irq < 0) |
333 | result = -ENXIO; | 333 | i2c->irq = NO_IRQ; /* Use polling */ |
334 | goto fail_get_irq; | 334 | |
335 | } | ||
336 | i2c->flags = pdata->device_flags; | 335 | i2c->flags = pdata->device_flags; |
337 | init_waitqueue_head(&i2c->queue); | 336 | init_waitqueue_head(&i2c->queue); |
338 | 337 | ||
@@ -344,7 +343,7 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
344 | goto fail_map; | 343 | goto fail_map; |
345 | } | 344 | } |
346 | 345 | ||
347 | if (i2c->irq != 0) | 346 | if (i2c->irq != NO_IRQ) |
348 | if ((result = request_irq(i2c->irq, mpc_i2c_isr, | 347 | if ((result = request_irq(i2c->irq, mpc_i2c_isr, |
349 | IRQF_SHARED, "i2c-mpc", i2c)) < 0) { | 348 | IRQF_SHARED, "i2c-mpc", i2c)) < 0) { |
350 | printk(KERN_ERR | 349 | printk(KERN_ERR |
@@ -367,12 +366,11 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
367 | return result; | 366 | return result; |
368 | 367 | ||
369 | fail_add: | 368 | fail_add: |
370 | if (i2c->irq != 0) | 369 | if (i2c->irq != NO_IRQ) |
371 | free_irq(i2c->irq, i2c); | 370 | free_irq(i2c->irq, i2c); |
372 | fail_irq: | 371 | fail_irq: |
373 | iounmap(i2c->base); | 372 | iounmap(i2c->base); |
374 | fail_map: | 373 | fail_map: |
375 | fail_get_irq: | ||
376 | kfree(i2c); | 374 | kfree(i2c); |
377 | return result; | 375 | return result; |
378 | }; | 376 | }; |
@@ -384,7 +382,7 @@ static int fsl_i2c_remove(struct platform_device *pdev) | |||
384 | i2c_del_adapter(&i2c->adap); | 382 | i2c_del_adapter(&i2c->adap); |
385 | platform_set_drvdata(pdev, NULL); | 383 | platform_set_drvdata(pdev, NULL); |
386 | 384 | ||
387 | if (i2c->irq != 0) | 385 | if (i2c->irq != NO_IRQ) |
388 | free_irq(i2c->irq, i2c); | 386 | free_irq(i2c->irq, i2c); |
389 | 387 | ||
390 | iounmap(i2c->base); | 388 | iounmap(i2c->base); |