[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120708.235926.1117975937932919247.davem@davemloft.net>
Date: Sun, 08 Jul 2012 23:59:26 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: timur@...escale.com
Cc: afleming@...escale.com, netdev@...r.kernel.org
Subject: Re: [PATCH] net/fsl_pq_mdio: use spin_event_timeout() to poll the
indicator register
From: Timur Tabi <timur@...escale.com>
Date: Tue, 3 Jul 2012 18:16:21 -0500
> Macro spin_event_timeout() was designed for simple polling of hardware
> registers with a timeout, so use it when we poll the MIIMIND register.
> This allows us to return an error code instead of polling indefinitely.
>
> Note that PHY_INIT_TIMEOUT is a count of loop iterations, so we can't use
> it for spin_event_timeout(), which asks for microseconds.
>
> Signed-off-by: Timur Tabi <timur@...escale.com>
Define a macro for the timeout value rather than use an arbitrary
constant.
> + status = spin_event_timeout(!(in_be32(®s->miimind) & MIIMIND_BUSY),
> + 1000, 0);
This indentation is absolutely terrible.
> + status = spin_event_timeout(!(in_be32(®s->miimind) &
> + (MIIMIND_NOTVALID | MIIMIND_BUSY)), 1000, 0);
Same here.
> + status = spin_event_timeout(!(in_be32(®s->miimind) & MIIMIND_BUSY),
> + 1000, 0);
And here too.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists