diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-pnx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index 6ff6c20f1e78..fbab6846ae64 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c | |||
@@ -19,7 +19,9 @@ | |||
19 | #include <linux/completion.h> | 19 | #include <linux/completion.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/i2c-pnx.h> | 21 | #include <linux/i2c-pnx.h> |
22 | #include <linux/io.h> | ||
22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/i2c.h> | ||
23 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
24 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
25 | 27 | ||
@@ -54,6 +56,9 @@ static inline void i2c_pnx_arm_timer(struct i2c_adapter *adap) | |||
54 | struct timer_list *timer = &data->mif.timer; | 56 | struct timer_list *timer = &data->mif.timer; |
55 | int expires = I2C_PNX_TIMEOUT / (1000 / HZ); | 57 | int expires = I2C_PNX_TIMEOUT / (1000 / HZ); |
56 | 58 | ||
59 | if (expires <= 1) | ||
60 | expires = 2; | ||
61 | |||
57 | del_timer_sync(timer); | 62 | del_timer_sync(timer); |
58 | 63 | ||
59 | dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n", | 64 | dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n", |
@@ -645,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev) | |||
645 | return 0; | 650 | return 0; |
646 | 651 | ||
647 | out_irq: | 652 | out_irq: |
648 | free_irq(alg_data->irq, alg_data); | 653 | free_irq(alg_data->irq, i2c_pnx->adapter); |
649 | out_clock: | 654 | out_clock: |
650 | i2c_pnx->set_clock_stop(pdev); | 655 | i2c_pnx->set_clock_stop(pdev); |
651 | out_unmap: | 656 | out_unmap: |
@@ -664,7 +669,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev) | |||
664 | struct i2c_adapter *adap = i2c_pnx->adapter; | 669 | struct i2c_adapter *adap = i2c_pnx->adapter; |
665 | struct i2c_pnx_algo_data *alg_data = adap->algo_data; | 670 | struct i2c_pnx_algo_data *alg_data = adap->algo_data; |
666 | 671 | ||
667 | free_irq(alg_data->irq, alg_data); | 672 | free_irq(alg_data->irq, i2c_pnx->adapter); |
668 | i2c_del_adapter(adap); | 673 | i2c_del_adapter(adap); |
669 | i2c_pnx->set_clock_stop(pdev); | 674 | i2c_pnx->set_clock_stop(pdev); |
670 | iounmap((void *)alg_data->ioaddr); | 675 | iounmap((void *)alg_data->ioaddr); |