From patchwork Mon Feb 23 11:47:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5864541 Return-Path: X-Original-To: patchwork-linux-arm@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 7E6BC9F169 for ; Mon, 23 Feb 2015 11:52:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A349020219 for ; Mon, 23 Feb 2015 11:52:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30C932062A for ; Mon, 23 Feb 2015 11:52:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPrWP-00074n-7W; Mon, 23 Feb 2015 11:49:57 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPrUt-0006NY-UB for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:48:30 +0000 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 <0NK800LLA3ML5WA0@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:51:58 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-d9-54eb12dd6cde Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 5B.4A.07834.DD21BE45; Mon, 23 Feb 2015 11:45:33 +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 <0NK8001843FJ0A90@eusync2.samsung.com>; Mon, 23 Feb 2015 11:47:58 +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 Subject: [PATCH v4 05/20] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs Date: Mon, 23 Feb 2015 12:47:26 +0100 Message-id: <1424692061-30624-6-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> References: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2Re0hTcRTH/e0+dictbtPczUBwYKCQj7I6hUgg0cW/LJTIIJtzqKhTN10q haZI+NZmauKrNp2P1FSQzKVmavl+pWA4LaakU/OZlFa2af+d7+d8zjl/HAoT6HBbKlQWI5XL xOEi0hIf/Pvh01m9YMXXVfPsHGQPb3BA8zEDh+Q/RhyeLKxjoBva44J60gbSn7tCXo0KgxR1 IwljDZegoEkIVZvlJLSXqHFYWXKD4eRVLsz/6EXQ9nWNhPzfWg5oO3IQNBumCZjZ2iVg8k0J CdtZPQjSdopJqO/RcyFt9DkC7V4DDhNdFaaJtQMS9AO9JNTpljAYGpwgoHjVCgYzCBhsj4G3 qeMYtDQ/xeDnKwNx9QxbveXCznW8x9mchm2CbSvWc9mNzbvsYq6Ky7ZUO7ELRi3BNtemkezs tI5kv4+McNmy/htsZ+lLk6BJZHszZ3F2OW+f9Dnlb+kRJA0PVUrlLp73LEOqU7KxqM9WcarF PDIJjdPpiEcxtDuTN12BjmobZmyukUxHlpSArkRMSVbl/5DNYYy5asxskfR5pkWrOWxY0308 5l19FsccMHoCMYaFfq7ZsqKjmeyaF4d7cdqBaSuvNHGK4tPXmcIiztE5O6a/T0WYMY9mmflW pRkLTEZWUz7KRfwKZFGLTkpjJVGKwOAIN2eFOEIRKwt2lkRGNKOjj++8Ruq+K92IppDoGP+L 0ugrIMRKRXxEN2IoTGTNP/3LhPhB4vgEqTwyQB4bLlV0Iw7Fs01CpQ67flbuB7yGztHldYcA 3a7s5tD96bUHPoKapqQpYZdwy2tYuOrI8Ea6ygoyE4zE8dYTIlVduH/wtdvf/PIfF0Ur7b32 vcPi/L25vXe8EuMGEjQP22ck8+OPHLdVdoGpU/u3LhtC1Nsih+TCC54X3UeYyJ1Go2THIizd s8rDXoQrQsRuTphcIf4HMEZTYM8CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150223_034824_204552_9367FB62 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Krzysztof Kozlowski , Thomas Gleixner , Kyungmin Park , Pavel Machek , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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);