Thread (13 messages) flat view 13 messages, 4 authors, 2004-07-02

Re: [PATCH][RFC]Updated MPC I2C driver

From: Eugene Surovegin <hidden>
Date: 2004-07-01 18:59:51

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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help