From patchwork Thu Oct 16 07:32:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5088451 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C3539F2BA for ; Thu, 16 Oct 2014 07:37:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4248201C7 for ; Thu, 16 Oct 2014 07:37:11 +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 C688420176 for ; Thu, 16 Oct 2014 07:37:10 +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 1XefaK-0003ub-OJ; Thu, 16 Oct 2014 07:34:56 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XefZO-0003HC-So for linux-arm-kernel@lists.infradead.org; Thu, 16 Oct 2014 07:34:03 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDJ00A7Q14MBV30@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 16 Oct 2014 08:36:22 +0100 (BST) X-AuditID: cbfec7f5-b7f776d000003e54-ee-543f74cdc49c Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 69.8D.15956.DC47F345; Thu, 16 Oct 2014 08:33:33 +0100 (BST) 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 <0NDJ00FFY0ZRIB20@eusync1.samsung.com>; Thu, 16 Oct 2014 08:33:33 +0100 (BST) From: Krzysztof Kozlowski To: Linus Walleij , Samuel Ortiz , Lee Jones , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v2 2/8] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Thu, 16 Oct 2014 09:32:51 +0200 Message-id: <1413444777-24107-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1413444777-24107-1-git-send-email-k.kozlowski@samsung.com> References: <1413444777-24107-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsVy+t/xy7pnS+xDDN6eZbc4uFXTYuOM9awW k568Z7aYuHIys0Xn2SfMFq9fGFqcbXrDbnH/61FGiyl/ljNZbHp8jdXi8q45bBafe48wWjxZ eIbJYu2Ru+wWtxtXsFncPXWUzeJ0N6vF6d0lDkIeE/o/MXrsnHWX3WPzCi2PTas62TzuXNvD 5jHvZKDH5iX1Hju/N7B79G1ZxeixYvV3do/Pm+QCuKO4bFJSczLLUov07RK4Mo4cKC/YxFtx 4tM+xgbGdu4uRk4OCQETiVMT5jBB2GISF+6tZ+ti5OIQEljKKPF9YwuU08cksaBxEzNIFZuA scTm5UvAEiIC15kkOldMYAFxmAUamSXeNTSDzRIWSJG4eXMfWAeLgKrE04aLYHFeAXeJsycm skLsk5M4eWwymM0p4CEx/exVdhBbCKimccJ+tgmMvAsYGVYxiqaWJhcUJ6XnGukVJ+YWl+al 6yXn525ihAT91x2MS49ZHWIU4GBU4uHVCLYPEWJNLCuuzD3EKMHBrCTC21wIFOJNSaysSi3K jy8qzUktPsTIxMEp1cBourrAhLvZ5swq5wtTpz9/62oy+6C6s/FSPQmbk/Lli7lmMe6wPX96 /Z39pxT8w1S4HLI+rZ3KY/t70bxSvxTxnHSJeSX/Z6x7zhCafN9/4cJ0RpVAzVk6u6e9O6dX wD0rb+qv42d5OTauL+5c0qgV8u//nrLYLdZOc51jojbn7EpQXCi3bc0uJZbijERDLeai4kQA ds+caFgCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141016_003359_141228_DCE55989 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -5.0 (-----) Cc: Jonghwa Lee , Bartlomiej Zolnierkiewicz , Anton Vorontsov , Krzysztof Kozlowski , Kyungmin Park , Myungjoo Ham , Pavel Machek , Guenter Roeck , 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 --- 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;