From patchwork Mon Feb 23 11:47:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5864661 Return-Path: X-Original-To: patchwork-linux-arm@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 391CFBF440 for ; Mon, 23 Feb 2015 11:53:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F11820610 for ; Mon, 23 Feb 2015 11:53:39 +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 7645120615 for ; Mon, 23 Feb 2015 11:53:38 +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 1YPrX8-0000D5-S5; Mon, 23 Feb 2015 11:50:42 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPrUx-0006MD-Ls for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:48:33 +0000 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 <0NK800FJ93MUBFA0@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:52:06 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-1f-54eb12de8621 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id F2.A7.26295.ED21BE45; Mon, 23 Feb 2015 11:45:34 +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:48:02 +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 07/20] mfd: ab8500: Use power_supply_*() API for accessing function attrs Date: Mon, 23 Feb 2015 12:47:28 +0100 Message-id: <1424692061-30624-8-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: H4sIAAAAAAAAAyWRW0jTcRzF++1/2X/D2Z956a9h4KIehLwl9MVCevMXBBZYRA/a1KGCU9t0 aFHpwsKZU/NCidecTS01J0rqNPOaeZ8hhLdCJXPTpmZ4Ny9v5xw+h/NwGEJsJJ2ZyOg4mSJa GiWhhWT/Xu+3C9Nic6CneZ8F7aCVB7ovaSSodxdJeDn3hwDjwBYfysYcQVPqCVmV2QQ8Laul YaTmEuTVnYK3K8U0tBSUkWBe8IJBtYUPM+vdCJp+LtGQs6Pngb4tA4FhdpyC76v/KBhrLqBh Lb0LQerffBqqu6b4kDpcikC/VUOCqb3koLG0T8PU124a3hkXCBjoN1GQb7GD/jQK+lvioDVl lIB6Qy4BGx9mqavnccWqB55u6yRxRs0ahZvyp/jYuhKE5zOz+bi+wg3PLeopbKhKpfHkuJHG y0NDfFzUdxN/Knx/AOie4O4XkyT+nbVN33C6K7wSJouKVMkUHn73hBGNlYO82C6bhB2zNAk1 CzVIwHCsD9c73YqOtSM3Ml1La5CQEbPliFt+tU0cGy2Pm3pt4R9SNHuRq9frjih7tkfAfa5O 5x0agjUhbnau74iyY4O40rxd+lCT7DmuPE97tCFi/TlrqpE+3jvD9fVkUxrEMAIWczONqsNY fICk1+WgTCQqQSeqkIMsPjRWGRIu93ZXSuXK+Ohw99AYuQEdP77+EZX3+HYglkESG9EP1WKg mJKqlInyDsQxhMRedHrzIBKFSRMfyBQxwYr4KJmyA/EYgXMS8nNtsmrZjGcpkiItFWzrovTa c4LVsuKAPh9bX110gr95wgVTv+QN11xHAzdDXMbaN06uOFyfb43MIHKTsyhBg47rrC6koh76 YJQw8XjcP3njjcF7M/OsXRG566hJDzTILwuMd7b8A7JNty3V3C21useSuMIvGX40vnv/uYRU Rki93AiFUvof5f+6y88CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150223_034827_904090_A2F8C97A X-CRM114-Status: GOOD ( 10.98 ) 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 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."