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: 5864491 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 661CE9F169 for ; Mon, 23 Feb 2015 11:51:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B6AA20610 for ; Mon, 23 Feb 2015 11:51:31 +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 A182720615 for ; Mon, 23 Feb 2015 11:51:30 +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 1YPrVa-0006j5-Dx; Mon, 23 Feb 2015 11:49:06 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPrUr-0006MD-Dy for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:48:27 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150223_034821_660154_25E8F244 X-CRM114-Status: GOOD ( 10.05 ) 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;