public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery
       [not found] <alpine.LFD.2.00.0812221748020.20902@localhost.localdomain>
@ 2008-12-22 23:44 ` Alexey Starikovskiy
  2008-12-23  0:34   ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Starikovskiy @ 2008-12-22 23:44 UTC (permalink / raw)
  To: LenBrown; +Cc: Linux-acpi

Newly inserted battery might differ from one just removed, so
update of battery info fields is required.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Acked-by: Andy Neitzke <neitzke@ias.edu>

Signed-off-by: Alexey Starikovskiy <astarikovskiy <at> suse.de>
---

 drivers/acpi/battery.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 1423b0c..65132f9 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
 
 static int acpi_battery_update(struct acpi_battery *battery)
 {
-	int result;
+	int result, old_present = acpi_battery_present(battery);
 	result = acpi_battery_get_status(battery);
 	if (result)
 		return result;
@@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
 		return 0;
 	}
 #endif
-	if (!battery->update_time) {
+	if (!battery->update_time ||
+	    old_present != acpi_battery_present(battery)) {
 		result = acpi_battery_get_info(battery);
 		if (result)
 			return result;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery
  2008-12-22 23:44 ` [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery Alexey Starikovskiy
@ 2008-12-23  0:34   ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2008-12-23  0:34 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Linux-acpi

Applied

-- Len Brown, Intel Open Source Technology Center

On Tue, 23 Dec 2008, Alexey Starikovskiy wrote:

> Newly inserted battery might differ from one just removed, so
> update of battery info fields is required.
> 
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Acked-by: Andy Neitzke <neitzke@ias.edu>
> 
> Signed-off-by: Alexey Starikovskiy <astarikovskiy <at> suse.de>
> ---
> 
>  drivers/acpi/battery.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 1423b0c..65132f9 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
>  
>  static int acpi_battery_update(struct acpi_battery *battery)
>  {
> -	int result;
> +	int result, old_present = acpi_battery_present(battery);
>  	result = acpi_battery_get_status(battery);
>  	if (result)
>  		return result;
> @@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
>  		return 0;
>  	}
>  #endif
> -	if (!battery->update_time) {
> +	if (!battery->update_time ||
> +	    old_present != acpi_battery_present(battery)) {
>  		result = acpi_battery_get_info(battery);
>  		if (result)
>  			return result;
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-23  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.LFD.2.00.0812221748020.20902@localhost.localdomain>
2008-12-22 23:44 ` [PATCH] Subject: [PATCH] ACPI: Battery: Update info for inserted battery Alexey Starikovskiy
2008-12-23  0:34   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox