From patchwork Fri Feb 27 08:19: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: 5899461 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 372D39F269 for ; Fri, 27 Feb 2015 08:39:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C8E520165 for ; Fri, 27 Feb 2015 08:39:46 +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 54D9E2015E for ; Fri, 27 Feb 2015 08:39:45 +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 1YRGPd-0006Pr-Uf; Fri, 27 Feb 2015 08:36:45 +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 1YRGAt-00005C-QG for linux-arm-kernel@lists.infradead.org; Fri, 27 Feb 2015 08:21:41 +0000 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 <0NKF00EAI8OUW270@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 27 Feb 2015 08:24:31 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-67-54f0283b9480 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 71.77.26295.B3820F45; Fri, 27 Feb 2015 08:18:03 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NKF007VV8HM7X70@eusync1.samsung.com>; Fri, 27 Feb 2015 08:20:31 +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 v5 04/20] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Fri, 27 Feb 2015 09:19:45 +0100 Message-id: <1425025201-15926-5-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> References: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2RaUhUYRSG++YuM2pTl9HsKhSlFWG4FnRoowjqo/yRIEEJ2aiTimtzVbQC tyL3JZtAUVNcRs2lRsHd0tS0UTMNLZ1RTAV3x91c09F/z3vOczg/XgEhqiONBe7efhKpt9jT hNYllVvfus0vn9XYW6nU+hDXruFBdks0CWGbEyS8GZkloKZtjQ9Z3YYQlWkFiflJBIRnldDQ WXwR3n06Crlz72moTs0iYXLMGtrDpvgwuNSEoHJomoa3G3IeyOviESiGeyj4M79MQXdVKg0L sY0IIhdTaChqVPMh8kcmAvlaMQldXzJ2Lqa3aVB/b6LhQ80YAW3KLgpSpvRBGU2BstoPal/9 JKBUISNg9eMwdf0Mzpu3xAN1X0kcX7xA4coUNR9r5h7h0YQkPi7NM8MjE3IKKwoiaazqqaHx TEcHH6e32uHPaYU7QnYwbopRkXg8cZ2+Z/RQ94qLxNM9QCK1vPZY121lVUH65h4KVGaOEyFo Ti8K6QhY5gIb29tC7rEh2zlQQkchXYGIyUHsVujIfojjsb+SQ7UWzZxnS+XZ2oUB06zD1hfF 8nYDwXQhdniklb9r6TNP2NdLMi2TzGk2db2P2mUhc5st/yvb/3ecbW1O0s51GMzObCZrfdGO U5K5ghKQMAMdKEBHJP7OvpyTq5eNBSf24vy9XS2cfbwUaK/zpQqU03ypATECZHJQiFmNvYgS B3BBXg2IFRAmBkI0NGsvErqIg55JpD6OUn9PCdeAeAId4xBU/6DiVspKzCFzzZrGO8NGGNsb 0T9ZUdY0oDZ1ciJExMpG74TdueXa32brLx3a47nwm77WzHykx+JVu22ZxOjFQI+qP+M+Y+oo qwokj0n/MYW2z0/mO5wq44ZsJ4ZdqvwOl8RkpXs+nRlVFRRH3MWWXcF3+H19aR56J26UD8Z1 m5Ccm9jajJBy4v8puPfR0QIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150227_002132_057710_5A799CE4 X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. 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 - set_property -> power_supply_set_property - property_is_writeable -> power_supply_property_is_writeable Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/power_supply_sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 62653f50a524..f817aab80813 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -76,7 +76,7 @@ static ssize_t power_supply_show_property(struct device *dev, if (off == POWER_SUPPLY_PROP_TYPE) { value.intval = psy->type; } else { - ret = psy->get_property(psy, off, &value); + ret = power_supply_get_property(psy, off, &value); if (ret < 0) { if (ret == -ENODATA) @@ -125,7 +125,7 @@ static ssize_t power_supply_store_property(struct device *dev, value.intval = long_val; - ret = psy->set_property(psy, off, &value); + ret = power_supply_set_property(psy, off, &value); if (ret < 0) return ret; @@ -223,7 +223,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, if (property == attrno) { if (psy->property_is_writeable && - psy->property_is_writeable(psy, property) > 0) + power_supply_property_is_writeable(psy, property) > 0) mode |= S_IWUSR; return mode;