Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp422526pxb; Tue, 3 Nov 2020 03:15:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhPCPLLEuSxyq9D1nVLFoR4+V+/JltVuk6Cp7MUo5kaWbphjt36cPkCFq/BfjyjDQliHD7 X-Received: by 2002:a17:906:8282:: with SMTP id h2mr14629426ejx.50.1604402137595; Tue, 03 Nov 2020 03:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604402137; cv=none; d=google.com; s=arc-20160816; b=PPxAXK2VXcgGCQUX4wV2vIZNHchHXbUER6TiIrVUFDbn70bYLLEbMUpWIGejJtHU0F uv/UwjkLIt73bBPGL2nHoZ8dVsVLD/6TQPU3H3BwB0B6r18WHRxSHhFBmNrfu7TTm30T 5bOa4X9hMx4FPQ1GRy2+N0oF21i2jUHx2ZZsOmdeoJP75RZqqri1SjDJRG+sMhmNys5w FAkz5pl2f+blQrtU3v3V4zF87RnjEe2PVwItAp03DREFFc0SJmizEeFCMad5BpbB86jb PmKUBU2bbhQkMTIzBJ4hdBpiUsvpAruvW+yJ8iz1Tr6OYsbB07YxpSQbci7neGFpaLyT Cj5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=tZ+MCYMgHIJyjsC5lH5QpCKzWSLWgykS0DmjW+0CMQc=; b=rC0hDz4UzUwT44lRCa0lJG6PQhpM6HWQ7Enq8i95TZ2ptCO5iBxMUarXW2PQIVyIJD wtpIekMXXjO0bMqm8CemDaeRUHiueVOg1P26zpp/dMduW9rP4dA1bzKmWbP0s4v1zsQN ZNDuunBDBVSpjwPEApQQcqFyy8V4teVrIs0ScH/+s14q6v5heL8OTkCD2YTXc7uuoQ5I sB+INbRrbaKcqR6GmgO6wifySRPIqvYN7kY4uqSaYYfrdvU+ne+G9Mh1TvFhALcrB70x 3JqB/r7KPA48Nu2OWMcdh20IWPAdjqHdgOQl0ghbP4qJwhyZeLk86kdZ3nffzLNN4s9K rokQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si14644614ejb.112.2020.11.03.03.15.15; Tue, 03 Nov 2020 03:15:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728249AbgKCLLi (ORCPT + 99 others); Tue, 3 Nov 2020 06:11:38 -0500 Received: from foss.arm.com ([217.140.110.172]:46794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgKCLLh (ORCPT ); Tue, 3 Nov 2020 06:11:37 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BA75101E; Tue, 3 Nov 2020 03:11:37 -0800 (PST) Received: from [10.57.54.223] (unknown [10.57.54.223]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B3AE3F66E; Tue, 3 Nov 2020 03:11:35 -0800 (PST) Subject: Re: [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume To: Qinglang Miao , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Heiko Stuebner Cc: linux-iio@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20201103074909.195465-1-miaoqinglang@huawei.com> From: Robin Murphy Message-ID: <50da9bf1-7317-b24b-9a87-e9dfb4e4a694@arm.com> Date: Tue, 3 Nov 2020 11:11:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201103074909.195465-1-miaoqinglang@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-03 07:49, 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") > 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; No need to add braces, just replace this utterly pointless "early" return ;) Robin. > - > + } > return ret; > } > #endif >