From patchwork Fri Feb 27 08:19:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5898391 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 88883BF6C3 for ; Fri, 27 Feb 2015 08:20:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACEE42020E for ; Fri, 27 Feb 2015 08:20:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABF502025B for ; Fri, 27 Feb 2015 08:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754852AbbB0IUp (ORCPT ); Fri, 27 Feb 2015 03:20:45 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46601 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753430AbbB0IUi (ORCPT ); Fri, 27 Feb 2015 03:20:38 -0500 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 <0NKF00GED8OZB670@mailout2.w1.samsung.com>; Fri, 27 Feb 2015 08:24:35 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-73-54f0283d29c2 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id F5.77.26295.D3820F45; Fri, 27 Feb 2015 08:18:05 +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 <0NKF007VV8HM7X70@eusync1.samsung.com>; Fri, 27 Feb 2015 08:20:33 +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 Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v5 05/20] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs Date: Fri, 27 Feb 2015 09:19:46 +0100 Message-id: <1425025201-15926-6-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> References: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2RV0xTYRzF+XpHL9XqTRleiNGkCUQxMhz4Vyv6on7EB9EQHA9qgcaitEAL RDFRBE2kKoIoBkQBGS1DUKqJyFALlFE2CSoCBikGkD1EQVCGb+fk/E7Ow2EIURlpzwQoQ2Uq pTRQTAtI00J129Z9m8a8XYdqBRDbMMaDzJrbJETND5Jw3zxKQGn9LB8y2mxBk+4K8TkJBERn FNLQXLALEl+ug+zxVBpKUjJI+NHvBg1RQ3z4Ol2FoLhnmIYHf7Q80JbfQ1DU207B54mfFLS9 TaFh8m4lgpipZBqeV3bxIaYpHYF2toCE1vdpi43hvzR01VXRkFfaT0C9qZWC5CErMN2mwFQS CmU3WwjQFz0k4NeLXuqAI9ZNuODu8goS3yuYpHBxchcfj42fwX1xCXys1zlh86CWwkW5MTTu bC+l8UhjIx8/rT2G3z3JXwQyr+GqO50kHoifo73sTgsk/rLAgHCZysXjnECui44lgjusLiX0 xdORqIXVIEuGY3dwM48TqBVtyzV3F9IaJGBEbBbiTNkF/00sj/vWMcxfomh2O6fXZi4H1qzR kvvw/C5vyRBsK+J6zbXLlBUbwqVostCSJlkHzlDxgtAghhGyh7n875KVuQ1crXFl2pLF3Mh8 0nJVtIgUps+gOCRMQxa5yEYW5hes9j2v2OaslirUYcrzzn5BiiK0cvn0G5Rl3GNALIPEq4WY G/MWUdJw9WWFAXEMIbYWop5Rb5HQX3o5QqYKOqsKC5SpDYjHWNpHoqBOmSTJwb4n2kPXkV9e eeKnfWpS3y1fgefmvRa7r3/yqT71SpIVcqWpHVctfMgTbzxZdlWu3+Dl/OiLXfFodtBxs27L obDX8hti5U5FTWLdb6P7+nM++wdm59Y+mxpOtsi5mGG+88ZKv+qCZ5Tk46iy+shBs+MaCxtj hLvhqPzGxD4xqZZL3ZwIlVr6D1nGcmfQAgAA 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);