Re: [PATCH v14 4/9] soc: qcom: cpr: Move common functions to new file

From: Bjorn Andersson
Date: Tue Aug 29 2023 - 11:16:07 EST


On Mon, Aug 28, 2023 at 01:42:16PM +0200, Konrad Dybcio wrote:
> From: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxxx>
>

It seems reasonable to update the subject prefix, now that things have
moved to the genpd subsystem.

> In preparation for implementing a new driver that will be handling
> CPRv3, CPRv4 and CPR-Hardened, format out common functions to a new
> file.
>
> Update cpr_get_fuses in preparation for CPR3 implementation, change
> parameters where necessary to not take cpr.c private data structures.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxxx>
> [Konrad: rebase, apply review comments, improve msg, split]
> Tested-by: Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
> ---
> drivers/genpd/qcom/Makefile | 2 +-
> drivers/genpd/qcom/cpr-common.c | 350 ++++++++++++++++++++++++++++++++++++
> drivers/genpd/qcom/cpr-common.h | 103 +++++++++++
> drivers/genpd/qcom/cpr.c | 384 +++-------------------------------------
> 4 files changed, 475 insertions(+), 364 deletions(-)
>
> diff --git a/drivers/genpd/qcom/Makefile b/drivers/genpd/qcom/Makefile
> index 403dfc5af095..b28c8d9128c4 100644
> --- a/drivers/genpd/qcom/Makefile
> +++ b/drivers/genpd/qcom/Makefile
> @@ -1,4 +1,4 @@
> # SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_QCOM_CPR) += cpr.o
> +obj-$(CONFIG_QCOM_CPR) += cpr-common.o cpr.o

Is there a reason for this to be split in two drivers? Would it make
sense to rewrite this such that the result ends up as a single .ko?

Then you shouldn't need to EXPORT_SYMBOL between the two parts of the
same "driver".

Regards,
Bjorn