From patchwork Fri Jul 1 08:03:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 934782 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6183KUP012623 for ; Fri, 1 Jul 2011 08:03:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755126Ab1GAIDT (ORCPT ); Fri, 1 Jul 2011 04:03:19 -0400 Received: from mga09.intel.com ([134.134.136.24]:46717 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755121Ab1GAIDR (ORCPT ); Fri, 1 Jul 2011 04:03:17 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 01 Jul 2011 01:03:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,456,1304319600"; d="scan'208";a="20460256" Received: from lantianyu-ws.sh.intel.com (HELO localhost) ([10.239.35.77]) by orsmga002.jf.intel.com with ESMTP; 01 Jul 2011 01:03:13 -0700 From: Lan Tianyu To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, tianyu.lan@intel.com, rui.zhang@intel.com Subject: [PATCH 1/2] ACPI / SBS: Add getting state operation in the acpi_sbs_battery_get_property() Date: Fri, 1 Jul 2011 16:03:15 +0800 Message-Id: <1309507395-19211-1-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.7.6.rc2.8.g28eb Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Jul 2011 08:03:21 +0000 (UTC) https://bugzilla.kernel.org/show_bug.cgi?id=24492 Signed-off-by: Lan Tianyu --- drivers/acpi/sbs.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 51ae379..01dad1b 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -130,6 +130,9 @@ struct acpi_sbs { #define to_acpi_sbs(x) container_of(x, struct acpi_sbs, charger) +static int acpi_sbs_remove(struct acpi_device *device, int type); +static int acpi_battery_get_state(struct acpi_battery *battery); + static inline int battery_scale(int log) { int scale = 1; @@ -195,6 +198,8 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy, if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT) return -ENODEV; + + acpi_battery_get_state(battery); switch (psp) { case POWER_SUPPLY_PROP_STATUS: if (battery->rate_now < 0) @@ -903,8 +908,6 @@ static void acpi_sbs_callback(void *context) } } -static int acpi_sbs_remove(struct acpi_device *device, int type); - static int acpi_sbs_add(struct acpi_device *device) { struct acpi_sbs *sbs;