From patchwork Tue Mar 10 08:27:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5975151 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 80166BF440 for ; Tue, 10 Mar 2015 08:35:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A35D520220 for ; Tue, 10 Mar 2015 08:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C18B2024F for ; Tue, 10 Mar 2015 08:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbbCJIfI (ORCPT ); Tue, 10 Mar 2015 04:35:08 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:31151 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238AbbCJI2F (ORCPT ); Tue, 10 Mar 2015 04:28:05 -0400 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 <0NKZ0016RMD3GW10@mailout4.w1.samsung.com>; Tue, 10 Mar 2015 08:31:51 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-23-54feaa73b70e Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 94.FF.26295.37AAEF45; Tue, 10 Mar 2015 08:25:23 +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 <0NKZ0033KM64IB70@eusync4.samsung.com>; Tue, 10 Mar 2015 08:27:53 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , 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 , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v6 06/22] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Tue, 10 Mar 2015 09:27:10 +0100 Message-id: <1425976046-20973-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> References: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRW0iTcRyG/e87ulp9zkNfQhIzUaQ8Fv3IiAjBP9RFgVcF6tKlklPZ5yGF yAQNtTwXoTaUaTMl000oj5g506biIe2AWqHCLE03Z8k8lNO753154L14WULaTLqz8YkpClWi PEFGi0njzvupU0LDTniAZfUYFA6viqB2oICE7O2fJJTOrxDQOWRjQDPhBvk1AVDyooyA0aaz 8KTlCHRUaUj4ZQqE4ewlBr6tGxC0/VimoXxLKwJtdxEC3dwUBV8sfyiYaK+iYe1RH4I8awUN L/tmGNDamkgY76nelZf/0TDzwUBDY6eJgCHjOAUVS85gLKDA2JECXTljBOh1jwnYaJ6jLnri eos/nu1+R+KipjUKt1XMMHihuIzB+npfrGvIo/H0VCeNf4+MMFg9eA3ra+9hw8NpEi+WbNJ4 pXuSxq2TD0hc2NqArrpdF5+PUSTEpylU/heixHF/N3Rk8vNDd4w1i0QWMh/IR44sz53m1ZVq Yp/d+NHZV3Q+ErNSrg7xuSYt2g+FIn6gpYi0WzQXzOu1tXuWC2dgeduKibEHghtH/Nz8IGO3 nLlb/KfSEpGdSc6Ln61cQXaWcGF847CB3t/z4Af7yyg7O3KYt1q/7i1Id52ZcTMqRpJq5NCA XBWp0cnCzVhlkJ8gVwqpibF+0UlKHdp/ef0Nqus/14s4FskOSj7f2AmXUvI0IUPZi3iWkLlI DEW7lSRGnpGpUCVFqlITFEIvErGO7lnI4cqAd4Soj8/10gzXBzr1YacIQ/OZzNchXWm0ud43 netSLtvcpAtHQ30IL0uwcKlNZRO/JbRMPD92Pyx7M/nkgo9DiDwkylRgdFQfzkn3YDWr7Z50 T95x61Zoes/l8qryJrPniaffRV3bdyMV6hpKqrv90Zu0tBa6PgsLkpFCnDzQl1AJ8v/A4Kfm wwIAAA== 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;