From patchwork Mon Jan 5 15:47:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5569151 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 9FEFD9F4DC for ; Mon, 5 Jan 2015 15:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0C7120154 for ; Mon, 5 Jan 2015 15:53:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E518920148 for ; Mon, 5 Jan 2015 15:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752978AbbAEPxc (ORCPT ); Mon, 5 Jan 2015 10:53:32 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:57063 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbAEPsY (ORCPT ); Mon, 5 Jan 2015 10:48:24 -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 <0NHP00J9RO3CBW40@mailout3.w1.samsung.com>; Mon, 05 Jan 2015 15:52:24 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-a6-54aab245c066 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 4D.70.26295.542BAA45; Mon, 05 Jan 2015 15:48:21 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NHP00HBJNWDWI80@eusync4.samsung.com>; Mon, 05 Jan 2015 15:48:20 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFC PATCHv2 06/19] power: ab8500: Use power_supply_*() API for accessing function attrs Date: Mon, 05 Jan 2015 16:47:49 +0100 Message-id: <1420472882-10463-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> References: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsVy+t/xa7qum1aFGLztkbOY9OQ9s8XElZOZ LV6/MLTY+fAtm8Xyff2MFpseX2O1uLxrDpvF594jjBZ3Tx1lszhz+hKrxendJQ7cHjtn3WX3 2LxCy2PTqk42j81L6j22XG1n8ejbsorRY8Xq7+wenzfJBXBEcdmkpOZklqUW6dslcGVMn/Wd vWCHREXD3wbGBsazIl2MnBwSAiYSt9/vYoawxSQu3FvP1sXIxSEksJRRYtWHK4wQTh+TxLrn U9hBqtgEjCU2L18CViUi8IRJYnrrSRaQBLOAocTPd3/AioQFkiUOnlvCBGKzCKhKvJnwhRXE 5hVwlzi4fQ8jxDo5iZPHJoPFOQU8JJr+XgCbIwRU8+HZL9YJjLwLGBlWMYqmliYXFCel5xrp FSfmFpfmpesl5+duYoSE5dcdjEuPWR1iFOBgVOLh9TixMkSINbGsuDL3EKMEB7OSCO+r9FUh QrwpiZVVqUX58UWlOanFhxiZODilGhjFs8LbwqfJVeyX3HU/xXWngDubwpsbUXwmV9l5RCc6 li848KBbUES0QsAr6LXZkW9O7kUTEvca8AaZa/4KWVuxJDj5qv7q4kaWAyUGh9ysttX67P0b 3fI0ujVAsPvz89kfPSbeu/rT4c7Xt2YODZPVZ95nnZczozmO6+Nj5zMRMry3a08wyiixFGck GmoxFxUnAgA1rAdgKQIAAA== 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 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 4ebf7b0819f7..78207ca5871f 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 8c8d170ff0f8..b6566d7d41d8 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 69b80bcaa9e7..5f4f900bfcb9 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 ab54b8dea670..2049813d740d 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: