diff options
| -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); |
