From patchwork Thu Mar 12 07:44:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5991571 Return-Path: X-Original-To: patchwork-linux-input@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 AC683BF911 for ; Thu, 12 Mar 2015 07:49:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBCEC200CF for ; Thu, 12 Mar 2015 07:49:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 171D220383 for ; Thu, 12 Mar 2015 07:49:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753659AbbCLHpr (ORCPT ); Thu, 12 Mar 2015 03:45:47 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:64795 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbbCLHo7 (ORCPT ); Thu, 12 Mar 2015 03:44:59 -0400 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 <0NL300J8I9PLI250@mailout2.w1.samsung.com>; Thu, 12 Mar 2015 07:48:57 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-cf-5501436203cc Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1E.1C.26295.26341055; Thu, 12 Mar 2015 07:42:26 +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 <0NL300KWS9IOZC60@eusync2.samsung.com>; Thu, 12 Mar 2015 07:44:56 +0000 (GMT) From: Krzysztof Kozlowski To: Jiri Kosina , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RESEND PATCH v6 07/22] power_supply: 88pm860x_charger: Use power_supply_*() API for accessing function attrs Date: Thu, 12 Mar 2015 08:44:05 +0100 Message-id: <1426146260-30081-8-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> References: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmluLIzCtJLcpLzFFi42I5/e/4Fd0kZ8ZQgz/zLCwmPXnPbDFx5WRm i91zFrNYvH5haHHz0zdWi8u75rBZfO49wmhx4ts0JovTu0scOD0+r3rF6rFz1l12j80rtDw2 repk8+jbsorR48yCI+wenzfJBbBHcdmkpOZklqUW6dslcGWsaO5jLrglXDH56US2BsaLAl2M HBwSAiYSS2amdDFyApliEhfurWfrYuTiEBJYyigxrfMwI0hCSKCPSWLCPE0Qm03AWGLz8iVg RSIC85kk+ledYAVJMAsYSvx894cdZKiwQIXErx1aIGEWAVWJOU9msIKEeQXcJaY/tYTYJSdx 8thksDCngIfE60U8EJvcJWYu+8Q+gZF3ASPDKkbR1NLkguKk9FwjveLE3OLSvHS95PzcTYyQ gPu6g3HpMatDjAIcjEo8vBF9DKFCrIllxZW5hxglOJiVRHg5rBhDhXhTEiurUovy44tKc1KL DzEycXBKNTCmFDBtFTDbsfLv9xc5ctVPbipbSfOcslleUBhppSL5KsbiwC//MJMrOS7ZKyKV YgxSl8eumbHp70m+dToOKQubX6Rx+yU8W7xg9utrs3j3TPd4tmjHjl2fOaeynb7p4rcx+vQ3 ueurun7s6GcuD08JfT7F1vnRZY6ff4OaJZe69c2ZY/f6SIK2EktxRqKhFnNRcSIAw4fhCBYC AAA= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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);