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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B4BCC433EF for ; Tue, 14 Jun 2022 19:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=82bzjPFFIyDbnju61iuiybS5/mw2xRxKetUpW7m4irg=; b=Ob6XYxVu8sgVpO /Ue+uCFT0pjLOqcnWAJhE/EywbT4rdJX0KuIy8lxqacrchyyei72XJ9XaUCYuHbbeiq0MWbt3xngD nSjV6f9PekE21Ju+JnvzMAPzFIleOTAWt9vBL2ehV2GXdY2dmnjQdKFMrgiU1Av1nhwXAK1NXLY1u EbqM7lCVJmRf2M7bRp0Hv6u6Z601KXJ0kIdh3rWXirG08ubyDD1hdnfLS8IJsAnL5AdFwLUVRO+js LOEqOelgD3/D7Mdn3cbsLGyMClxVxzy9N3DlA92BCdXXYCc46zYiTRl6jo28W0f6JSS9KDdK/uBZB yczA9J0vUBpULW9pe9Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1CAt-00Ay9a-1J; Tue, 14 Jun 2022 19:26:03 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1CAp-00Ay7g-9z for linux-arm-kernel@lists.infradead.org; Tue, 14 Jun 2022 19:26:00 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E72D4B81A3D; Tue, 14 Jun 2022 19:25:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86436C3411B; Tue, 14 Jun 2022 19:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655234755; bh=zR4N6VFQrTCHnvSWBbsp4C65ceeJXY4ywAxcS0YZrjw=; h=In-Reply-To:References:Subject:From:List-Id:Cc:To:Date:From; b=f2CSbF3r+QJeBCBKi/nH+JCmfalOxnJcoqS6v5dNMKb/0K4LAvDhwXzzgL8v5LXa+ jqiA+0vWxDuXcBHYK0+yTzZm8o8auoVqHE7dZolGP6wquoKGXajarJ5k3hR2D7vCHb j16x/awsEn3yYDSoUDb5I61S2Em0UPgAtq3pqS/s8hMTl+icLw6ph+Xmh8eIkJH3An 9TwRN4U2r2tkC9AMaqrkimOv9IiTjg36yHbDoMvBHMsOOyysHjDZ3nxmAL5/c/fmxY yOawj7GIarD1MhpMnwCC98WLNj9KuDwgp0I5i15Un7NJy9GPw4ix4rysAT1AqpzYrK Dp8ouTSM0dPvg== MIME-Version: 1.0 In-Reply-To: <42ed93cf0e5cfeaffdf50d63da558a3f1f6c1021.1655194858.git.qinjian@cqplus1.com> References: <42ed93cf0e5cfeaffdf50d63da558a3f1f6c1021.1655194858.git.qinjian@cqplus1.com> Subject: Re: [PATCH v18 05/10] clk: Add Sunplus SP7021 clock driver From: Stephen Boyd Cc: krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, mturquette@baylibre.com, linux@armlinux.org.uk, arnd@arndb.de, olof@lixom.net, soc@kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Qin Jian To: Qin Jian Date: Tue, 14 Jun 2022 12:25:53 -0700 User-Agent: alot/0.10 Message-Id: <20220614192555.86436C3411B@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220614_122559_535181_EB8B8DDC X-CRM114-Status: GOOD ( 18.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Qin Jian (2022-06-14 01:31:04) > diff --git a/drivers/clk/clk-sp7021.c b/drivers/clk/clk-sp7021.c > new file mode 100644 > index 000000000..0caef1bc7 > --- /dev/null > +++ b/drivers/clk/clk-sp7021.c > @@ -0,0 +1,725 @@ > +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) This isn't a common license on driver files. Is it intended? Or copy/paste from DT? > +/* > + * Copyright (C) Sunplus Technology Co., Ltd. > + * All rights reserved. > + */ [...] > + > +static int sp7021_clk_probe(struct platform_device *pdev) > +{ [...] > + > + /* gates */ > + for (i = 0; i < ARRAY_SIZE(sp_clk_gates); i++) { > + char name[10]; > + u32 j = sp_clk_gates[i].reg; > + struct clk_parent_data *pd = sp_clk_gates[i].ext_parent ? &pd_ext : &pd_sys; > + > + sprintf(name, "%02d_0x%02x", i, j); > + hws[i] = clk_hw_register_gate_parent_data(dev, name, pd, 0, This needs to be devm as well. Otherwise if the driver is unbound we'll leak these registered clks. > + clk_base + (j >> 4) * 4, > + j & 0x0f, > + CLK_GATE_HIWORD_MASK, > + NULL); > + if (IS_ERR(hws[i])) { > + ret = PTR_ERR(hws[i]); > + goto unregister_gates; > + } > + } > + > + clk_data->num = CLK_MAX; > + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_data); > + if (ret) > + goto unregister_gates; > + > + return 0; > + > +unregister_gates: > + while (i--) > + clk_hw_unregister_gate(hws[i]); > + > + return ret; > +} > + _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel