Commit 152d59f1 authored by Lukas Bulwahn's avatar Lukas Bulwahn Committed by Ulf Hansson
Browse files

pmdomain: arm: scmi_pm_domain: remove code clutter



There is no need to introduce the boolean power_on to select the constant
value for state. Simply pass the value for state as argument. Just remove
this code clutter.

No functional change.

Signed-off-by: default avatarLukas Bulwahn <lukas.bulwahn@redhat.com>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20250606090802.597504-1-lukas.bulwahn@redhat.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 7920de37
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -22,27 +22,21 @@ struct scmi_pm_domain {

#define to_scmi_pd(gpd) container_of(gpd, struct scmi_pm_domain, genpd)

static int scmi_pd_power(struct generic_pm_domain *domain, bool power_on)
static int scmi_pd_power(struct generic_pm_domain *domain, u32 state)
{
	u32 state;
	struct scmi_pm_domain *pd = to_scmi_pd(domain);

	if (power_on)
		state = SCMI_POWER_STATE_GENERIC_ON;
	else
		state = SCMI_POWER_STATE_GENERIC_OFF;

	return power_ops->state_set(pd->ph, pd->domain, state);
}

static int scmi_pd_power_on(struct generic_pm_domain *domain)
{
	return scmi_pd_power(domain, true);
	return scmi_pd_power(domain, SCMI_POWER_STATE_GENERIC_ON);
}

static int scmi_pd_power_off(struct generic_pm_domain *domain)
{
	return scmi_pd_power(domain, false);
	return scmi_pd_power(domain, SCMI_POWER_STATE_GENERIC_OFF);
}

static int scmi_pm_domain_probe(struct scmi_device *sdev)