Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp319148pxb; Mon, 2 Nov 2020 23:45:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv3tY02PeonrMCfX+CzqLPSYc5lVr4sq5GF3JwGC3JfRnNsj1bv4XSOXqSrgum8wO7FxfB X-Received: by 2002:a17:906:5841:: with SMTP id h1mr18495362ejs.342.1604389541790; Mon, 02 Nov 2020 23:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604389541; cv=none; d=google.com; s=arc-20160816; b=Vcp2a1LJrCAv4DtDPPd1536uko2+5PAPf7MymebxHnt5U3umwUhcDoLWl4FqOx64pP TWcl90jc6QnbMbWWzOCxhthrqvscjSNgumdKo22ac3dt4doBHQfqQu5ZKiEm9g9vAmR/ 5d0InDfjpwrLgMYBpQc0lF4UW4M4OYe93ThP4NW4dGLMLBpO+l9TUnq0iah5ccQEgkGm lwKKbGuNAKYNlnx6vvFPw1gVzPDe2AK7mz5mwVkLMFtWAdmjHf8CO/BMiFNlSMeqb30+ lH2oBcKCo0hBwKvimhdeaLr8TfIHIE7CiK7gc0fc8+1+e2Fb56yM3aHHE5ywm1ICr268 pdEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QL4DhPHzQ/VLCQv7p3whlbQjPiugwCnAhkPpu5vuPgo=; b=DX2w9+P8oUjkCDUKoRJymATwnmOwyIuRuZWUUM7CIfUNKwVBD9oLISHpKEwncmvpbj iXQSHFhXUe3ljtPb2VqHlDK2vjHf23Jml9koqkCy9lcYar59CK+4KAeDFrbLowwfYIua IufDBuhPynmUQz8hOZXGDFEGH1VEz6CtGAS58l363SpTSQQKVaxdTzc5g0mUP5km0bpd 1dMzy82KTKv4gQUEVcmh67FKTLcUyQUSWhvtaQTflx5dah0G15Lh6yzAjaWHXHI1a1q+ rtuivUDNmZMJO+/9VmRtZhq7E+L2rxEmsZ22xu6+VygqAgS813E3CI15ZSvyLl/tjZk2 9+Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si7907008edf.28.2020.11.02.23.45.19; Mon, 02 Nov 2020 23:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbgKCHns (ORCPT + 99 others); Tue, 3 Nov 2020 02:43:48 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:7409 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgKCHnr (ORCPT ); Tue, 3 Nov 2020 02:43:47 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CQMGj6Slbz71th; Tue, 3 Nov 2020 15:43:41 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Nov 2020 15:43:33 +0800 From: Qinglang Miao To: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Heiko Stuebner CC: , , , , Qinglang Miao Subject: [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume Date: Tue, 3 Nov 2020 15:49:09 +0800 Message-ID: <20201103074909.195465-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the missing clk_disable_unprepare() of info->pclk before return from rockchip_saradc_resume in the error handling case when fails to prepare and enable info->clk. Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc") Signed-off-by: Qinglang Miao --- drivers/iio/adc/rockchip_saradc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 1f3d7d639..5eb566274 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -461,9 +461,10 @@ static int rockchip_saradc_resume(struct device *dev) return ret; ret = clk_prepare_enable(info->clk); - if (ret) + if (ret) { + clk_disable_unprepare(info->pclk); return ret; - + } return ret; } #endif -- 2.23.0