Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5460960pxb; Wed, 26 Jan 2022 12:31:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxufFZixD6fFDj+4d6jL6MhZqf+HCLSsN6u565O+kqCvj0CiKatNFTTobvDTEdTkT731ub9 X-Received: by 2002:a17:902:da8b:: with SMTP id j11mr210972plx.90.1643229079296; Wed, 26 Jan 2022 12:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643229079; cv=none; d=google.com; s=arc-20160816; b=DfkgQemviSFwkpPVk/5URkNrtdbrC98znjprR7v5PT+5xJ2PW/B9o/0p8r1ZY5++le 4sPUCDNOVAVg+a8J8qwgINHm0qE0LpvogFly2iQjrRpUDeXAf7fG89uYcGfisULVkmH6 l543BXO2neiVsjQb4AxA1kysRt6QudQTlaTnOpZHlA364zFb5bi86YmbtyXrbQ/GkYE0 GfVy0hcuKYRAd43157Mt47eJfUldYn5Rvjmv3lofLnSpD3O3YWZERYkxPwS9FGv+ousK fj8GmrkP8X1K2yRNS3/CEW6SZpV65iGmtTeZKVi6L8fWNAuf4EtWyC7i6QmkPRytl7/O mxFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=jmgY05/tRIq0R06bVZxNwwy+m2WhMUUyZEfPrwQwBKo=; b=oAgRFzVp0oL3GApg7B0EOUiDMaEWUo7YAdebSHlYmWm7JO12nizhFvlyZeMg9QUyiC mbxLIQCk7HHH+Ujksn3vt3iflbWNPXSzvrE8Wkdxpkl0nKalq0zE66Vhl4U3mlUJc4yg mtLm6riR8asmGV1PcmhlvkA75cc6x2dKbcOc9srf1mhWg2e1ZxQ4hLYDGd9UdnaQpm// V6fnJ0ZTAl16K4RDv9XcGdTIRrxXNjXdoSrKc+guy44Mho1P1KxXwCa6mwP2q7GbxRVY 83P2nGBPHpoaRf+Ro6pFd620Qvl289aUf7Jci3NXJY8kIkDVQ6IsCIBXRqE+fghsYIek gCGg== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bj16si283592pgb.120.2022.01.26.12.31.07; Wed, 26 Jan 2022 12:31:19 -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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230301AbiAZITR (ORCPT + 99 others); Wed, 26 Jan 2022 03:19:17 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:60976 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229962AbiAZITQ (ORCPT ); Wed, 26 Jan 2022 03:19:16 -0500 X-UUID: f67c3db7b35640f9899814547fe75c54-20220126 X-UUID: f67c3db7b35640f9899814547fe75c54-20220126 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1900413820; Wed, 26 Jan 2022 16:19:12 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Wed, 26 Jan 2022 16:19:11 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 26 Jan 2022 16:19:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 26 Jan 2022 16:19:10 +0800 From: Miles Chen To: CC: , , , , , , , Subject: Re: [PATCH 27/31] clk: mediatek: Unregister clks in mtk_clk_simple_probe() error path Date: Wed, 26 Jan 2022 16:19:09 +0800 Message-ID: <20220126081909.7300-1-miles.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220122091731.283592-28-wenst@chromium.org> References: <20220122091731.283592-28-wenst@chromium.org> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Until now the mediatek clk driver library did not have any way to > unregister clks, and so all drivers did not do proper cleanup in > their error paths. > > Now that the library does have APIs to unregister clks, use them > in the error path of mtk_clk_simple_probe() to do proper cleanup. > > Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen > --- > drivers/clk/mediatek/clk-mtk.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c > index e1977c8e130a..6d0b8842971b 100644 > --- a/drivers/clk/mediatek/clk-mtk.c > +++ b/drivers/clk/mediatek/clk-mtk.c > @@ -434,12 +434,14 @@ int mtk_clk_simple_probe(struct platform_device *pdev) > > r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > if (r) > - goto free_data; > + goto unregister_clks; > > platform_set_drvdata(pdev, clk_data); > > return r; > > +unregister_clks: > + mtk_clk_unregister_gates(mcd->clks, mcd->num_clks, clk_data); > free_data: > mtk_free_clk_data(clk_data); > return r; > -- > 2.35.0.rc0.227.g00780c9af4-goog > >