Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp669150rwd; Thu, 8 Jun 2023 06:18:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KOaXOofXan+oL0SFyyewhI6p+MEKPuHv4iDVIIjvyrS7xJc8ITq3jNl0RFqsNDrw5+adA X-Received: by 2002:a05:6a00:988:b0:645:834c:f521 with SMTP id u8-20020a056a00098800b00645834cf521mr2903714pfg.17.1686230302326; Thu, 08 Jun 2023 06:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686230302; cv=none; d=google.com; s=arc-20160816; b=SP1odkg/Sc8SUKjANgjXNhb5bjVeXVH4vcLO358LoDYW3BCKdiDOiVL7k5JeECXqfg B9yv94xISJkMZs1mwRiYy0ShqGbcd/NIrokkebJL1BinEuekHood9tcQETvJOSz4+tD4 0im+pCAqSvGgAyd9UfXU0TbPKpo8njQSBK3uYoZnClBn4tShSxXysXfsVLuLKlpd4jng /eH8/DD+/DfDbmpBXK5Y5IUiFHNsut7Fl+yOc5KmUnuy5gzGfx/UrHladTLi6BI6R6EN rrg+3hN4S/Zw7uzZQcxwo/ppfu7IafHm8q9MiXvm8F1zbXlnqggrwceV1dlVY13yErb9 XaRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=CMFHwMliziKYarDXsCrUtrbOwmn9xCAiYAb+3zNmljo=; b=DmXaX2ThW0EtKN6u2VNONXVUu9JV6TzC1qjqAUdHKdlNRWEoWIqWx4L+GUtGcSnLyW wX+ZKv2iRwDSCarLlkwJFfDOtey16eOJiVK35H8/hW/svispPGEZL6emtGvbuhUdKd4t nPQaGx3OCndyJDO8VKYlXlXp8TN5cHOp2SOpqc/Gshvwtp/ITx/BNdmVTBdCX9WXRjmQ HsTSzTzK0aSg95A24IrDo+hx6QZ8KcJJNlgLrRt4OuLBZrE6FCylrbX74yJZ+BQwdTRJ eMeUuoIIskfGj+Mzu3/x6KMVd56k+LBK33ObzWMdKFAxvPOFLXykAfAsYLzhB4fI4Eqt j9nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=hKJREq3J; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020a056a00001a00b00653fb3f21d3si770410pfk.373.2023.06.08.06.18.07; Thu, 08 Jun 2023 06:18:22 -0700 (PDT) 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=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=hKJREq3J; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236429AbjFHMqo (ORCPT + 99 others); Thu, 8 Jun 2023 08:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236395AbjFHMqn (ORCPT ); Thu, 8 Jun 2023 08:46:43 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4287426B3 for ; Thu, 8 Jun 2023 05:46:41 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f6e4554453so3587105e9.3 for ; Thu, 08 Jun 2023 05:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1686228399; x=1688820399; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=CMFHwMliziKYarDXsCrUtrbOwmn9xCAiYAb+3zNmljo=; b=hKJREq3JfLY/XsiQipzbIVCN0ANM2uldq8v1iswOfxOQ1UOLdudpFOoIBEqPbzDw/7 3kB6B26Pyeq06ScIC7tYlmxaoZgp7yKpI/PhZ7OkjdIyZHFK/Rt3P7lwzH6ai3LIyjE4 /OyLMfxI4ChC54k7vZRCfhiAh+5AsASPT2VYBxbzYWycgyGsvi5w6zYMxaN7Nxtnaj+M 73BNJXbKYDFzoAAa7rERJinbBJcV08YGYQQ/ATjpGfVFguMprhGS5fYNT49n/4IU/rhw vbhAaMr4MsQgaiEZPZ5sB8av1WOF3jyqsele+sagaiZ+vdWvj+AvxeeniI1r4Q2ya0ZY Ee2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686228399; x=1688820399; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CMFHwMliziKYarDXsCrUtrbOwmn9xCAiYAb+3zNmljo=; b=O3TDpmnDZ67yRolmVVRcPYisti4qYUyhM6tX/8HL54Iua/r6t0p0FNjyk1x9FQyZSl 4ZsAxZBXGVpifKZ8EqKgO3PWX80rnSAT1h+mBdcq3+63wETb6t6ZnXEKveXvAcljlTLr idIQf9xkJh29QPjITzJTmWaY32/+B+gBuNp3qwEb3oDukItqcGhW7sKzM31A+DaHtJLj oB9DzTpJQUVcxNVMAzJz6ApN8DlrIgEmNsRrLmBqIIHzi7mkjvzTeU2H90mm/YZgRYKQ 5Uj4h1QS8E0tkTRGzxd+Kf1R1EaDKSW37wuRPYwgAAg3xu1IN2bkVCNK67vDN6e6zUSk CjcA== X-Gm-Message-State: AC+VfDxE5dATfjw33XZYDln2kk50KrB2Xoij4xOkcOOlsmnaRQF7Io0A oiONjmJfTpib5d7XFX+KFQtxYA== X-Received: by 2002:a1c:750a:0:b0:3f7:35a9:dfde with SMTP id o10-20020a1c750a000000b003f735a9dfdemr1352995wmc.30.1686228399673; Thu, 08 Jun 2023 05:46:39 -0700 (PDT) Received: from localhost (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o7-20020adfeac7000000b002fed865c55esm1521722wrn.56.2023.06.08.05.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 05:46:39 -0700 (PDT) References: <20230607-topic-amlogic-upstream-clkid-public-migration-v1-0-9676afa6b22c@linaro.org> <20230607-topic-amlogic-upstream-clkid-public-migration-v1-3-9676afa6b22c@linaro.org> User-agent: mu4e 1.8.13; emacs 28.2 From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 03/18] clk: meson: migrate a1 clock drivers out of hw_onecell_data to drop NR_CLKS Date: Thu, 08 Jun 2023 14:45:29 +0200 In-reply-to: <20230607-topic-amlogic-upstream-clkid-public-migration-v1-3-9676afa6b22c@linaro.org> Message-ID: <1jlegu9l5d.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org > > +struct meson_a1_pll_clks { > + struct clk_hw **hw_clks; > + unsigned int hw_clk_num; > +}; > + > +static struct meson_a1_pll_clks a1_pll_clks = { > + .hw_clks = a1_pll_hw_clks, > + .hw_clk_num = ARRAY_SIZE(a1_pll_hw_clks), > +}; > + > +static struct clk_hw *meson_a1_pll_hw_get(struct of_phandle_args *clkspec, void *clk_data) > +{ > + const struct meson_a1_pll_clks *data = clk_data; > + unsigned int idx = clkspec->args[0]; > + > + if (idx >= data->hw_clk_num) { > + pr_err("%s: invalid index %u\n", __func__, idx); > + return ERR_PTR(-EINVAL); > + } > + > + return data->hw_clks[idx]; > +} I'd prefer to have a single struct type and and single custom callback for the different SoC please.