From patchwork Tue May 12 14:50:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 23255 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 n4CEoM6Q025834 for ; Tue, 12 May 2009 14:50:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbZELOuR (ORCPT ); Tue, 12 May 2009 10:50:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752557AbZELOuR (ORCPT ); Tue, 12 May 2009 10:50:17 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:62837 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbZELOuQ (ORCPT ); Tue, 12 May 2009 10:50:16 -0400 Received: by ewy24 with SMTP id 24so25917ewy.37 for ; Tue, 12 May 2009 07:50:15 -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=VfvV3c0ynRjSDzDQlsIoI/T5tXoQ7bH486oURdt7Bds=; b=QIJJ1b+0Szy6PVd1ep3DGLsec5YMsPzgNwnNLO0mDz4K6gNR3lG6lHQr/HRFDULh8X qgFSREY5rXj5mL2/85zFzDtkuss+J9Eihl9gp/0AJe3xPmkHhqwNriBYZ210g6pijf6k dJcQm30Tt7Zywk8D7DzeyBuHZ4FjO5Wj61K8A= 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=hfflQNeXQ6yefdgJr4gs7Ox4QhP4gt3WCjkXMb08iTg16mjItnajOYHZawY4wkel7c zE9xy6iFMEJYz+a6+Er7PzirePVemegx+yRy51ohcR15KT/StP9X4FjJyH8tYfrX0XUD c7kyFXj/aV7T9N3nmPMHZd2LqBxXdVmcvNBcE= Received: by 10.216.11.72 with SMTP id 50mr4043232wew.64.1242139815176; Tue, 12 May 2009 07:50:15 -0700 (PDT) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 5sm297650eyf.28.2009.05.12.07.50.14 (version=SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 07:50:14 -0700 (PDT) Message-ID: <4A098CA4.40708@tuffmail.co.uk> Date: Tue, 12 May 2009 15:50:12 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: linux acpi CC: Alexey Starikovskiy Subject: [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 --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index b0de631..2ccc87e 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);