include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / i2c / busses / i2c-pnx.c
index afc9c96..2471033 100644 (file)
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/slab.h>
 
 #include <mach/hardware.h>
 #include <mach/i2c.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
 
 #define I2C_PNX_TIMEOUT                10 /* msec */
 #define I2C_PNX_SPEED_KHZ      100
@@ -55,14 +54,14 @@ static inline int wait_reset(long timeout, struct i2c_pnx_algo_data *data)
 static inline void i2c_pnx_arm_timer(struct i2c_pnx_algo_data *alg_data)
 {
        struct timer_list *timer = &alg_data->mif.timer;
-       int expires = I2C_PNX_TIMEOUT / (1000 / HZ);
+       unsigned long expires = msecs_to_jiffies(I2C_PNX_TIMEOUT);
 
        if (expires <= 1)
                expires = 2;
 
        del_timer_sync(timer);
 
-       dev_dbg(&alg_data->adapter.dev, "Timer armed at %lu plus %u jiffies.\n",
+       dev_dbg(&alg_data->adapter.dev, "Timer armed at %lu plus %lu jiffies.\n",
                jiffies, expires);
 
        timer->expires = jiffies + expires;
@@ -174,12 +173,6 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
                /* We still have something to talk about... */
                val = *alg_data->mif.buf++;
 
-               if (alg_data->mif.len == 1) {
-                       val |= stop_bit;
-                       if (!alg_data->last)
-                               val |= start_bit;
-               }
-
                alg_data->mif.len--;
                iowrite32(val, I2C_REG_TX(alg_data));
 
@@ -253,11 +246,6 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data)
                        __func__);
 
                if (alg_data->mif.len == 1) {
-                       /* Last byte, do not acknowledge next rcv. */
-                       val |= stop_bit;
-                       if (!alg_data->last)
-                               val |= start_bit;
-
                        /*
                         * Enable interrupt RFDAIE (data in Rx fifo),
                         * and disable DRMIE (need data for Tx)