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: 5898941 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 62452BF440 for ; Fri, 27 Feb 2015 08:26:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D73D20211 for ; Fri, 27 Feb 2015 08:26:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 941A6201CE for ; Fri, 27 Feb 2015 08:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754849AbbB0IUn (ORCPT ); Fri, 27 Feb 2015 03:20:43 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:40266 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754791AbbB0IUi (ORCPT ); Fri, 27 Feb 2015 03:20:38 -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 <0NKF00EAI8OUW270@mailout4.w1.samsung.com>; 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 Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski 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== 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 - 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;