Subject: Re: [PATCH v2 3/4] cpuidle: psci: Split psci_dt_cpu_init_idle()

From: Sudeep Holla <[email-masked]>
Date: Wed, 4 Mar 2020 12:12:51 +0000

On Tue, Mar 03, 2020 at 09:35:58PM +0100, Ulf Hansson wrote:
> To make the code a bit more readable, but also to prepare some code to be
> re-used, let's move the OSI specific initialization out of the
> psci_dt_cpu_init_idle() and into a separate function.
>
> Fixes: a65a397f2451 ("cpuidle: psci: Add support for PM domains by using genpd")

Not sure if this fixes anything but I am fine to have this if next one is
a real fix.

> Signed-off-by: Ulf Hansson <[email-masked]>
> ---
>
> Changes in v2:
> 	- Adopted suggestions from Stephen to use IS_ERR_OR_NULL and
> 	PTR_ERR_OR_ZERO, which further clarified the code.
>
> ---
>  drivers/cpuidle/cpuidle-psci.c | 46 ++++++++++++++++++++--------------
>  1 file changed, 27 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c
> index edd7a54ef0d3..bae9140a65a5 100644
> --- a/drivers/cpuidle/cpuidle-psci.c
> +++ b/drivers/cpuidle/cpuidle-psci.c
> @@ -160,6 +160,29 @@ int __init psci_dt_parse_state_node(struct device_node *np, u32 *state)
>  	return 0;
>  }
>
> +static int __init psci_dt_cpu_init_topology(struct cpuidle_driver *drv,
> +					    struct psci_cpuidle_data *data,
> +					    unsigned int state_count, int cpu)
> +{
> +	/* Currently limit the hierarchical topology to be used in OSI mode. */
> +	if (!psci_has_osi_support())
> +		return 0;
> +
> +	data->dev = psci_dt_attach_cpu(cpu);
> +	if (IS_ERR_OR_NULL(data->dev))
> +		return PTR_ERR_OR_ZERO(data->dev);
> +

This is what I was asking to do before this was merged when I meant to drop
if(data->dev) check. So happy to see it :)

Reviewed-by: Sudeep Holla <[email-masked]>

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel