From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E80F2C47096 for ; Fri, 4 Jun 2021 01:36:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C56D9613FE for ; Fri, 4 Jun 2021 01:36:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhFDBhw (ORCPT ); Thu, 3 Jun 2021 21:37:52 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:4298 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbhFDBhv (ORCPT ); Thu, 3 Jun 2021 21:37:51 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Fx4wk0Km5z1BHjL; Fri, 4 Jun 2021 09:31:18 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 09:35:54 +0800 Received: from [10.174.178.174] (10.174.178.174) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 09:35:50 +0800 Subject: Re: [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe() To: Jonathan Cameron CC: , , , , Linus Walleij References: <20210601142605.3613605-1-yangyingliang@huawei.com> <20210603171822.14376c28@jic23-huawei> From: Yang Yingliang Message-ID: <1ebd111a-a34a-5d3b-a807-db8176bd19c8@huawei.com> Date: Fri, 4 Jun 2021 09:35:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20210603171822.14376c28@jic23-huawei> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On 2021/6/4 0:18, Jonathan Cameron wrote: > On Tue, 1 Jun 2021 22:26:05 +0800 > Yang Yingliang wrote: > >> Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe(). > Hi. > > One small thing. It would be useful if you could check if the bug exists other > than in next (this one has been their for some time!) If it does, please > don't add the -next in the patch title (as basically it makes me not worry > about reading it for a few days :) > > Also, make sure to cc the author of the patch in the fixes tag > +CC Linus OK Thanks, Yang > > Obvious enough fix (I hope) that I've applied it to the fixes-togreg branch of > iio.git and marked for stable. > > Thanks, > > Jonathan > >> Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor") >> Reported-by: Hulk Robot >> Signed-off-by: Yang Yingliang >> --- >> drivers/iio/frequency/adf4350.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c >> index 1462a6a5bc6d..3d9eba716b69 100644 >> --- a/drivers/iio/frequency/adf4350.c >> +++ b/drivers/iio/frequency/adf4350.c >> @@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi) >> >> st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL, >> GPIOD_IN); >> - if (IS_ERR(st->lock_detect_gpiod)) >> - return PTR_ERR(st->lock_detect_gpiod); >> + if (IS_ERR(st->lock_detect_gpiod)) { >> + ret = PTR_ERR(st->lock_detect_gpiod); >> + goto error_disable_reg; >> + } >> >> if (pdata->power_up_frequency) { >> ret = adf4350_set_freq(st, pdata->power_up_frequency); > .