mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
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 v2 01/19] clk: meson: introduce meson-clkc-utils
Date: Wed, 12 Jul 2023 14:03:19 +0200	[thread overview]
Message-ID: <1ja5w1xrly.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20230607-topic-amlogic-upstream-clkid-public-migration-v2-1-38172d17c27a@linaro.org>


On Mon 12 Jun 2023 at 11:57, Neil Armstrong <neil.armstrong@linaro.org> wrote:

> Let's introduce a new module called meson-clkc-utils that
> will contain shared utility functions for all Amlogic clock
> controller drivers.
>
> The first utility function is a replacement of of_clk_hw_onecell_get
> in order to get rid of the NR_CLKS define in all Amlogic clock
> drivers.
>
> The goal is to move all duplicate probe and init code in this module.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

Hi Neil,

checkpatch complains about the MODULE_LICENSE()

WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")
#185: FILE: drivers/clk/meson/meson-clkc-utils.c:25:
+MODULE_LICENSE("GPL v2");

I don't mind fixing this up while applying if it is Ok with you.

> ---
>  drivers/clk/meson/Kconfig            |  3 +++
>  drivers/clk/meson/Makefile           |  1 +
>  drivers/clk/meson/meson-clkc-utils.c | 25 +++++++++++++++++++++++++
>  drivers/clk/meson/meson-clkc-utils.h | 19 +++++++++++++++++++
>  4 files changed, 48 insertions(+)
>
> diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig
> index 8ce846fdbe43..d03adad31318 100644
> --- a/drivers/clk/meson/Kconfig
> +++ b/drivers/clk/meson/Kconfig
> @@ -30,6 +30,9 @@ config COMMON_CLK_MESON_VID_PLL_DIV
>  	tristate
>  	select COMMON_CLK_MESON_REGMAP
>  
> +config COMMON_CLK_MESON_CLKC_UTILS
> +	tristate
> +
>  config COMMON_CLK_MESON_AO_CLKC
>  	tristate
>  	select COMMON_CLK_MESON_REGMAP
> diff --git a/drivers/clk/meson/Makefile b/drivers/clk/meson/Makefile
> index d5288662881d..cd961cc4f4db 100644
> --- a/drivers/clk/meson/Makefile
> +++ b/drivers/clk/meson/Makefile
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  # Amlogic clock drivers
>  
> +obj-$(CONFIG_COMMON_CLK_MESON_CLKC_UTILS) += meson-clkc-utils.o
>  obj-$(CONFIG_COMMON_CLK_MESON_AO_CLKC) += meson-aoclk.o
>  obj-$(CONFIG_COMMON_CLK_MESON_CPU_DYNDIV) += clk-cpu-dyndiv.o
>  obj-$(CONFIG_COMMON_CLK_MESON_DUALDIV) += clk-dualdiv.o
> diff --git a/drivers/clk/meson/meson-clkc-utils.c b/drivers/clk/meson/meson-clkc-utils.c
> new file mode 100644
> index 000000000000..9a0620bcc161
> --- /dev/null
> +++ b/drivers/clk/meson/meson-clkc-utils.c
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
> + */
> +
> +#include <linux/of_device.h>
> +#include <linux/clk-provider.h>
> +#include <linux/module.h>
> +#include "meson-clkc-utils.h"
> +
> +struct clk_hw *meson_clk_hw_get(struct of_phandle_args *clkspec, void *clk_hw_data)
> +{
> +	const struct meson_clk_hw_data *data = clk_hw_data;
> +	unsigned int idx = clkspec->args[0];
> +
> +	if (idx >= data->num) {
> +		pr_err("%s: invalid index %u\n", __func__, idx);
> +		return ERR_PTR(-EINVAL);
> +	}
> +
> +	return data->hws[idx];
> +}
> +EXPORT_SYMBOL_GPL(meson_clk_hw_get);
> +
> +MODULE_LICENSE("GPL v2");
> diff --git a/drivers/clk/meson/meson-clkc-utils.h b/drivers/clk/meson/meson-clkc-utils.h
> new file mode 100644
> index 000000000000..fe6f40728949
> --- /dev/null
> +++ b/drivers/clk/meson/meson-clkc-utils.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
> +/*
> + * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
> + */
> +
> +#ifndef __MESON_CLKC_UTILS_H__
> +#define __MESON_CLKC_UTILS_H__
> +
> +#include <linux/of_device.h>
> +#include <linux/clk-provider.h>
> +
> +struct meson_clk_hw_data {
> +	struct clk_hw	**hws;
> +	unsigned int	num;
> +};
> +
> +struct clk_hw *meson_clk_hw_get(struct of_phandle_args *clkspec, void *clk_hw_data);
> +
> +#endif


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2023-07-12 12:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  9:57 [PATCH v2 00/19] clk: meson: move all private clk IDs to public dt-bindings headers Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 01/19] clk: meson: introduce meson-clkc-utils Neil Armstrong
2023-07-12 12:03   ` Jerome Brunet [this message]
2023-07-17 12:21     ` Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 02/19] clk: meson: migrate meson-eeclk out of hw_onecell_data to drop NR_CLKS Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 03/19] clk: meson: migrate meson-aoclk " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 04/19] clk: meson: migrate a1 clock drivers " Neil Armstrong
2023-06-22 13:07   ` Dmitry Rokosov
2023-06-22 14:00   ` Dmitry Rokosov
2023-06-12  9:57 ` [PATCH v2 05/19] clk: meson: migrate meson8b " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 06/19] clk: meson: migrate axg-audio " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 07/19] dt-bindings: clk: gxbb-clkc: expose all clock ids Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 08/19] dt-bindings: clk: axg-clkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 09/19] dt-bindings: clk: g12a-clks: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 10/19] dt-bindings: clk: g12a-aoclkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 11/19] dt-bindings: clk: meson8b-clkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 12/19] dt-bindings: clk: amlogic,a1-peripherals-clkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 13/19] dt-bindings: clk: amlogic,a1-pll-clkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 14/19] dt-bindings: clk: axg-audio-clkc: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 15/19] clk: meson: aoclk: move bindings include to main driver Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 16/19] clk: meson: eeclk: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 17/19] clk: meson: a1: " Neil Armstrong
2023-06-22 13:02   ` Dmitry Rokosov
2023-06-12  9:57 ` [PATCH v2 18/19] clk: meson: meson8b: " Neil Armstrong
2023-06-12  9:57 ` [PATCH v2 19/19] clk: meson: axg-audio: " Neil Armstrong
2023-07-20  9:31 ` [PATCH v2 00/19] clk: meson: move all private clk IDs to public dt-bindings headers Jerome Brunet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ja5w1xrly.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®