Message ID | 20230206152928.918562-8-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2298843wrn; Mon, 6 Feb 2023 07:31:54 -0800 (PST) X-Google-Smtp-Source: AK7set8oveeCva36rCLBsk+OvI/JeyQv6rZ3mQsQJXA+mYK2JM2PxcSB7mcB1xEGV+cE+zigAXhp X-Received: by 2002:a17:907:2d28:b0:88d:f759:15ae with SMTP id gs40-20020a1709072d2800b0088df75915aemr32745059ejc.42.1675697514646; Mon, 06 Feb 2023 07:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675697514; cv=none; d=google.com; s=arc-20160816; b=TVBfc+AbkbpLm6G37t0dhKXDVH/TT/6nduG5hI0NWG+wq4LhOFqn+gdRwdZCFY7XAA tD/FGmomBN5eJFaoZg2Pc5rvk6JNDj1FJqQaQ6vUcRdLMszCRKPA6bH1LmVzIK7NW3rR HkdLzEIobEqo2cCmqixq8Zg7Ct77+64xD5NgMQQqWZ3NumZLerXnOTqISYSKc092X3La 9UBFCLiHt5e73241sLs0/PDrdmqAApdaV8kgg63oihqP+kGe1JLWS17p2jqCJxylvSS4 pNrzoeZmOeO50HW5Zk9qHei9BbdN7+vjwdgIUPej6LR608KW1khTKNY9ctXX4Ynasmqm AMgw== 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:date:subject:cc:to:from :dkim-signature; bh=XV7dmS0A1SuTF2ovOixLewqV0220A/WONbOh27o3v6A=; b=Cja4NKA59rU1lq9mx6WWc+J1qADZJBeeYxX5runCMhD+3aRZBt6d9J1mORdcDT0A0w 5w11zJVwtoE6phBq8OS+cNCNDUuKE2VfDLQ533VOY1mC8osqdZehL13qUMHGDeVDAamZ W6VfDoHyoYcqswL8maGr8JAgdRMj1lqlLJGM7kDiacYHm4I9b9OUeUYbF7ufeY4TxyP3 s2NOf/Z6bPI5XJ78bmYmPZpnnvA6Ozf70YvKq910Us1qlH+49SlSa7EXIAyOmYwo8r+V XBsLvE06KqGDPfLnI9v/PpGwaPT4gpepZBu7wLNPN0grJFi9MoX8Bq2Ha8CvD+G1rbsh RHHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eXOLsIla; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a17090610ce00b0087867fc24d0si16502666ejv.483.2023.02.06.07.31.31; Mon, 06 Feb 2023 07:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eXOLsIla; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbjBFPaS (ORCPT <rfc822;kmanaouilinux@gmail.com> + 99 others); Mon, 6 Feb 2023 10:30:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjBFPaK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 6 Feb 2023 10:30:10 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6217629E3E; Mon, 6 Feb 2023 07:29:57 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0C8E26602F9A; Mon, 6 Feb 2023 15:29:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675697396; bh=z8a6JNOhLbAdbIgrzm/CxvYyQHio+v3E4inzHF3L1Oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXOLsIlasomzsRwn8JH5nOZRLQFv9jUR/KV4W6n0E01dLkB0xZT12NhzUkUMzROMv 5yZLP7s8ipFSH2pPRg2BTe3YuvycKhZuUoxf84iGG71ABcHCRpopK2beC6tt0BEREm +3sxUdaSGT45VXNOjg/NuU0fASIPQ0E+ZuyFO8Jz5v2qsfcnA40m6Pj0xTJwuIJDnS 1RRJrKey8kojNp8sJozw1XpeZLDb9iQ93bEWirnA7ya6xx3j7Jw4lLnx3D6EUZLsCt JgJ6m4eT9zS9KBrvQffNUrWSIMvBKDIsTFnKXCYfYbmL5ic/kMbGLLVT3oaRNXE2Ga SD2X7lQQpdmjw== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: mturquette@baylibre.com Cc: sboyd@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, johnson.wang@mediatek.com, miles.chen@mediatek.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, fparent@baylibre.com, msp@baylibre.com, nfraprado@collabora.com, rex-bc.chen@mediatek.com, zhaojh329@gmail.com, sam.shih@mediatek.com, edward-jw.yang@mediatek.com, yangyingliang@huawei.com, granquet@baylibre.com, pablo.sun@mediatek.com, sean.wang@mediatek.com, chen.zhong@mediatek.com, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v1 07/45] clk: mediatek: mt2712: Add error handling to clk_mt2712_apmixed_probe() Date: Mon, 6 Feb 2023 16:28:50 +0100 Message-Id: <20230206152928.918562-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206152928.918562-1-angelogioacchino.delregno@collabora.com> References: <20230206152928.918562-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757096197302055880?= X-GMAIL-MSGID: =?utf-8?q?1757096197302055880?= |
Series |
MediaTek clocks: full module build and cleanups
|
|
Commit Message
AngeloGioacchino Del Regno
Feb. 6, 2023, 3:28 p.m. UTC
This function was completely missing error handling: add it.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/clk/mediatek/clk-mt2712.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
Comments
On Mon, Feb 6, 2023 at 11:29 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote: > > This function was completely missing error handling: add it. > Fixes tag? Code looks OK. So once the tag is added, Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > drivers/clk/mediatek/clk-mt2712.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/mediatek/clk-mt2712.c b/drivers/clk/mediatek/clk-mt2712.c > index ce28ee47f5cf..8aa361f0fa13 100644 > --- a/drivers/clk/mediatek/clk-mt2712.c > +++ b/drivers/clk/mediatek/clk-mt2712.c > @@ -1091,15 +1091,25 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev) > struct device_node *node = pdev->dev.of_node; > > clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); > + if (!clk_data) > + return -ENOMEM; > > - mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); > + r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); > + if (r) > + goto free_clk_data; > > r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); > + if (r) { > + dev_err(&pdev->dev, "Cannot register clock provider: %d\n", r); > + goto unregister_plls; > + } > > - if (r != 0) > - pr_err("%s(): could not register clock provider: %d\n", > - __func__, r); > + return 0; > > +unregister_plls: > + mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); > +free_clk_data: > + mtk_free_clk_data(clk_data); > return r; > } > > -- > 2.39.1 >
Il 07/02/23 07:16, Chen-Yu Tsai ha scritto: > On Mon, Feb 6, 2023 at 11:29 PM AngeloGioacchino Del Regno > <angelogioacchino.delregno@collabora.com> wrote: >> >> This function was completely missing error handling: add it. >> > > Fixes tag? Noted for v2, thanks! > > Code looks OK. So once the tag is added, > > Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> > >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >> --- >> drivers/clk/mediatek/clk-mt2712.c | 18 ++++++++++++++---- >> 1 file changed, 14 insertions(+), 4 deletions(-) >>
diff --git a/drivers/clk/mediatek/clk-mt2712.c b/drivers/clk/mediatek/clk-mt2712.c index ce28ee47f5cf..8aa361f0fa13 100644 --- a/drivers/clk/mediatek/clk-mt2712.c +++ b/drivers/clk/mediatek/clk-mt2712.c @@ -1091,15 +1091,25 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); + if (!clk_data) + return -ENOMEM; - mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); + r = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); + if (r) + goto free_clk_data; r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); + if (r) { + dev_err(&pdev->dev, "Cannot register clock provider: %d\n", r); + goto unregister_plls; + } - if (r != 0) - pr_err("%s(): could not register clock provider: %d\n", - __func__, r); + return 0; +unregister_plls: + mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); +free_clk_data: + mtk_free_clk_data(clk_data); return r; }