Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2635493pxb; Sun, 8 Nov 2020 07:43:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlu+My4MhufUzgF2MnKgIMUHogcfxFm8VSazMNjyNcJ9LMb8inrWrO3DndYLuoPA61fL9x X-Received: by 2002:a17:906:c186:: with SMTP id g6mr10561244ejz.465.1604850206375; Sun, 08 Nov 2020 07:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604850206; cv=none; d=google.com; s=arc-20160816; b=022ukEoTIsZnUIWGDkKUfagBBVgFTDi5PL1x5qoP9cnQq8IwatsbGDT8YCtzciW+Fr Re7/t+HShsZ4pbsMZkhS7CCbFjfbh/v4jGeQz3ljKodwZWxlPSyZD07h42Q4WnW1M0wP XnCkWgchxOGRMLKuphBYZpBp+YTuHL/4VTQqoWffl5+pe38z7+//EbM6RCFMJcmnohO4 4oPEldLvWVBBBfvjSphUkDFwubtAvwrQq38nx+nUtCtNHRglPuQa1rmZiZH3HvRHAkZh Of176FSLUg/GpU03DxExmFvUdh6f9lIbWbCxsiKszXBH6LRo7V87h1YOnd++xooKEs+Z wzgA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=piU9T43nnUklpQeNJAc0stTNpqUiHAgN33GgKMmDLYM=; b=zHcg1an4nm95gBWkWM9q06QlCQUBFBmxqgo+uOb7x6r8czfWOWBh2lRojA9id0YANT khW7+SfkaFjI1UpvCwhNv0S+pws1oSmB7czLa7ieqWyeMjRMDi5vdejUh6xD0EqCgVLR SqC4VELqlKStRAMPUWGvoCSTDzEjq3/vKJ+imIOkuYQX35PhYYK8VYT+irrSkq1S+9SZ smIRljkIdeZf+KVdZpGEmau16aAOb9IdzD/LXDMeM/X+jtf6TeeJ2STki5J3Pd1clb6g oNYOzOT/pK/d5TfQFufURqF2Il0kGwHnSf+3kmn4zKeR3tXE7nSnHx1JTIIGolpRPTkY jAbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a1b7mIEm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si6294951ejd.193.2020.11.08.07.43.02; Sun, 08 Nov 2020 07:43:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=a1b7mIEm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728363AbgKHPle (ORCPT + 99 others); Sun, 8 Nov 2020 10:41:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:52582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgKHPle (ORCPT ); Sun, 8 Nov 2020 10:41:34 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1EBEC206ED; Sun, 8 Nov 2020 15:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604850093; bh=Ro0XFlRfJTxsmdUsm+VsUuYHfoz4ChDTnZqn6A2mBCw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a1b7mIEmiDKom1i3FfZH1EVwV11OCSXeE0soCh2G3P8PGWCvIHVZMi0yfXvajA/Mg kuCeEFjysVB/RasYm7Lw6qC+ERq59s2Nfl1fZM6Hi+hsk1NlSM/uNXt4QChYPn6b4D IRjdwhtdGkADNnqSjA6f2Rt8wdsCERmh9riR07rY= Date: Sun, 8 Nov 2020 15:41:28 +0000 From: Jonathan Cameron To: Qinglang Miao Cc: Robin Murphy , Lars-Peter Clausen , Peter Meerwald-Stadler , Heiko Stuebner , , , , Subject: Re: [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume Message-ID: <20201108154128.57f4162f@archlinux> In-Reply-To: <20201103120743.110662-1-miaoqinglang@huawei.com> References: <20201103120743.110662-1-miaoqinglang@huawei.com> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Nov 2020 20:07:43 +0800 Qinglang Miao wrote: > 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") > Suggested-by:Robin Murphy > Signed-off-by: Qinglang Miao Looks good to me. I'll just give it a little longer on the list so Heiko and others have a chance to sanity check it. Thanks, Jonathan > --- > v2: remove useless braces because early return is pointless. > > drivers/iio/adc/rockchip_saradc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c > index 1f3d7d639..12584f163 100644 > --- a/drivers/iio/adc/rockchip_saradc.c > +++ b/drivers/iio/adc/rockchip_saradc.c > @@ -462,7 +462,7 @@ static int rockchip_saradc_resume(struct device *dev) > > ret = clk_prepare_enable(info->clk); > if (ret) > - return ret; > + clk_disable_unprepare(info->pclk); > > return ret; > }