From patchwork Tue Jun 30 14:30:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 33117 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 n5UEV22j020058 for ; Tue, 30 Jun 2009 14:31:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583AbZF3Oa5 (ORCPT ); Tue, 30 Jun 2009 10:30:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752840AbZF3Oa5 (ORCPT ); Tue, 30 Jun 2009 10:30:57 -0400 Received: from ey-out-1920.google.com ([74.125.78.146]:22640 "EHLO ey-out-1920.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752583AbZF3Oa4 (ORCPT ); Tue, 30 Jun 2009 10:30:56 -0400 Received: by ey-out-1920.google.com with SMTP id 3so44878eyh.36 for ; Tue, 30 Jun 2009 07:30:58 -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:content-type :content-transfer-encoding; bh=Z9EPZkVOq6j7GI8205UjHdU9A8dUKv6nQyslr6TOMf8=; b=Y+cRRc1UykjZbuMeSHU+FanXcuOb9xeFnjnmqpYphQ/WWuPg0AwMADs5zsvK62JGkf 9l2HpKP6m3gNVY0cBtwv6e1kkDCxNpfav9iPh8H8VaiFy7QtO+Y+io/fdHHuVdc4T3n5 SdqAIEDrPOWwTaCebvfDPF0YrWHlrrGcHYTYE= 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 :content-type:content-transfer-encoding; b=N8cyyuEHkQIRA5RSRlHuUjCwZUqIThvxnWjCuyLg3Peqg3ACOmkcBH/jywpbF0oegR yx+t52oXKKvCCS6rlvKlfa9wV2qGVHJhvN8eMMp/d+VBGenOIP+E1GzjeceqpKy1iaV5 uRZmRqxz4PLR0T9CMQ5VOBoNFkMFT+acmZsQI= Received: by 10.210.61.8 with SMTP id j8mr204098eba.58.1246372258556; Tue, 30 Jun 2009 07:30:58 -0700 (PDT) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 10sm279423eyz.1.2009.06.30.07.30.54 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Jun 2009 07:30:54 -0700 (PDT) Message-ID: <4A4A219C.2020802@tuffmail.co.uk> Date: Tue, 30 Jun 2009 15:30:52 +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 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);