From patchwork Mon Jan 5 15:47:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5568981 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 DE361BFE6A for ; Mon, 5 Jan 2015 15:51:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14F252011B for ; Mon, 5 Jan 2015 15:51:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DFD6201B9 for ; Mon, 5 Jan 2015 15:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646AbbAEPvg (ORCPT ); Mon, 5 Jan 2015 10:51:36 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:57063 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754127AbbAEPsZ (ORCPT ); Mon, 5 Jan 2015 10:48:25 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) 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 <0NHP00J9TO3DBW40@mailout3.w1.samsung.com>; Mon, 05 Jan 2015 15:52:25 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-b1-54aab245f737 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 5F.64.07834.542BAA45; Mon, 05 Jan 2015 15:48:21 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NHP00HBJNWDWI80@eusync4.samsung.com>; Mon, 05 Jan 2015 15:48:21 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFC PATCHv2 09/19] power: bq2415x_charger: Use power_supply_*() API for accessing function attrs Date: Mon, 05 Jan 2015 16:47:52 +0100 Message-id: <1420472882-10463-10-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> References: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsVy+t/xa7qum1aFGEy4pm4x6cl7ZouJKycz W7x+YWix8+FbNovl+/oZLTY9vsZqcXnXHDaLz71HGC3unjrKZnHm9CVWi9O7Sxy4PXbOusvu sXmFlsemVZ1sHpuX1HtsudrO4tG3ZRWjx4rV39k9Pm+SC+CI4rJJSc3JLEst0rdL4Mo42T2V saCdo+LNdskGxvdsXYwcHBICJhIzL2h0MXICmWISF+6tBwpzcQgJLGWU6JrSwwLh9DFJND7b wARSxSZgLLF5+RKwKhGBJ0wS01tPsoAkmAUMJX6++8MOYgsL5Ehcvf4DbAOLgKrEpwZpkDCv gIfE0u43rBDb5CROHpsMZnMCxZv+XgAbIyTgLvHh2S/WCYy8CxgZVjGKppYmFxQnpeca6hUn 5haX5qXrJefnbmKEBOSXHYyLj1kdYhTgYFTi4fU4sTJEiDWxrLgy9xCjBAezkgjvq/RVIUK8 KYmVValF+fFFpTmpxYcYmTg4pRoY3e9P61Rrn5+WV+uzPT2hnefuouerwtNiX5yMXfc46tEt GdP6//Y8AiJKXdy1Fnm3ruwpZf0Zn/LiacaJNsGmH+xepQbm/ZdbHvIvzLrGObEzdKva8i8X n3srpbc/3Xym98CXs3HVTNtUI17XsLi/OPB36mk/4wmtRR+XBe2RkZK9u5xzujyDEktxRqKh FnNRcSIAhy2wmiYCAAA= 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 --- 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 1f49986fc605..2f80de0410d9 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;