From patchwork Fri Jan 30 14:47:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5751691 Return-Path: X-Original-To: patchwork-linux-acpi@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 0C93A9F38E for ; Fri, 30 Jan 2015 14:58:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 345A3202A1 for ; Fri, 30 Jan 2015 14:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5856D2027D for ; Fri, 30 Jan 2015 14:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422817AbbA3O5c (ORCPT ); Fri, 30 Jan 2015 09:57:32 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:50429 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932846AbbA3Os3 (ORCPT ); Fri, 30 Jan 2015 09:48:29 -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 <0NIZ00HL5VZEF680@mailout4.w1.samsung.com>; Fri, 30 Jan 2015 14:52:27 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-19-54cb99275ebe Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 75.68.26295.7299BC45; Fri, 30 Jan 2015 14:45:59 +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 <0NIZ00EV0VSES470@eusync2.samsung.com>; Fri, 30 Jan 2015 14:48:25 +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 , Russell King Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v3 04/20] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Fri, 30 Jan 2015 15:47:42 +0100 Message-id: <1422629278-12202-5-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1422629278-12202-1-git-send-email-k.kozlowski@samsung.com> References: <1422629278-12202-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRfSzUcRzHfe/3cOe4/HakX/5oY6RZOKX6rFmrrc2vzMYyW2bl4kLzeIfh nwzN80NcTfI4ziHD4Y+4c4mQzrMSeX5a5qE8J0Xd8d/r/dnrvfcfHw7Gf4+bcQJDIkTiEGGQ BcnFNUfdn22tX2k8BPJZR8js22CBIq+OgPKPaTjEH67gkLP4EwNV7wEbykZMIbVUAM+rcjFI KKsjYbD2GrxUnIGKzWISlAVlOKwuO0Bf/BobZnY7ETTPrZMg/StngVydhaBhYZSA8a09AkZa CkjYzviAIGUnn4SJER6kDJQikB/U4jDcVqItrP8jYepTJwlvVMsY9GqGCchfMwZNGgEaZQS0 PhvCoLHhBQb79QvETWsmMSGdZCq37JlpdQfOZNVuE0xz/hSb2dh8wCxl57KZxkobZnFFTjAN 1SkkMzmqIpkf/f1spqjHnXlXWKMVyp8ynemTuJuZF9fJTxQUGCUS29/w4Qas5pSxwipORScl KtlxaNMgFXE4NOVINzaJU5G+Fk3pwek6MhVxOXxKhuhvVTusk5DJolWj62ydRVKX6UZ5+bFl Qq3r012ZKlwXMGoC0c2qKpbOMqYe06+P5kkd45QVXbz/67jNo5zppsxDdLJ3ju7pyiV0rE8x dP3y/DHztU7WlzwyG/FKkF41Oi2K9A2TPPIPvmQnEQZLIkP87XxDgxvQydt33yJZ1/V2RHGQ hSFvTKjx4BPCKElMcDuiOZiFCU+aoz3x/IQxsSJx6ENxZJBI0o5YHH2zOCSgW7pcD3dWWwUe ei1SG1AnxI6P1d6SLg1w1ZXdbgqXPxleNYV71Sw8vM9Vam15J3/fSRYW3nt/X7xVn3FWZjen MIuJuC3oUBQZ+dwz8vF8cnQ3ZfHiVWPP6ORk/hA/ybvGpMbq94Xzhl+9Z2fazIe+u3hcETib Ky0NSPcqW2SBSwKEDjaYWCL8DwGLpg7UAgAA 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;