Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1302975img; Tue, 26 Feb 2019 18:52:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IaKHEzfHCAlo3LlwmPlK39GytNdu2L+2C4tI7s8A8CNvJ2e22eLgHaJJFrs+S1gYJk9d4D9 X-Received: by 2002:a63:a609:: with SMTP id t9mr726738pge.33.1551235965407; Tue, 26 Feb 2019 18:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551235965; cv=none; d=google.com; s=arc-20160816; b=C2Fe51IZNunZJMc4QHjH44IuQAnTu5EJwE9itWcMVBPGPjyRh/L/VOlyAbhGBmeaSe FAAdCpcSZX7ltJt5CRlI9b/0+CeAw/LDviA/4CzHuKAGMz8Y2cbbmwxRAgyczwlbUY1j 2tb4n/GZziStjB+VPpvfcJMQMGCRJeEHblknLJzg9Fo/KHYW5e96sd0ouJ6gqUMKbdub HQ01yKXKO0fqdiJ0v7wqTJhMpmDVm1cQHxK0AxsyPWZivuQV+RTsxB2pSbmL2m6XC+ls eHJFzQHHV8KfEcwKdzgweBqoIqF7avUDLCUdWNXft8Z5uyx4FOe9OfNil01XU0u2CxZR ZFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=fKZNaDmyyChJz8oqSAms8/P9qKDSdWbpqwif9LAg3HU=; b=tO6Kuzwh847T7VPPAY/+3E6N1csYuE0eiWuBCsLR1nZtS8ctYtz3EqLp+xEDKBeT8E NKl5kKai3Kj5UwbbFJZA/0/zEcX+IqnCKpUzbMNZcXyqIUhTeajxUuG7JBag6UoMpveQ H5aL8rGA0nSnCUqpWPgeDZxtEe9OlYBpwk0bZEKruVeONDzFO0uhuRa9lNSQs3FMG7Z8 PpAFw2ISQncYYxGFxabRJOxHKCFRkWxUR2I5/ZyTVKV7/w+jTk05PWQYHyyZKOcWQC+2 vmBzW5H14HtEsDjyz5T6yePBe/IOoMFTbrLslqzD1GdDA2+HsCZx/NPPXvzq/zKq1d0B uR0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s80si13955291pfa.130.2019.02.26.18.52.17; Tue, 26 Feb 2019 18:52:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729550AbfB0Cvp (ORCPT + 99 others); Tue, 26 Feb 2019 21:51:45 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:40319 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729409AbfB0Cvp (ORCPT ); Tue, 26 Feb 2019 21:51:45 -0500 X-UUID: fd4c391035854900935be50a1503b2eb-20190227 X-UUID: fd4c391035854900935be50a1503b2eb-20190227 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 516935137; Wed, 27 Feb 2019 10:51:38 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Feb 2019 10:51:37 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 27 Feb 2019 10:51:37 +0800 Message-ID: <1551235897.1047.11.camel@mtksdaap41> Subject: Re: [PATCH v4 08/12] clk: mediatek: Add MT8183 clock support From: Weiyi Lu To: Stephen Boyd CC: Matthias Brugger , Nicolas Boichat , Rob Herring , Stephen Boyd , James Liao , , , , Fan Chen , , , Date: Wed, 27 Feb 2019 10:51:37 +0800 In-Reply-To: <155120345816.260864.13433355004684800350@swboyd.mtv.corp.google.com> References: <20190201083016.25856-1-weiyi.lu@mediatek.com> <20190201083016.25856-10-weiyi.lu@mediatek.com> <155120345816.260864.13433355004684800350@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-02-26 at 09:50 -0800, Stephen Boyd wrote: > Quoting Weiyi Lu (2019-02-01 00:30:12) > > diff --git a/drivers/clk/mediatek/clk-mt8183.c b/drivers/clk/mediatek/clk-mt8183.c > > new file mode 100644 > > index 000000000000..e9de9fe774ca > > --- /dev/null > > +++ b/drivers/clk/mediatek/clk-mt8183.c > > @@ -0,0 +1,1285 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// > > +// Copyright (c) 2018 MediaTek Inc. > > +// Author: Weiyi Lu > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > [....] > > + > > +static int clk_mt8183_top_probe(struct platform_device *pdev) > > +{ > > + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > + void __iomem *base; > > + struct clk_onecell_data *clk_data; > > + struct device_node *node = pdev->dev.of_node; > > + > > + base = devm_ioremap_resource(&pdev->dev, res); > > + if (IS_ERR(base)) { > > + pr_err("%s(): ioremap failed\n", __func__); > > This API already prints an error so please remove this duplicate error > message > ok, I'll remove those duplicate error message in next version. > > + return PTR_ERR(base); > > + } > > + > > + clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK); > > + > > + mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks), > > + clk_data); > > + > > + mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data); > > + > > + mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes), > > + node, &mt8183_clk_lock, clk_data); > > + > > + mtk_clk_register_composites(top_aud_muxes, ARRAY_SIZE(top_aud_muxes), > > + base, &mt8183_clk_lock, clk_data); > > + > > + mtk_clk_register_composites(top_aud_divs, ARRAY_SIZE(top_aud_divs), > > + base, &mt8183_clk_lock, clk_data); > > + > > + mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks), > > + clk_data); > > + > > + return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > +} > > + > > +static int clk_mt8183_infra_probe(struct platform_device *pdev) > > +{ > > + struct clk_onecell_data *clk_data; > > + struct device_node *node = pdev->dev.of_node; > > + > > + clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); > > + > > + mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), > > + clk_data); > > + > > + return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > +} > > + > > +static int clk_mt8183_mcu_probe(struct platform_device *pdev) > > +{ > > + struct clk_onecell_data *clk_data; > > + struct device_node *node = pdev->dev.of_node; > > + void __iomem *base; > > + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > + > > + base = devm_ioremap_resource(&pdev->dev, res); > > + if (IS_ERR(base)) { > > + pr_err("%s(): ioremap failed\n", __func__); > > + return PTR_ERR(base); > > + } > > + > > + clk_data = mtk_alloc_clk_data(CLK_MCU_NR_CLK); > > Can this fail? It doesn't seem to be checked for failure so I guess we > don't care? > It might fail but we have data validity checks in all the mtk_clk_register APIs. > > + > > + mtk_clk_register_composites(mcu_muxes, ARRAY_SIZE(mcu_muxes), base, > > + &mt8183_clk_lock, clk_data); > > + > > + return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > +} > > + > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek