Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-20 Thread Pavel Machek
Hi! > > > +static void (*old_apm_get_power_status)(struct apm_power_info*); > > > + > > > +static int __init apm_battery_init(void) > > > +{ > > > + printk(KERN_INFO "APM Battery Driver\n"); > > > + > > > + old_apm_get_power_status = apm_get_power_status; > > > + apm_get_power_status =

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-20 Thread Pavel Machek
Hi! +static void (*old_apm_get_power_status)(struct apm_power_info*); + +static int __init apm_battery_init(void) +{ + printk(KERN_INFO APM Battery Driver\n); + + old_apm_get_power_status = apm_get_power_status; + apm_get_power_status = apm_battery_apm_get_power_status;

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Russell King
On Tue, Apr 17, 2007 at 01:08:29AM +0400, Anton Vorontsov wrote: > On Mon, Apr 16, 2007 at 09:24:21PM +0100, Russell King wrote: > > Utterly unsafe. What happens if some other module gets loaded which > > does this, and then this module is unloaded followed by the other > > module. Result: Oops.

Re: [Kernel-discuss] Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Paul Sokolovsky
Hello Russell, Monday, April 16, 2007, 11:24:21 PM, you wrote: > On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: >> +static void (*old_apm_get_power_status)(struct apm_power_info*); >> + >> +static int __init apm_battery_init(void) >> +{ >> + printk(KERN_INFO "APM Battery

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Anton Vorontsov
On Mon, Apr 16, 2007 at 09:24:21PM +0100, Russell King wrote: > On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: > > +static void (*old_apm_get_power_status)(struct apm_power_info*); > > + > > +static int __init apm_battery_init(void) > > +{ > > + printk(KERN_INFO "APM Battery

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Russell King
On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: > +static void (*old_apm_get_power_status)(struct apm_power_info*); > + > +static int __init apm_battery_init(void) > +{ > + printk(KERN_INFO "APM Battery Driver\n"); > + > + old_apm_get_power_status = apm_get_power_status; >

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Russell King
On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: +static void (*old_apm_get_power_status)(struct apm_power_info*); + +static int __init apm_battery_init(void) +{ + printk(KERN_INFO APM Battery Driver\n); + + old_apm_get_power_status = apm_get_power_status; +

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Anton Vorontsov
On Mon, Apr 16, 2007 at 09:24:21PM +0100, Russell King wrote: On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: +static void (*old_apm_get_power_status)(struct apm_power_info*); + +static int __init apm_battery_init(void) +{ + printk(KERN_INFO APM Battery Driver\n); +

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Russell King
On Tue, Apr 17, 2007 at 01:08:29AM +0400, Anton Vorontsov wrote: On Mon, Apr 16, 2007 at 09:24:21PM +0100, Russell King wrote: Utterly unsafe. What happens if some other module gets loaded which does this, and then this module is unloaded followed by the other module. Result: Oops.

Re: [Kernel-discuss] Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-16 Thread Paul Sokolovsky
Hello Russell, Monday, April 16, 2007, 11:24:21 PM, you wrote: On Fri, Apr 13, 2007 at 05:50:43PM +0400, Anton Vorontsov wrote: +static void (*old_apm_get_power_status)(struct apm_power_info*); + +static int __init apm_battery_init(void) +{ + printk(KERN_INFO APM Battery Driver\n); +

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-13 Thread Anton Vorontsov
On Thu, Apr 12, 2007 at 03:26:44AM +0400, Anton Vorontsov wrote: > It finds battery with "main_battery" flag set (or with max_capacity if no > batteries marked as main), and converts battery values to APM form. Changes: - follows battery class changes - minor cleanups Subject: [PATCH] [take2]

Re: [PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-13 Thread Anton Vorontsov
On Thu, Apr 12, 2007 at 03:26:44AM +0400, Anton Vorontsov wrote: It finds battery with main_battery flag set (or with max_capacity if no batteries marked as main), and converts battery values to APM form. Changes: - follows battery class changes - minor cleanups Subject: [PATCH] [take2] APM

[PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-11 Thread Anton Vorontsov
It finds battery with "main_battery" flag set (or with max_capacity if no batteries marked as main), and converts battery values to APM form. --- drivers/battery/Kconfig |7 +++ drivers/battery/Makefile|1 + drivers/battery/apm_power.c | 121

[PATCH 7/7] [RFC] APM emulation driver for class batteries

2007-04-11 Thread Anton Vorontsov
It finds battery with main_battery flag set (or with max_capacity if no batteries marked as main), and converts battery values to APM form. --- drivers/battery/Kconfig |7 +++ drivers/battery/Makefile|1 + drivers/battery/apm_power.c | 121