From patchwork Mon Jan 5 15:47:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5569171 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 AC7DF9F665 for ; Mon, 5 Jan 2015 15:53:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74A3120121 for ; Mon, 5 Jan 2015 15:53:51 +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 B1E852011B for ; Mon, 5 Jan 2015 15:53:46 +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 1Y89vv-0004K5-Do; Mon, 05 Jan 2015 15:51:07 +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 1Y89tj-0001jw-N5 for linux-arm-kernel@lists.infradead.org; Mon, 05 Jan 2015 15:48:55 +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 <0NHP007IQO3B2U40@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 05 Jan 2015 15:52:23 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-ad-54aab245b0b2 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 5E.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 Subject: [RFC PATCHv2 08/19] power: apm_power: Use power_supply_*() API for accessing function attrs Date: Mon, 05 Jan 2015 16:47:51 +0100 Message-id: <1420472882-10463-9-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+NgFprCLMWRmVeSWpSXmKPExsVy+t/xa7qum1aFGKydzmkx6cl7ZouJKycz W7x+YWix8+FbNovl+/oZLTY9vsZqcXnXHDaLz71HGC3unjrKZnHm9CVWi9O7Sxy4PXbOusvu sXmFlsemVZ1sHpuX1HtsudrO4tG3ZRWjx4rV39k9Pm+SC+CI4rJJSc3JLEst0rdL4MqYtOAD Y8E/jorvm74yNjBeY+9i5OSQEDCROPttDwuELSZx4d56NhBbSGApo8Tc8/ZdjFxAdh+TROOz DUwgCTYBY4nNy5ewgSREBJ4wSUxvPQnWzSxgKPHz3R+wqcICaRKrJ35n7mLk4GARUJV438oD EuYVcJeYdXUJ1DI5iZPHJrOC2JwCHhJNfy+wQCx2l/jw7BfrBEbeBYwMqxhFU0uTC4qT0nMN 9YoTc4tL89L1kvNzNzFCQvLLDsbFx6wOMQpwMCrx8HqcWBkixJpYVlyZe4hRgoNZSYT3Vfqq ECHelMTKqtSi/Pii0pzU4kOMTBycUg2MkXrVEg48K1Yc4peVqdt4/0PYFp3k60fzS8Sm29yR iN//5/AfPtsP0mKiRtnLyhUvhgS+KVllGuhtPm+ywnM3i6arFoFzmtW2J7OoqnLG2ZUEPDoy L5b9ZOWPI8+0mVXWhvlq9S/08G3IPHE2vCp1/pmb8f/dko886P249TXnLKEV1Tev18YpsRRn JBpqMRcVJwIAV03ZaycCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150105_074851_951949_7A20E35E X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Krzysztof Kozlowski 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 --- drivers/power/apm_power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index 39763015b360..2206f9ff6488 100644 --- a/drivers/power/apm_power.c +++ b/drivers/power/apm_power.c @@ -15,10 +15,10 @@ #include -#define PSY_PROP(psy, prop, val) (psy->get_property(psy, \ +#define PSY_PROP(psy, prop, val) (power_supply_get_property(psy, \ POWER_SUPPLY_PROP_##prop, val)) -#define _MPSY_PROP(prop, val) (main_battery->get_property(main_battery, \ +#define _MPSY_PROP(prop, val) (power_supply_get_property(main_battery, \ prop, val)) #define MPSY_PROP(prop, val) _MPSY_PROP(POWER_SUPPLY_PROP_##prop, val)