From patchwork Fri Jan 30 14:47:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5751531 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 36AB39F302 for ; Fri, 30 Jan 2015 14:56:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F0B72027D for ; Fri, 30 Jan 2015 14:56:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32723201CE for ; Fri, 30 Jan 2015 14:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964869AbbA3O4B (ORCPT ); Fri, 30 Jan 2015 09:56:01 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:50429 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932896AbbA3Osc (ORCPT ); Fri, 30 Jan 2015 09:48:32 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIZ00FNYVZGYJ80@mailout4.w1.samsung.com>; Fri, 30 Jan 2015 14:52:28 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-16-54cb992add14 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id A8.19.07834.A299BC45; Fri, 30 Jan 2015 14:46:02 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NIZ00EV0VSES470@eusync2.samsung.com>; Fri, 30 Jan 2015 14:48:27 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , Julian Andres Klode , Marc Dietrich , Greg Kroah-Hartman , linux-acpi@vger.kernel.org, linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@opensource.wolfsonmicro.com, ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org, Linus Walleij , Samuel Ortiz , Lee Jones , linux-arm-kernel@lists.infradead.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v3 05/20] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs Date: Fri, 30 Jan 2015 15:47:43 +0100 Message-id: <1422629278-12202-6-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1422629278-12202-1-git-send-email-k.kozlowski@samsung.com> References: <1422629278-12202-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyXRV0yTURTAcW+/0UKs+cr8wgMkTdCkYQbHkRAjPsh9IcGEGOIDWqACYdoC AcVAQEX2KMiWEkYBTQvtgyIVBNllg4gsI6ASlkxjGGqBt/+5+Z2ch8sjTNpJK15weJREGi4O FdLGpP5vz4S9qFjv7ZRfKICswU0ONBWpKajuTSch6WiFhLylXwToBva5UDVuAWmVTpBbLycg uUpNw4jqCrxosoTarQoaWsqqSFhddobBpDUufN3rQtD8bZ2G/EMlB5St2Qg0i5MUfNn+TcH4 uzIadjI7EaTultAwM86H1OFKBMp9FQljHxSGhfV/NMz1d9HwSrdMwIB+jIKSNVPQp1Ogb4mC 909HCdBqCgj407hIXb+AnyRn0Lhu2xHPt34kcbZqh8LNJXNcvLnli7/nyLlYWyfCSytKCmsa Umk8O6mj8cbQEBe/7LuF28pfG0B1Au7KmCW9rO4YuwVIQoNjJFLHa/eMgxR9w9zIadPYwYNc KhGNMmmIx2OZi+zAeHgaMjKkBTsyr6bTkDHPhKlBbG7PHnk6ZHHY8tIazrGiGRdWq6w+UWbM uhHbnaU7UQQzg9hmXf2JMmUesNriDfK4ScaWLdhv5h43n/Fgd/t/kKf3rNm+bjl13EYMZhuX F07axGCyPxXROYivQGcakLkk2j9S5hcY5uwgE4fJosMDHfwjwjTo9Nt336KqbtcOxPCQ8Cx/ Sqz3NqHEMbK4sA7E8gihGT8/z/DEDxDHPZRII+5Ko0Mlsg7E4RlZJaLL7QEFavmjkHg0f9uX wgWZOQe9gqCbUQJkdWRdsVXcofFTP35WX5vlfklbYymyjZrnT7vaNZqfS/zsJvjpwy9c1E15 Xk2hO+VMvDC2x2dxIqa0P0/lHu1r46VaaLGw20g4r/BUpK55CDbXHUNSVl0yDu1zbSbuPzdt uyHKeyMkZUFiZxEhlYn/A11NjRvUAgAA Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property - set_property -> power_supply_set_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/88pm860x_charger.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c index ac352a6c03ea..98e31419d9cf 100644 --- a/drivers/power/88pm860x_charger.c +++ b/drivers/power/88pm860x_charger.c @@ -296,12 +296,13 @@ static int set_charging_fsm(struct pm860x_charger_info *info) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) return -EINVAL; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, &data); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, + &data); if (ret) return ret; vbatt = data.intval / 1000; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); if (ret) return ret; @@ -430,7 +431,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) goto out; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_TEMP, &temp); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_TEMP, &temp); if (ret) goto out; value = temp.intval / 10; @@ -485,7 +486,8 @@ static irqreturn_t pm860x_done_handler(int irq, void *data) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) goto out; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, &val); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, + &val); if (ret) goto out; vbatt = val.intval / 1000; @@ -500,7 +502,8 @@ static irqreturn_t pm860x_done_handler(int irq, void *data) if (ret < 0) goto out; if (vbatt > CHARGE_THRESHOLD && ret & STATUS2_CHG) - psy->set_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, &val); + power_supply_set_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, + &val); out: mutex_unlock(&info->lock);