mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard GENOUD <richard.genoud@posteo.net>
To: Jisheng Zhang <jszhang@kernel.org>, Rob Herring <robh@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Linus Walleij <linusw@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v3 03/13] pinctrl: berlin: enable module build support
Date: Thu, 03 Dec 2026 10:32:25 +0000	[thread overview]
Message-ID: <9647c127-392e-46e0-87b5-502e05c61e58@posteo.net> (raw)
In-Reply-To: <20261130170352.12853-4-jszhang@kernel.org>

Hi Jisheng,

Le 30/11/2026 à 18:03, Jisheng Zhang a écrit :
> For Android GKI + vendor_dlkm deployments, where vendor-specific
> drivers must be kept separate from the GKI vmlinux and loaded as
> modules from the vendor partition, we need to enable module build
> support for berlin pinctrl drivers.
> 
> To acchive this goal:
> 
> 1.Use devm_* APIs to alloc memory, so that we don't need to care free when
> unloading.
> 
> 2.Export two symbols which will be used by SoC pinctrl drivers.
> 
> 3.Add MODULE_LICENSE and MODULE_DESCRIPTION
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>   drivers/pinctrl/berlin/berlin.c | 27 ++++++++++++++-------------
>   drivers/pinctrl/berlin/berlin.h | 15 +++++++++++++++
>   2 files changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index 8a612ce2d1d3..a0ae75b1d705 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -215,7 +215,8 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
>   	}
>   
>   	/* we will reallocate later */
> -	pctrl->functions = kzalloc_objs(*pctrl->functions, max_functions);
> +	pctrl->functions = devm_kcalloc(&pdev->dev, max_functions,
> +					sizeof(*pctrl->functions), GFP_KERNEL);
>   	if (!pctrl->functions)
>   		return -ENOMEM;
>   
> @@ -230,13 +231,11 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
>   		}
>   	}
>   
> -	new_functions = krealloc(pctrl->functions,
> -				    pctrl->nfunctions * sizeof(*pctrl->functions),
> -				    GFP_KERNEL);
> -	if (!new_functions) {
> -		kfree(pctrl->functions);
> +	new_functions = devm_krealloc(&pdev->dev, pctrl->functions,
> +				      pctrl->nfunctions * sizeof(*pctrl->functions),
> +				      GFP_KERNEL);
> +	if (!new_functions)
>   		return -ENOMEM;
> -	}
>   
>   	pctrl->functions = new_functions;
>   	/* map functions to theirs groups */
> @@ -257,20 +256,17 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
>   				function++;
>   			}
>   
> -			if (!found) {
> -				kfree(pctrl->functions);
> +			if (!found)
>   				return -EINVAL;
> -			}
>   
>   			if (!function->groups) {
>   				function->groups =
>   					devm_kzalloc_objs(&pdev->dev,
>   							  *function->groups,
>   							  function->ngroups);
> -				if (!function->groups) {
> -					kfree(pctrl->functions);
> +
> +				if (!function->groups)
>   					return -ENOMEM;
> -				}
>   			}
>   
>   			groups = (const char **)function->groups;
> @@ -326,6 +322,7 @@ int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
>   
>   	return 0;
>   }
> +EXPORT_SYMBOL_GPL(berlin_pinctrl_probe_regmap);
>   
>   int berlin_pinctrl_probe(struct platform_device *pdev,
>   			 const struct berlin_pinctrl_desc *desc)
> @@ -340,3 +337,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
>   
>   	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
>   }
> +EXPORT_SYMBOL_GPL(berlin_pinctrl_probe);
> +
> +MODULE_LICENSE("GPL v2");

checkpatch reports that GPL should be used over "GPL v2"
cf commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL 
v2" bogosity")


> +MODULE_DESCRIPTION("pinctrl library for Synaptics SoCs");
> diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
> index 7e7096842eda..8ff70d682593 100644
> --- a/drivers/pinctrl/berlin/berlin.h
> +++ b/drivers/pinctrl/berlin/berlin.h
> @@ -20,6 +20,8 @@ struct berlin_desc_group {
>   	u16				offset;
>   	u8				bit_width;
>   	u8				lsb;
> +	u16				conf_offset;
> +	u8				conf_bits;
>   	struct berlin_desc_function	*functions;
>   };
>   
> @@ -28,6 +30,19 @@ struct berlin_pinctrl_desc {
>   	unsigned			ngroups;
>   };
>   
> +#define BERLIN_PINCTRLCONF_GROUP(_name, _offset, _width, _lsb,		\
> +		_conf_offset, _conf_bits, ...)				\
> +	{								\
> +		.name = _name,						\
> +		.offset = _offset,					\
> +		.bit_width = _width,					\
> +		.lsb = _lsb,						\
> +		.conf_offset = _conf_offset,				\
> +		.conf_bits = _conf_bits,				\
> +		.functions = (struct berlin_desc_function[]){		\
> +			__VA_ARGS__, { } },				\
> +	}
> +
>   #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...)		\
>   	{								\
>   		.name = _name,						\


  reply	other threads:[~2026-12-03 10:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 17:03 [PATCH v3 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 02/13] pinctrl: berlin: use u16 instead of u8 for the offset Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
2026-12-03 10:32   ` Richard GENOUD [this message]
2026-11-30 17:03 ` [PATCH v3 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 06/13] soc: synaptics: add SL2610 system controller support Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
2026-12-03 10:29   ` Richard GENOUD
2026-12-03 10:57     ` Jisheng Zhang
2026-12-03 15:11       ` Philipp Zabel
2026-12-03 15:12   ` Philipp Zabel
2026-11-30 17:03 ` [PATCH v3 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
2026-11-30 17:03 ` [PATCH v3 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
2026-12-02 14:20 ` [PATCH v3 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Richard GENOUD

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=9647c127-392e-46e0-87b5-502e05c61e58@posteo.net \
    --to=richard.genoud@posteo.net \
    --cc=bmasney+clk@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=will@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®