From patchwork Fri Jan 30 14:47:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5751501 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C7BEBF440 for ; Fri, 30 Jan 2015 14:56:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F0CC20219 for ; Fri, 30 Jan 2015 14:56:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 000F3202E6 for ; Fri, 30 Jan 2015 14:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932515AbbA3Ozk (ORCPT ); Fri, 30 Jan 2015 09:55:40 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:56303 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932907AbbA3Osd (ORCPT ); Fri, 30 Jan 2015 09:48:33 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIZ00LLAVZMU980@mailout3.w1.samsung.com>; Fri, 30 Jan 2015 14:52:34 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-2f-54cb992cd2c0 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id CC.68.26295.C299BC45; Fri, 30 Jan 2015 14:46:04 +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:30 +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 07/20] mfd: ab8500: Use power_supply_*() API for accessing function attrs Date: Fri, 30 Jan 2015 15:47:45 +0100 Message-id: <1422629278-12202-8-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: H4sIAAAAAAAAA+NgFjrAIsWRmVeSWpSXmKPExsVy+t/xK7o6M0+HGDR/ELboO/uByWLjjPWs FktOdLNYNP19xWIx6cl7Zos9Z36xWyy+LGbRtdDAYuLKycwWzYvXs1lcWGduMW2juMWyj/PZ LHbPWcxi8fqFocXZpjfsFve/HmW02PnwLZvFlD/LmSyW7+tntNj0+Bqrxc1P31gtLu+aw2bx ufcIo0Xnl1lsFrcv81p0nl/IaLH81zoWi0sHFgA1vP3PZnH31FE2i9V7XjBbnDl9idVi1hth i9PdrBand5dY7G29yGyxedNUZosfGx6zOqh7tDT3sHms+KTvcW/fYRaP/nWfWT12zrrL7vHh Y5zH0wmT2T02r9DyePJqOavHplWdbB53ru1h83h37hy7x7yTgR77564BKlhS73G05w5LgFQU l01Kak5mWWqRvl0CV8am1sssBUd4Kr7PvsPUwLiLq4uRk0NCwERids9uVghbTOLCvfVsXYxc HEICSxklDk//xA6SEBLoY5LoaNAHsdkEjCU2L18CViQi8JZT4ljfHhYQh1ngNqPEzj0rmUCq hAXiJD6emwHWzSKgKnHhykmgOAcHr4C7xKdvbBDb5CROHpsMtplTwENiw4tHrBDL3CX6r85g m8DIu4CRYRWjaGppckFxUnqukV5xYm5xaV66XnJ+7iZGSKx/3cG49JjVIUYBDkYlHt4biadD hFgTy4orcw8xSnAwK4nwTpkEFOJNSaysSi3Kjy8qzUktPsTIxMEp1cBY++rP1ahQzf0TPjFN ltdUeHA6TCZ6Yq5xZIHnLqdLy6coRB279MhS1MpTtk83esMtTUtVPv6M6FPrbv1z4dbZ8yxO LdQox/rAtEBBxZMXvcObEyJu2Vz6/+WpJoumtbOqwrYW7uCfS1d1+vYITH5dyq+ctpvdI2Rm VuPjye9/PlPUUgzI26XEUpyRaKjFXFScCACuOaWy0wIAAA== 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 Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Acked-by: Lee Jones Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/mfd/ab8500-sysctrl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index cfff0b643f1b..d4a4b24be7c6 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -49,7 +49,8 @@ static void ab8500_power_off(void) if (!psy) continue; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE, + &val); if (!ret && val.intval) { charger_present = true; @@ -63,8 +64,8 @@ static void ab8500_power_off(void) /* Check if battery is known */ psy = power_supply_get_by_name("ab8500_btemp"); if (psy) { - ret = psy->get_property(psy, POWER_SUPPLY_PROP_TECHNOLOGY, - &val); + ret = power_supply_get_property(psy, + POWER_SUPPLY_PROP_TECHNOLOGY, &val); if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) { printk(KERN_INFO "Charger \"%s\" is connected with known battery."