Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458AbcDNM6H (ORCPT ); Thu, 14 Apr 2016 08:58:07 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:38816 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755037AbcDNM5x (ORCPT ); Thu, 14 Apr 2016 08:57:53 -0400 From: Jisheng Zhang To: , , , CC: , , , Jisheng Zhang Subject: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Date: Thu, 14 Apr 2016 20:53:32 +0800 Message-ID: <1460638414-5987-3-git-send-email-jszhang@marvell.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1460638414-5987-1-git-send-email-jszhang@marvell.com> References: <1460638414-5987-1-git-send-email-jszhang@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-14_07:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603180000 definitions=main-1604140186 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 680 Lines: 24 If i2c_dw_probe() fail, we should call i2c_dw_plat_prepare_clk() to disable and unprepare the clk, otherwise the clk enable and prepare is left unbalanced. Signed-off-by: Jisheng Zhang --- drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 00f9e99..1488cea 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -268,6 +268,8 @@ rpm_disable: pm_runtime_put_noidle(&pdev->dev); } + i2c_dw_plat_prepare_clk(dev, false); + return r; } -- 2.8.0.rc3