From patchwork Tue Jun 30 14:35:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 33118 X-Patchwork-Delegate: astarikovskiy@suse.de Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5UEZCDw021009 for ; Tue, 30 Jun 2009 14:35:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757405AbZF3OfG (ORCPT ); Tue, 30 Jun 2009 10:35:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757070AbZF3OfG (ORCPT ); Tue, 30 Jun 2009 10:35:06 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:56709 "EHLO mail-ew0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757586AbZF3OfF (ORCPT ); Tue, 30 Jun 2009 10:35:05 -0400 Received: by ewy6 with SMTP id 6so228703ewy.37 for ; Tue, 30 Jun 2009 07:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=EWOlDYsE/ZgwZ2YHYGxum/4NYTkGbfj8kVZzwqdKuyg=; b=ggaKRNFj78aO0K76lq16QObJgFg8oGWrj/DHWZkIymE4NmAbwi42jzD9Y1R0RoNhEH WnI58y9GeSh8zFD0XteKw3po7YJcabTPN6r95kWiju9wu2oeuhltpAwlvkRPpLHRIJEt q46JO46lYre65v7n+p0kSdi5iuJinO7C3MmbA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=A3PslArS8bG+lRSDbHCin/SLigfTnCoemxLWxGJEPNhZQ2ZH5HheF+O6ut7yG2ur5v YePjxk02ySsJ6zbvBJE0EwXzwKdliHLH+NU7tStIvQdiQeIc/fWNBTcLbDMRxwI60vAG 5B8wF3mGrw5PhIOOpzn9BWASCyU36LiTh471E= Received: by 10.210.43.11 with SMTP id q11mr237765ebq.15.1246372507821; Tue, 30 Jun 2009 07:35:07 -0700 (PDT) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 28sm279801eye.36.2009.06.30.07.35.06 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Jun 2009 07:35:07 -0700 (PDT) Message-ID: <4A4A2299.8060401@tuffmail.co.uk> Date: Tue, 30 Jun 2009 15:35:05 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: linux acpi CC: Alexey Starikovskiy Subject: [RESEND] [PATCH 1/3] ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n References: <4A4A219C.2020802@tuffmail.co.uk> In-Reply-To: <4A4A219C.2020802@tuffmail.co.uk> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Disabling CONFIG_ACPI_SYSFS_POWER changes the behaviour of acpi_battery_update(). It will call acpi_battery_get_info() even if the battery is not present. I haven't noticed this causing any problem, but it does look like a bad idea. Signed-off-by: Alan Jenkins CC: Alexey Starikovskiy --- drivers/acpi/battery.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 58b4517..908edce 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -501,13 +501,13 @@ static int acpi_battery_update(struct acpi_battery *battery) result = acpi_battery_get_status(battery); if (result) return result; -#ifdef CONFIG_ACPI_SYSFS_POWER if (!acpi_battery_present(battery)) { +#ifdef CONFIG_ACPI_SYSFS_POWER sysfs_remove_battery(battery); +#endif battery->update_time = 0; return 0; } -#endif if (!battery->update_time || old_present != acpi_battery_present(battery)) { result = acpi_battery_get_info(battery);