From patchwork Tue Mar 10 08:27:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5974631 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 A0F8ABF440 for ; Tue, 10 Mar 2015 08:29:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDF1320251 for ; Tue, 10 Mar 2015 08:29:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 810642022D for ; Tue, 10 Mar 2015 08:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753AbbCJI27 (ORCPT ); Tue, 10 Mar 2015 04:28:59 -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 S1752661AbbCJI2r (ORCPT ); Tue, 10 Mar 2015 04:28:47 -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 <0NKZ004YLMDQKC00@mailout3.w1.samsung.com>; Tue, 10 Mar 2015 08:32:15 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-58-54feaa89d38f Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 65.EC.07834.98AAEF45; Tue, 10 Mar 2015 08:25:45 +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:28:10 +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 19/22] power_supply: 88pm860x_charger: Decrement the power supply's device reference counter Date: Tue, 10 Mar 2015 09:27:23 +0100 Message-id: <1425976046-20973-20-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: H4sIAAAAAAAAAyWRW0iTcRjG/e/79n3bcPahy75EuzA64FkLfImKbsI/dFGRJtWFLl1u4Zxu KlmRYkipeT6QB0LRmK08bVJ5mMR08zw84GjltNBglabpEjO1XN79nocfz3vx8gj3NtKLJ0tK lSiTxIm+lIAc2RmwBOZqdiJDygcCoXBshQONg/kkZG9/I6F0YZmAntFNGhqmPCGvPgRKXpQR MN4SDpXtB6C7toGE7/ZQGMtepGHulxFB5+clCsq31BxQ9xYh0M5buGBdXefCVFctBWsF/Qhy HdUUNPfbaFBvtpAw+a5uV176S4Ft2EjByx47AaMjk1yoXvSAkXwujHSngj5nggCdtoKAjbZ5 7rnDuGk1GM/29pG4qGWNizurbTT+UlxGY12TH9Zqcik8Y+mh8A+zmcbPhi5jXWMmNj6ZIfHX kj8UXu6dpnDH9CMSF3Zo0CXP64LT8ZJEWbpEGXw2ViDtMmxxkltd7xStm8ks1CzIQ3wey5xk 69+bqD32ZMdnW3dZwHNnniO2uclC7oVCDjtn7eQ6LYo5werUjf8tEWPksZvLdtoZCGYSsfML Q7TT8mBS2PbiOsLJJHOEbWzdQE4WMpit0bfTe/cOsUOmsv+r/N3e4fhAOtmdiWBtkz9RMRLW IRcN2i9Ji0tW3UyQhwapxHJVWlJCUJxCrkV7X3a8RQ2mUwbE8JCvq9B6YyfSnStOV2XIDYjl Eb4iobFotxLGizPuSpSKGGVaokRlQBwe3ysLxVZZwpGbsaQv0zvlwsP7H0mx9lbC8G37POsv UqwqBguv6c3aMzPRj62GANKxrTX5TCgKrp6Pqvi083TfK8Z01Hu18kFXVObB45qIi7KwAH3S Wk5VjKvLPYvPGxFIZdSV8e0w+eLvY7LXXQpbaQ3fjS9ZkcYS/igxuty83O9LqqTiUD9CqRL/ A/CHOrDDAgAA 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 Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/88pm860x_charger.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c index a7f32a5b2299..bf822aa00c14 100644 --- a/drivers/power/88pm860x_charger.c +++ b/drivers/power/88pm860x_charger.c @@ -298,13 +298,18 @@ static int set_charging_fsm(struct pm860x_charger_info *info) return -EINVAL; ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, &data); - if (ret) + if (ret) { + power_supply_put(psy); return ret; + } vbatt = data.intval / 1000; ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); - if (ret) + if (ret) { + power_supply_put(psy); return ret; + } + power_supply_put(psy); mutex_lock(&info->lock); info->present = data.intval; @@ -447,6 +452,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data) set_charging_fsm(info); out: + power_supply_put(psy); return IRQ_HANDLED; } @@ -507,6 +513,7 @@ static irqreturn_t pm860x_done_handler(int irq, void *data) out: mutex_unlock(&info->lock); + power_supply_put(psy); dev_dbg(info->dev, "%s, Allowed: %d\n", __func__, info->allowed); set_charging_fsm(info);