Skip to content

Commit

Permalink
[WATCHDOG] Fix it8712f_wdt.c wrong byte order accessing WDT_TIMEOUT
Browse files Browse the repository at this point in the history
This patch corrects an error in the driver it8712f_wdt.  You cannot set
the 16-bit WDT_TIMEOUT access as a 16-bit outw, because the byte
ordering will be wrong.  So just do the high 8 bits as a separate
access.

Signed-off-by: Oliver Schuster <olivers137@aol.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oliver Schuster authored and Linus Torvalds committed Apr 1, 2008
1 parent d5f1a21 commit 0e45adb
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/watchdog/it8712f_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ superio_inw(int reg)
return val;
}

static void
superio_outw(int val, int reg)
{
outb(reg++, REG);
outb((val >> 8) & 0xff, VAL);
outb(reg, REG);
outb(val & 0xff, VAL);
}

static inline void
superio_select(int ldn)
{
Expand Down Expand Up @@ -170,9 +161,8 @@ it8712f_wdt_update_margin(void)
superio_outb(config, WDT_CONFIG);

if (revision >= 0x08)
superio_outw(units, WDT_TIMEOUT);
else
superio_outb(units, WDT_TIMEOUT);
superio_outb(units >> 8, WDT_TIMEOUT + 1);
superio_outb(units, WDT_TIMEOUT);
}

static int
Expand Down

0 comments on commit 0e45adb

Please sign in to comment.