From patchwork Tue Mar 10 08:27:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5975271 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 7EA6F9F318 for ; Tue, 10 Mar 2015 08:36:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93683200EC for ; Tue, 10 Mar 2015 08:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84A8E2024D for ; Tue, 10 Mar 2015 08:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbbCJIgI (ORCPT ); Tue, 10 Mar 2015 04:36:08 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:34146 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbbCJI16 (ORCPT ); Tue, 10 Mar 2015 04:27:58 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) 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 <0NKZ0031XMDA7L10@mailout3.w1.samsung.com>; Tue, 10 Mar 2015 08:31:58 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-07-54feaa7965cc Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 96.CC.07834.97AAEF45; Tue, 10 Mar 2015 08:25:29 +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 <0NKZ0033KM64IB70@eusync4.samsung.com>; Tue, 10 Mar 2015 08:27:54 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , 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 , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v6 07/22] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs Date: Tue, 10 Mar 2015 09:27:11 +0100 Message-id: <1425976046-20973-8-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> References: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRaUiTcRjA/e899moNXubRi5CBZpGQBxo9mEif6h/1QcUvHWJLlxrz2lRS okwJUfPKNBApxdmWksdmkfeR02wqOlFwHpHOnOk85hJZZrn27fd7+D08Hx6GEDaT7kxCUppY miSSeNJOpPZweOZ8ZsNhpP+PXHcoHtvmgfxLIQk5f36S8MKwRUDXqJUPdVNuUFDrD2XvygmY aLoIla0noLO6joR1YwCM5Wzw4dsvDYL27yYaXh4oeKDoKUGgWp6hYNa8R8FURzUNu0WDCPIt VTS8H1zgg8LaRIKur+YoNv2lYeGrhobGLiMBo1odBVUbzqAtpEDbmQbdzyYJUKsqCNhvWaYu e2Gl2Q8v9nwmcUnTLoXbqxb4eKW0nI/VSh+sasin8fxMF403x8f5+PVIOFbLn2DN83kSr5X9 pvFWzzSN26bzSFzc1oDC3G45hcSKJQkZYqlf6F2neGVuMZGid35YvlJGZ6NJtgA5MhwbxBnU g4Sd3biJxWa6ADkxQrYecWsdFsouxTzO0q3n2yqaDeTUCvn/yoXVMJx1y8i3CcHqELdsGDkS hnFmUzlj/THbAsl6c9oPczwbC9irnEnfSNvPeXAjQ+WUjR1ZzFksetLGwqNmQbeDSpGgBjk0 IFdxekyK7F5cYoCvTJQoS0+K841JTlQh+5Mtn1DdUPAAYhnkeVwwe/swUkiJMmSZiQOIYwhP F4Gm5GgkiBVlZomlydHSdIlYNoB4jKN7NqpdM5fu5UaHdmeo9p9OhQff2Q7ulS01z4QRZ06v atmbSt6Y//rqNffrebpLBy7pE2lF0VGWrEDvC48yQmq6k1qHe336rUHWkMepJ/sd7+8aXqWc cvW6Mre683H+QYyDtKWiz6R+c07+1rxJVw9FtUqGoys94k1616UIlXPKjYiznqQsXhTgQ0hl on/9fH8cwgIAAA== 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 Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/88pm860x_charger.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c index ac352a6c03ea..98e31419d9cf 100644 --- a/drivers/power/88pm860x_charger.c +++ b/drivers/power/88pm860x_charger.c @@ -296,12 +296,13 @@ static int set_charging_fsm(struct pm860x_charger_info *info) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) return -EINVAL; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, &data); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, + &data); if (ret) return ret; vbatt = data.intval / 1000; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); if (ret) return ret; @@ -430,7 +431,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) goto out; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_TEMP, &temp); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_TEMP, &temp); if (ret) goto out; value = temp.intval / 10; @@ -485,7 +486,8 @@ static irqreturn_t pm860x_done_handler(int irq, void *data) psy = power_supply_get_by_name(pm860x_supplied_to[0]); if (!psy) goto out; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, &val); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, + &val); if (ret) goto out; vbatt = val.intval / 1000; @@ -500,7 +502,8 @@ static irqreturn_t pm860x_done_handler(int irq, void *data) if (ret < 0) goto out; if (vbatt > CHARGE_THRESHOLD && ret & STATUS2_CHG) - psy->set_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, &val); + power_supply_set_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, + &val); out: mutex_unlock(&info->lock);