From 83cb22a862fbae1203e9cba90df4c36f73e64e30 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 13 Aug 2006 10:57:49 +0200 Subject: [GCC4] fix build error in drivers/char/sonypi.h This patch fixes these errors with gcc 4 : In file included from sonypi.c:51: sonypi.h: In function 'sonypi_ec_write': sonypi.h:409: error: 'verbose' undeclared (first use in this function) sonypi.h:409: error: (Each undeclared identifier is reported only once sonypi.h:409: error: for each function it appears in.) sonypi.h: In function 'sonypi_ec_read': sonypi.h:424: error: 'verbose' undeclared (first use in this function) --- drivers/char/sonypi.c | 29 +++++++++++++++++++++++++++++ drivers/char/sonypi.h | 29 ----------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index bc092e6..6cba9b1 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -60,6 +60,35 @@ static int compat; /* = 0 */ static int useinput = 1; static unsigned long mask = 0xffffffff; +static inline int sonypi_ec_write(u8 addr, u8 value) { +#ifdef CONFIG_ACPI_EC + if (SONYPI_ACPI_ACTIVE) + return ec_write(addr, value); +#endif + wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG); + outb_p(0x81, SONYPI_CST_IOPORT); + wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); + outb_p(addr, SONYPI_DATA_IOPORT); + wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); + outb_p(value, SONYPI_DATA_IOPORT); + wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); + return 0; +} + +static inline int sonypi_ec_read(u8 addr, u8 *value) { +#ifdef CONFIG_ACPI_EC + if (SONYPI_ACPI_ACTIVE) + return ec_read(addr, value); +#endif + wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG); + outb_p(0x80, SONYPI_CST_IOPORT); + wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); + outb_p(addr, SONYPI_DATA_IOPORT); + wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); + *value = inb_p(SONYPI_DATA_IOPORT); + return 0; +} + /* Inits the queue */ static inline void sonypi_initq(void) { sonypi_device.queue.head = sonypi_device.queue.tail = 0; diff --git a/drivers/char/sonypi.h b/drivers/char/sonypi.h index 2546a39..545f056 100644 --- a/drivers/char/sonypi.h +++ b/drivers/char/sonypi.h @@ -401,35 +401,6 @@ #else #define SONYPI_ACPI_ACTIVE 0 #endif /* CONFIG_ACPI */ -static inline int sonypi_ec_write(u8 addr, u8 value) { -#ifdef CONFIG_ACPI_EC - if (SONYPI_ACPI_ACTIVE) - return ec_write(addr, value); -#endif - wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG); - outb_p(0x81, SONYPI_CST_IOPORT); - wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); - outb_p(addr, SONYPI_DATA_IOPORT); - wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); - outb_p(value, SONYPI_DATA_IOPORT); - wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); - return 0; -} - -static inline int sonypi_ec_read(u8 addr, u8 *value) { -#ifdef CONFIG_ACPI_EC - if (SONYPI_ACPI_ACTIVE) - return ec_read(addr, value); -#endif - wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG); - outb_p(0x80, SONYPI_CST_IOPORT); - wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); - outb_p(addr, SONYPI_DATA_IOPORT); - wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG); - *value = inb_p(SONYPI_DATA_IOPORT); - return 0; -} - #endif /* __KERNEL__ */ #endif /* _SONYPI_PRIV_H_ */ -- 1.4.2