[-mm patch] drivers/battery/olpc_battery.c: fix compilation

Adrian Bunk
2007-05-05T17:19:38Z

On Sat, May 05, 2007 at 01:49:55AM -0700, Andrew Morton wrote:
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21/2.6.21-mm1/
>
>
> - Added the git-battery tree to the -mm lineup (Anton Vorontsov
> <cbou@mail.ru>). It presently generates mysterious depmod error messages.
>...
> Changes since 2.6.21-rc7-mm2:
>...
> git-battery.patch
>...
> git trees
>...

This patch fixes the following compile error:

<-- snip -->

...
CC drivers/battery/olpc_battery.o
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c: In function ‘lock_ec’:
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:42: error: ‘jiffies’ undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:42: error: (Each undeclared identifier is reported only once
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:42: error: for each function it appears in.)
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:42: error: ‘HZ’ undeclared (first use in this function)
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:48: error: implicit declaration of function ‘time_after’
/home/bunk/linux/kernel-2.6/linux-2.6.21-mm1/drivers/battery/olpc_battery.c:53: error: implicit declaration of function ‘yield’
make[3]: *** [drivers/battery/olpc_battery.o] Error 1

<-- snip -->

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
--- linux-2.6.21-mm1/drivers/battery/olpc_battery.c.old 2007-05-05 19:05:17.000000000 +0200
+++ linux-2.6.21-mm1/drivers/battery/olpc_battery.c 2007-05-05 19:07:30.000000000 +0200
@@ -13,6 +13,8 @@
#include <linux/platform_device.h>
#include <linux/external_power.h>
#include <linux/battery.h>
+#include <linux/jiffies.h>
+#include <linux/sched.h>
#include <asm/io.h>

#define wBAT_VOLTAGE 0xf900 /* *9.76/32, mV */