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: 5899381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B46719F373 for ; Fri, 27 Feb 2015 08:33:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4D89201E4 for ; Fri, 27 Feb 2015 08:33:54 +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 F355C201BC for ; Fri, 27 Feb 2015 08:33:53 +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 1YRGFb-0004sa-96; Fri, 27 Feb 2015 08:26:23 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRGAc-0000Cd-IV for linux-arm-kernel@lists.infradead.org; Fri, 27 Feb 2015 08:21:24 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150227_002114_819581_22A51DD3 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Krzysztof Kozlowski , Thomas Gleixner , Kyungmin Park , Pavel Machek , 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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);