lkml.org 
[lkml]   [2012]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] apple_gmux: Add support for newer hardware
On Mon, Aug 13, 2012 at 04:20:32PM -0400, Matthew Garrett wrote:
> +static int gmux_index_wait_ready(struct apple_gmux_data *gmux_data)
> +{
> + int i = 200;
> + u8 gwr = inb(gmux_data->iostart + GMUX_PORT_WRITE);
> +
> + while (i && (gwr & 0x01)) {
> + inb(gmux_data->iostart + GMUX_PORT_READ);
> + gwr = inb(gmux_data->iostart + GMUX_PORT_WRITE);
> + msleep(100);

Wouldn't it make more sense if the msleep was before reading the port
again? Otherwise there's no substantial dely between the first and
second times we read it.

> +static int gmux_index_wait_complete(struct apple_gmux_data *gmux_data)
> +{
> + int i = 200;
> + u8 gwr = inb(gmux_data->iostart + GMUX_PORT_WRITE);
> +
> + while (i && (gwr & 0x01)) {
> + gwr = inb(gmux_data->iostart + GMUX_PORT_WRITE);
> + msleep(100);

Likewise.



\
 
 \ /
  Last update: 2012-08-13 23:42    [W:1.143 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site