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 5B176CCA47C for ; Wed, 15 Jun 2022 02:33:46 +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:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aDY7F8RfLbCk2Qj4gBCVqCzxkHgWjcCvvRpnIs/u81g=; b=2y29o0KbGKOdE/ H/J8hGFhdlAw1x0ZwmfeHRBoNAieDUiY+FJYdMkE8fF68mgc/H/r+hopZLOWTXWgUlIo6bVlNQ68I 6onLKy8zPFip79nhqQZ9g1mlmrHYOjLWLMu1PkbujcPBD0fknSdt5OkrQuM3ftA5VoA98JWxd7zbn QgIGL1mX93WbWqLAE7NKPFa7m8Ei18CuuMZepScUSEiI2xTRvpiTA7bczG4pLgF0EejiIfD4eaO4d VqJtZE07Z6wIBMtw9LtoVejw7+8JM9Z1cre894RimLLfZbznu0LIf66Ebl5ePhN0JK3zThiFtJItp OdsleER15/OFYfzJSj1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Ipi-00CDrc-Tl; Wed, 15 Jun 2022 02:32:38 +0000 Received: from mx1.cqplus1.com ([113.204.237.245]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Ipe-00CDqb-8e for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 02:32:36 +0000 X-MailGates: (flag:1,DYNAMIC,RELAY,NOHOST,LAN:PASS)(compute_score:DELIVE R,40,3) Received: from 172.27.96.203 by mx1.cqplus1.com with MailGates ESMTP Server V5.0(28633:0:AUTH_RELAY) (envelope-from ); Wed, 15 Jun 2022 10:25:26 +0800 (CST) Received: from CQEXMAIL01.cqplus1.com (172.27.96.203) by CQEXMAIL01.cqplus1.com (172.27.96.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Wed, 15 Jun 2022 10:25:22 +0800 Received: from CQEXMAIL01.cqplus1.com ([::1]) by CQEXMAIL01.cqplus1.com ([::1]) with mapi id 15.01.2507.006; Wed, 15 Jun 2022 10:25:22 +0800 From: =?utf-8?B?cWluamlhblvopoPlgaVd?= To: 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" Subject: RE: [PATCH v18 05/10] clk: Add Sunplus SP7021 clock driver Thread-Topic: [PATCH v18 05/10] clk: Add Sunplus SP7021 clock driver Thread-Index: AQHYf8r5uo30wfgQ7kKLEgfDFgKMD61Ow22AgAD0FaA= Date: Wed, 15 Jun 2022 02:25:22 +0000 Message-ID: References: <42ed93cf0e5cfeaffdf50d63da558a3f1f6c1021.1655194858.git.qinjian@cqplus1.com> <20220614192555.86436C3411B@smtp.kernel.org> In-Reply-To: <20220614192555.86436C3411B@smtp.kernel.org> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.28.110.18] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220614_193234_687533_CD74B736 X-CRM114-Status: GOOD ( 16.26 ) 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 > > 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? Yes, I copy/paste from DT. Did I need changed it to 'GPL-2.0-only'? > > > +/* > > + * 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-provider.h: struct clk_hw *__devm_clk_hw_register_gate(struct device *dev, struct device_node *np, const char *name, const char *parent_name, const struct clk_hw *parent_hw, const struct clk_parent_data *parent_data, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock); #define devm_clk_hw_register_gate(dev, name, parent_name, flags, reg, bit_idx,\ clk_gate_flags, lock) \ __devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \ NULL, (flags), (reg), (bit_idx), \ (clk_gate_flags), (lock)) Should I use __devm_clk_hw_register_gate() with parent_data or devm_clk_hw_register_gate() with parent_name? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel