From patchwork Mon Jan 5 15:47:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5568801 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 3660DBF6C3 for ; Mon, 5 Jan 2015 15:49:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AAFB2011B for ; Mon, 5 Jan 2015 15:49:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4141D20166 for ; Mon, 5 Jan 2015 15:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754373AbbAEPtZ (ORCPT ); Mon, 5 Jan 2015 10:49:25 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56286 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754224AbbAEPsb (ORCPT ); Mon, 5 Jan 2015 10:48:31 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NHP00JIGO3L9C60@mailout1.w1.samsung.com>; Mon, 05 Jan 2015 15:52:33 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-d1-54aab24a215d Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 54.80.26295.A42BAA45; Mon, 05 Jan 2015 15:48:26 +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 <0NHP00HBJNWDWI80@eusync4.samsung.com>; Mon, 05 Jan 2015 15:48:25 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFC PATCHv2 16/19] power: 88pm860x_charger: Decrement the power supply's device reference counter Date: Mon, 05 Jan 2015 16:47:59 +0100 Message-id: <1420472882-10463-17-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> References: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKLMWRmVeSWpSXmKPExsVy+t/xa7pem1aFGNzvVLeY9OQ9s8XElZOZ LV6/MLTY+fAtm8Xyff2MFpseX2O1uLxrDpvF594jjBZ3Tx1lszhz+hKrxendJQ7cHjtn3WX3 2LxCy2PTqk42j81L6j22XG1n8ejbsorRY8Xq7+wenzfJBXBEcdmkpOZklqUW6dslcGV8W7iN qWA3d0XD5wtMDYyHObsYOTkkBEwktk9/wwJhi0lcuLeerYuRi0NIYCmjxOZ73YwQTh+TxMT9 78Cq2ASMJTYvXwJWJSLwhElieutJsASzgKHEz3d/2EFsYYFciRPT+oC6OThYBFQl1s9VBQnz CnhI9HQeY4PYJidx8thkVhCbEyje9PcC2BghAXeJD89+sU5g5F3AyLCKUTS1NLmgOCk910iv ODG3uDQvXS85P3cTIyQov+5gXHrM6hCjAAejEg+vx4mVIUKsiWXFlbmHGCU4mJVEeF+lrwoR 4k1JrKxKLcqPLyrNSS0+xMjEwSnVwLhocsEr6Ydtm0336F0oeiHxyePRa7Hf0iwuVx8J7A3m 1/cXv3Pxtc2vFSlyQa9XFbXHfVvn28UpmT5j3YXS2X45Zw5fXXCq763KXWHDVV1uqcvW/TuS Lcd9VeRdZcIMDfvTN39cPXtw8uVZLzYdkvwv9tjyv/TqLVYbf687FBcsnGG5OLnrX/xKJZbi jERDLeai4kQAmTpP3CgCAAA= 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 --- 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 59d62665b526..f88caee01ee9 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);