From patchwork Mon Feb 23 11:47:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5865171 Return-Path: X-Original-To: patchwork-linux-arm@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 DE3D6BF440 for ; Mon, 23 Feb 2015 12:05:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 049DE20531 for ; Mon, 23 Feb 2015 12:05:25 +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 E7E2720520 for ; Mon, 23 Feb 2015 12:05:23 +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 1YPri3-0002OA-9N; Mon, 23 Feb 2015 12:01:59 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YPrWm-0006NY-TO for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:50:21 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NK800KKZ3NAXMA0@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 Feb 2015 11:52:22 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-34-54eb12f50784 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 29.6A.07834.5F21BE45; Mon, 23 Feb 2015 11:45:57 +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 <0NK8001843FJ0A90@eusync2.samsung.com>; Mon, 23 Feb 2015 11:48:22 +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 v4 17/20] power_supply: 88pm860x_charger: Decrement the power supply's device reference counter Date: Mon, 23 Feb 2015 12:47:38 +0100 Message-id: <1424692061-30624-18-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> References: <1424692061-30624-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2RWUxTYRCF/e/W24bGa1m8QDBao4moLFFkBCEmPvj7YMCIxpAoVmzAyGYL KC6BgD4Alq0ISgAlRaoge6KyCFgBRVbBkCCbBNCy70QR0BZ8m3PmO3MehiUl7ygr9lpQqFwR JAuQMiKqef3j14NLkgkvh6o6O0honSUg91M8BdFr4xSkjMyQUN2yIgBNlwXE5ThA8ks1CTGa YgY6ipwhrXQ75M09ZaAqU0PBhN4RWqMnBTC41ICgYmiKgdRVLQHamkQEZcPdNPTML9PQVZnJ wIKqHkHsYgYDhfX9Aohtz0GgXSmioLPumSEx9ZeB/s8NDBRU60loae6kIWPSFJrjaWiuCoV3 D76QUF72iIRfJcP08b34xbw9Hqj5QOHEogUaV2T0C/Ds3CU8mqQW4PIXtnhkXEvjsvxYBvd1 VzN4uq1NgLObzuDarFcGIDcSNzzso/BY8h/G09JbdOyqPOBauFxh735Z5F+pWyVCik1uJS63 UVGoUBSHhCzPHebVP9bozdmC7xgoZuKQiJVwzxFf0J35XyQQfN5YLGGkGO4QX67N3ViYcY1C /n2hijAKkutE/PBIk8BImXI3+HT1t427FLeH/6k3JoSsmMN8XvIUsdm3g29qVBsYlhUa/MHX 4UZbwp3kVaWpKAmJn6Et+chcHuYborziF+hop5QFKsOC/Ox8gwPL0ObLF98iTaOLDnEskpqI v4ePe0loWbgyIlCHeJaUmomtfxss8VVZxG25IthHERYgV+oQwQqtopCHWcp5qev+U/fchwYJ 7+mjbZlrR5ycd59OX6+8/wTErVsbd0UKc7q86g5YNey7o5/p/Wju55GQEhHl8jgrpGTK3TV1 9M3ZUWHCddeCmzHttebbhvbcNXHrsValYXlJvBNq13me8A9ysnQeqjm30+2CTVWKqc/z7OlR fa/KZkWTcVFKKf1ljrakQin7B2oaSuLQAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150223_035021_109333_99434E3A X-CRM114-Status: UNSURE ( 9.76 ) 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 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);