From patchwork Fri Jan 30 14:47:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5751251 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 09EEEBF440 for ; Fri, 30 Jan 2015 14:53:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FB14202A1 for ; Fri, 30 Jan 2015 14:53:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08917201CE for ; Fri, 30 Jan 2015 14:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964858AbbA3Oxc (ORCPT ); Fri, 30 Jan 2015 09:53:32 -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 S932705AbbA3Osl (ORCPT ); Fri, 30 Jan 2015 09:48:41 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0NIZ00FO5VZMYJ80@mailout4.w1.samsung.com>; Fri, 30 Jan 2015 14:52:34 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-3d-54cb992faf79 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 34.78.26295.F299BC45; Fri, 30 Jan 2015 14:46:07 +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:33 +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 09/20] power_supply: bq2415x_charger: Use power_supply_*() API for accessing function attrs Date: Fri, 30 Jan 2015 15:47:47 +0100 Message-id: <1422629278-12202-10-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: H4sIAAAAAAAAAyWRaUjTcRjH++1/bM4Wf6bZnyVGgwqMPDLoQU0EiX6+kQrpRZS1dOiGF5ta FpF5EN5neWSpOJsXOrcudWlq03Rq5tQSr0pD8z4yRNPyePf5fvk8fF88PELYRIp4suAwqSJY Eiim+aRxq63vlH2u0dshP1YIKV2LHKjJqaZA9TGRhOjNaRIyJhYI0Heuc6HYZAUJRQ6QXpZJ QExxNQ09VWfhSc0heLFUQEN9fjEJM1OO0BU9y4WxVQOC2u9zNGT9VXNA3ZCKQDs+QMHg8h8K THX5NKwkf0AQ/zuPhiGTAOI/FSFQr1eR0Pu+cPtg7h8NIx0GGir0UwR0GnspyJu1AGMiBcb6 MHgX95kAnfYxAWuaccr9BI6NSaJx6bI9Hm1oIXFq1QqFa/NGuHhxyQf/TMvkYl2pLZ6YVlNY Wx5P4+EBPY3nu7u5+Hn7Jdz4rHJbUD3AhqRh8qLoKt/VTxooi5Aq7N1u8gPKTR6hG7w7kw/r OVFokJuAzHgsc4ZNTh+h9tiK7RmtphMQnydkShC7kbfF2QspHNa0tUHuWDTjxOrUql3Lkpkz Y1tT9OROIJghxNbqyzg7lgUTyv4qaiN2mGSOsV806bu9gMFsnaaD3tuzYdtbM3e3zbZ7zdSP XRYyF9jU/hw6DQkK0b5ydFAa7huqvOUfdNpOKQlShgf72/mGBGnR3ttX36KSVudmxPCQeL/g q8ToLaQkEcrIoGbE8gixpSArY7sS+Eki70oVITcU4YFSZTPi8MxEUej+N5nqFVbKja1r2qNQ 6eXjnZuSrWnxyu6OljHrPUSiL9Jf4/tt5uo8bKzjzNMHdA3BlOej4+SbAlrsLHCamQ+77HlO 3ucyaXA73+gyWecb/1QU0TVbIVq2Pjm2teDff2Rotfrwy+TX7ZZX7x1wr7htLrsiFcldm4aS y6/L28WkMkDiaEsolJL/HUMp59QCAAA= 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 Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/bq2415x_charger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c index 73b0a8521803..bc47a265b304 100644 --- a/drivers/power/bq2415x_charger.c +++ b/drivers/power/bq2415x_charger.c @@ -816,7 +816,8 @@ static int bq2415x_notifier_call(struct notifier_block *nb, dev_dbg(bq->dev, "notifier call was called\n"); - ret = psy->get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, &prop); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, + &prop); if (ret != 0) return NOTIFY_OK;