Re: [PATCH v1 5/7] soc: starfive: Use call back to parse device tree resources
From: Walker Chen
Date: Wed Apr 12 2023 - 02:08:04 EST
On 2023/4/11 14:47, Changhuang Liang wrote:
> Different compatible parse device tree resources work in different ways.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
I don't think it's necessary to submit multiple patches separately for the same .c file
unless it is very necessary. Because the disadvantage of separating multiple patches
is that some information lacks completeness and coherence.
> ---
> drivers/soc/starfive/jh71xx_pmu.c | 54 ++++++++++++++++++++++---------
> 1 file changed, 39 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/soc/starfive/jh71xx_pmu.c b/drivers/soc/starfive/jh71xx_pmu.c
> index 98f6849d61de..990db6735c48 100644
> --- a/drivers/soc/starfive/jh71xx_pmu.c
> +++ b/drivers/soc/starfive/jh71xx_pmu.c
> @@ -57,10 +57,14 @@ struct jh71xx_domain_info {
> u8 bit;
> };
>
> +struct jh71xx_pmu;
> +
> struct jh71xx_pmu_match_data {
> const struct jh71xx_domain_info *domain_info;
> int num_domains;
> u8 pmu_type;
> + int (*pmu_parse_dt)(struct platform_device *pdev,
> + struct jh71xx_pmu *pmu);
> };
>
> struct jh71xx_pmu {
> @@ -251,6 +255,31 @@ static irqreturn_t jh71xx_pmu_interrupt(int irq, void *data)
> return IRQ_HANDLED;
> }
>
> +static int jh7110_pmu_general_parse_dt(struct platform_device *pdev,
> + struct jh71xx_pmu *pmu)
> +{