.detach_adapter = therm_pm72_detach,
};
-
-static inline void wait_ms(unsigned int ms)
-{
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(1 + (ms * HZ + 999) / 1000);
-}
-
/*
* Utility function to create an i2c_client structure and
* attach it to one of u3 adapters
if (rc <= 0)
goto error;
/* Wait for convertion */
- wait_ms(1);
+ msleep(1);
/* Switch to data register */
buf[0] = 4;
rc = i2c_master_send(state->monitor, buf, 1);
printk(KERN_ERR "therm_pm72: Error reading ADC !\n");
return -1;
}
- wait_ms(10);
+ msleep(10);
}
}
nw = i2c_master_send(fcu, buf, 1);
if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
break;
- wait_ms(10);
+ msleep(10);
++tries;
}
if (nw <= 0) {
nr = i2c_master_recv(fcu, buf, nb);
if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
break;
- wait_ms(10);
+ msleep(10);
++tries;
}
if (nr <= 0)
nw = i2c_master_send(fcu, buf, nb);
if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
break;
- wait_ms(10);
+ msleep(10);
++tries;
}
if (nw < 0)