From patchwork Fri Feb 27 08:19:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5898571 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 48E209F373 for ; Fri, 27 Feb 2015 08:22:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 778DC201BB for ; Fri, 27 Feb 2015 08:22:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92B422020E for ; Fri, 27 Feb 2015 08:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754941AbbB0IVD (ORCPT ); Fri, 27 Feb 2015 03:21:03 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:44138 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754928AbbB0IU7 (ORCPT ); Fri, 27 Feb 2015 03:20:59 -0500 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 <0NKF00BDP8PLWY70@mailout3.w1.samsung.com>; Fri, 27 Feb 2015 08:24:58 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-58-54f028548dc8 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id F3.CD.07834.45820F45; Fri, 27 Feb 2015 08:18:28 +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:53 +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 17/20] power_supply: 88pm860x_charger: Decrement the power supply's device reference counter Date: Fri, 27 Feb 2015 09:19:58 +0100 Message-id: <1425025201-15926-18-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: H4sIAAAAAAAAAyWRa0hTcRjG++9cdnZwcJqXjn7owzARoXmp6K1MJIJOHyLFWVFRLh0qOLVN RSNKDRHvt7IU00Rty3QrBfM+m5fUeWuiGKklWph519ScVi6//Z6X38Pz4aUwUQvuQIWGR8mV 4bIwMUnjxj8fho9KnZelbsU5TpDZv8yD8u40HBJ353DInVnCoLlvmw9lw3aQWuoGOa/yMHhU piNhSHsS8t8egpcrJSQ0FZXh8HPWHfoT5/nw5VcngoapBRIe76h5oG7NQlAzPUrAp9UNAoYb i0hYy+hAkLJeSEJ1xwQfUgZLEai3tTiY2l7sNRb+kjDR20nC6+ZZDPqMJgIK563BmEaAsSkK WpI+YlBb8wSDrTfThLcTp1l15SZb23EuS7tGcA2FE3xueeUW9y07j8/Valy4mTk1wdVUppDc +GgzyS0ODPC54h5fTv+8ak8of8h1po/j3I8cM+ljf532DJKHhcbIla5eAXRIo2GHF6mzis3a GMDjUTWdigQUyxxndd3pvH22Y4cmdWQqoikRU4FYbe4KsR8yeezg7wHcYpHMMbZWXf7fsmG6 BOz76gyeJWCMCbHTMz38VERR1sxdtt1031LAmSNswlodaWEhw7Gb5ha0P3eY7enKIyws2Lsv 7hbwLSxiLrC60k2UjYQv0IFKZCuPDoxU3QlWuEtUMoUqOjxYEhihqEH7L1+vR2Vdpw2IoZDY Suh9cFkqImQxqjiFAbEUJrYRoqklqUgYJIu7J1dG3FZGh8lVBsSjBA7x6Lw52VNfIknzuyYx m1turt0oz6nTS/BT/u9WbL3Gxo1av88eZ8bsO/M9BDF+YWCy7rvy/RmNPFwqchVGkTRgOMG3 SkM7m9Al/ITGv8Ax6PJX7GnzWZPeSl+Y3DZSb0iiCzYv2l0doXu3wFGcztThJtcHmbGO/j7n BhW9C2JcFSJzd8GUKtk/n7oe+tACAAA= 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);