[PATCH][RFC]Updated MPC I2C driver
Eugene Surovegin
ebs at ebshome.net
Fri Jul 2 04:59:51 EST 2004
On Thu, Jul 01, 2004 at 07:19:15PM +0100, Adrian Cox wrote:
[snip]
> +static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
> +{
> + DECLARE_WAITQUEUE(wait, current);
> + unsigned long orig_jiffies = jiffies;
> + u32 x;
> + int result = 0;
> +
> + if (i2c->ocpdef->irq == OCP_IRQ_NA) {
> + while(! (readl(i2c->base + MPC_I2C_SR) & CSR_MIF)) {
> + schedule();
> + if (orig_jiffies + timeout < jiffies) {
This doesn't look right. Please, use time_after()/time_before() here.
--
Eugene
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-embedded
mailing list