Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp863688img; Tue, 26 Feb 2019 09:51:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ4MJiQmGbwXVnxRtENH1fTeYmtbk4OZ4pd5dU73qroyHAqfGRxo+z1MvfX+geUDPVZwWiJ X-Received: by 2002:a65:6148:: with SMTP id o8mr14733659pgv.442.1551203494881; Tue, 26 Feb 2019 09:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551203494; cv=none; d=google.com; s=arc-20160816; b=clRmc7efXT/NQcbCt2RyuNhSQRIVzzGZsS5pyFgFkJ13p9whQnfaJo+KKi6BNX+zx8 4NnHy9ACbKWONhVXBdW+d2IjASowCDGcG2nco885SYcWRGddfAOtDyjxYZ3PFLaakAWS 6YsH258DVb8IJ3SoRHNRTIl20f2aZzEELkwYPs+FaRbCpvIkf9xC99iiEbvMLfqCHEY8 orDUkVKwKllyOLKrraAmNOE1ywKHkKal7tHGQPxiSaHiz3mnjTneNjPiN9rWAjdN9ZX8 Ip+FO9DaR06CRsSNH+aXHPlG15PZFVthLTLoN9P+VGGFQ7cjWFGliNWYsFdQch4/XhJ+ mMUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:in-reply-to:from:subject:cc :user-agent:message-id:references:to:content-transfer-encoding :mime-version:dkim-signature; bh=2BB3u71ynoWTY6xZGxtsEeEPfNTVa+Mke2wnxXGV2cw=; b=WcVOZFwubqhwOJWp6wZBltjxiTzEK8QifkKTXuQpBAjbIxGwoafE4rjqtQllmTry7V AKOlTpNb0x1w/PJ9zGstGMlSByMOe9NTN9mGWXumnnCaUf7JRIlwLnsneq4WesPQbPMR GbeIHhOjPcLef2x3Td6hd8qkz4sTTVpTCcbQOsIk5qLyDTFm34BNooSP63Q4bxU2il8M sQK3E3xjWFLG7iChm4ZG1izaQOLChvpJ0KX1Lg01zq/ygPVFkSRNZExUuHLcx/9stxmD lTXVwjScnHHA2aIbjPIZxKjb6DyRyPHrZPVAMc79mxlAPjuygP+dxVgFvyUNkf2OYp6f VjoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eU7Tu+U4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si5004331plr.73.2019.02.26.09.51.19; Tue, 26 Feb 2019 09:51:34 -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; dkim=pass header.i=@kernel.org header.s=default header.b=eU7Tu+U4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728845AbfBZRvA (ORCPT + 99 others); Tue, 26 Feb 2019 12:51:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:52630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbfBZRvA (ORCPT ); Tue, 26 Feb 2019 12:51:00 -0500 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB8352173C; Tue, 26 Feb 2019 17:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551203459; bh=3nANAhLFyGRirluaGDEeKEuf9286NQe83pDNkn3J9cs=; h=To:References:Cc:Subject:From:In-Reply-To:Date:From; b=eU7Tu+U4qF5KIUncNyhZSeY/wqfVC2NtvtPhW8Vgp61WDzK1OOnj9df3Ved0morI9 ADal/JolADUMjFEeDzhztiednhGKX0AR/CaewISTFaZKW4bjvHJcp2P2OmYr500781 WowW3sDEvrvrRrYeMJAfU6hPJlFn9gmF/CsycrKk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Matthias Brugger , Nicolas Boichat , Rob Herring , Stephen Boyd , Weiyi Lu References: <20190201083016.25856-1-weiyi.lu@mediatek.com> <20190201083016.25856-10-weiyi.lu@mediatek.com> Message-ID: <155120345816.260864.13433355004684800350@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Cc: James Liao , Fan Chen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, srv_heupstream@mediatek.com, stable@vger.kernel.org, Weiyi Lu Subject: Re: [PATCH v4 08/12] clk: mediatek: Add MT8183 clock support From: Stephen Boyd In-Reply-To: <20190201083016.25856-10-weiyi.lu@mediatek.com> Date: Tue, 26 Feb 2019 09:50:58 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =3D platform_get_resource(pdev, IORESOURCE_M= EM, 0); > + void __iomem *base; > + struct clk_onecell_data *clk_data; > + struct device_node *node =3D pdev->dev.of_node; > + > + base =3D 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 > + return PTR_ERR(base); > + } > + > + clk_data =3D 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_mux= es), > + 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 =3D pdev->dev.of_node; > + > + clk_data =3D 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 =3D pdev->dev.of_node; > + void __iomem *base; > + struct resource *res =3D platform_get_resource(pdev, IORESOURCE_M= EM, 0); > + > + base =3D devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(base)) { > + pr_err("%s(): ioremap failed\n", __func__); > + return PTR_ERR(base); > + } > + > + clk_data =3D 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? > + > + mtk_clk_register_composites(mcu_muxes, ARRAY_SIZE(mcu_muxes), bas= e, > + &mt8183_clk_lock, clk_data); > + > + return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data= ); > +} > +