From patchwork Mon Feb 23 11:47:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5864971 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 2CA1EBF440 for ; Mon, 23 Feb 2015 11:56:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34C6220615 for ; Mon, 23 Feb 2015 11:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 912612061A for ; Mon, 23 Feb 2015 11:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332AbbBWL4W (ORCPT ); Mon, 23 Feb 2015 06:56:22 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:54067 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbbBWLr7 (ORCPT ); Mon, 23 Feb 2015 06:47:59 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0NK800GIB3MOBQA0@mailout3.w1.samsung.com>; Mon, 23 Feb 2015 11:52:01 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-07-54eb12d8deaa Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 69.97.26295.8D21BE45; Mon, 23 Feb 2015 11:45:28 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NK8001843FJ0A90@eusync2.samsung.com>; Mon, 23 Feb 2015 11:47:56 +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 v4 04/20] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Mon, 23 Feb 2015 12:47:25 +0100 Message-id: <1424692061-30624-5-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> References: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2ReyyVcRzG/c57Oa+j094O6U3WH7ZqLLdkfWemWk2/VWtaalYbDo7L4uAc DGslTZs7kZkkZwfHJeRoRW6RaweJMjWXRMu1XJJr6qD/nufZ59nzx8MQojrSiPGThkhkUrG/ CS0gNZttH8wHRNPOVqNR5pDUNceDvPZ4EqL/TJHwYPwnAbWda3xQ9hlCnMIKUovSCLinLKeh p+wEZFTsg4L5JzTUZCtJmJ6whq7oGT6MLLUgqB6dpSF9Q8UDVX0yAvVYPwWfFn5T0Pcqm4bF xGYEsb+yaChtHuJD7DsFAtVaGQm9r3O1jdm/NAy9baGhpHaCgE5NLwVZM/qgiadAUxMCdTHv CahUPyRg5dkYdeowLlywxMP1b0icXLZI4eqsIT6em3fF31LS+Liy0AyPT6korC6OpfFgfy2N f3R383FOx2Xc8PipFsi7g1sSBkk8mbpOO+2/LrD3kvj7hUlklg7uAt/lFTUZVLA7XKOYJKLQ vF4c0mU49jjXOZmKdrQh1zNcTschASNi8xGX3/OZ2jFJPK4xY5HYomjWhqtU5W1TBmyrLtdY msjbMgTbi7ix8Q7+FqXPenOahMFtTbKHuNLiku22kD3HrcU+/793kOtoTdNOMIwui7mRF2Fb sUiLJFakoxQkzEU6xWivJNQzSO7hE3DMQi4OkIdKfSw8AwPUaOfypSqU32rXhFgGmewSfgmb chZR4jB5REAT4hjCxEB4YFUbCb3EEZESWaCbLNRfIm9CPEbXKAqdPuJSo85svlD2KHc2zubl 8uiqu0X5WtHSxELyCGscqFMl7XTKVqoT9Wqdzb0M4vcEX7EXX7wfZSe9ijWmo4Lvpo62tzL9 YnJuZFwLjFSQ55GRmyo4+WzlzZ6TDsapDRGEq2PmRtvtAuUll8GvZ+6uH920dfNOCfcwGjLw sPw40G5Cyn3F1maETC7+B3TlVVPQAgAA 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;