From patchwork Tue Nov 4 15:01:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5228431 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 BCE999F3EE for ; Tue, 4 Nov 2014 15:05:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EDBD20166 for ; Tue, 4 Nov 2014 15:05:10 +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 5DAE420122 for ; Tue, 4 Nov 2014 15:05:09 +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 1XlfdM-00064m-Ta; Tue, 04 Nov 2014 15:03:00 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xlfce-0005Q5-33 for linux-arm-kernel@lists.infradead.org; Tue, 04 Nov 2014 15:02:18 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEI00EYUSJWAC10@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 04 Nov 2014 15:04:44 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-29-5458ea5da3cf Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1F.D8.24279.D5AE8545; Tue, 04 Nov 2014 15:01:49 +0000 (GMT) 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 <0NEI00F9USEVQU60@eusync1.samsung.com>; Tue, 04 Nov 2014 15:01:49 +0000 (GMT) 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 RESEND v2 4/8] power: ab8500: Use power_supply_*() API for accessing function attrs Date: Tue, 04 Nov 2014 16:01:37 +0100 Message-id: <1415113301-25661-5-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415113301-25661-1-git-send-email-k.kozlowski@samsung.com> References: <1415113301-25661-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsVy+t/xy7qxryJCDJbdtrI4uFXTYuOM9awW k568Z7aYuHIys0Xn2SfMFq9fGFqcbXrDbnH/61FGiyl/ljNZbHp8jdXi8q45bBafe48wWjxZ eIbJYu2Ru+wWtxtXsFncPXWUzeJ0N6vF6d0lDkIeE/o/MXrsnHWX3WPzCi2PTas62TzuXNvD 5jHvZKDH5iX1Hju/N7B79G1ZxeixYvV3do/Pm+QCuKO4bFJSczLLUov07RK4Mu6+bGMr2CFR 8frMK+YGxrMiXYycHBICJhIPv5xkgrDFJC7cW8/WxcjFISSwlFFi+ffpLBBOH5PEkd49zCBV bALGEpuXLwGrEhG4ziTRuWICWBWzQCOzxLuGZrBZwgKpEp+Wz2MDsVkEVCVmr/3ICmLzCrhL 7F61lR1in5zEyWOTweKcAh4SDVf/gNlCQDUretvZJjDyLmBkWMUomlqaXFCclJ5rpFecmFtc mpeul5yfu4kREvZfdzAuPWZ1iFGAg1GJh3dFfESIEGtiWXFl7iFGCQ5mJRFe9cdAId6UxMqq 1KL8+KLSnNTiQ4xMHJxSDYwRHNm/96f2T7iYqmTdLvOPZ8Z5nda3TyuPuTgL8PT8/Mj7teGe RvJ7pbs1Qi6nd7cZL0xeJ6Sslsy+glvXu3z691Uc/SUzJKawaD7W8Vhh5SvB8PzmhEzmF2sv x/LXqlj94fc3PPqJ6/XSQqnJS+SLvp4JYv41/ZzxhOKUv79+beyt2NR3z1mJpTgj0VCLuag4 EQC3CV2tWQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141104_070216_301896_A77026D4 X-CRM114-Status: GOOD ( 12.14 ) X-Spam-Score: -5.6 (-----) 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=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Acked-by: Linus Walleij --- drivers/power/ab8500_btemp.c | 2 +- drivers/power/ab8500_charger.c | 2 +- drivers/power/ab8500_fg.c | 2 +- drivers/power/abx500_chargalg.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index 7f9a4547dccd..8161960ee78c 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -938,7 +938,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) enum power_supply_property prop; prop = ext->properties[j]; - if (ext->get_property(ext, prop, &ret)) + if (power_supply_get_property(ext, prop, &ret)) continue; switch (prop) { diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index 19110aa613a1..38d61523227f 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -1957,7 +1957,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) enum power_supply_property prop; prop = ext->properties[j]; - if (ext->get_property(ext, prop, &ret)) + if (power_supply_get_property(ext, prop, &ret)) continue; switch (prop) { diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 99a78d365ceb..3ea208e36fa6 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -2200,7 +2200,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) enum power_supply_property prop; prop = ext->properties[j]; - if (ext->get_property(ext, prop, &ret)) + if (power_supply_get_property(ext, prop, &ret)) continue; switch (prop) { diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 6d2723664a01..f3d9dbac3568 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -1001,7 +1001,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) * property because of handling that sysfs entry on its own, this is * the place to get the battery capacity. */ - if (!ext->get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) { + if (!power_supply_get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) { di->batt_data.percent = ret.intval; capacity_updated = true; } @@ -1019,7 +1019,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) ext->type == POWER_SUPPLY_TYPE_USB) di->usb_chg = psy_to_ux500_charger(ext); - if (ext->get_property(ext, prop, &ret)) + if (power_supply_get_property(ext, prop, &ret)) continue; switch (prop) { case POWER_SUPPLY_PROP_PRESENT: