Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20250606090802.597504-1-lukas.bulwahn@redhat.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Lukas Bulwahn and committed by
Ulf Hansson
152d59f1 7920de37

+3 -9
+3 -9
drivers/pmdomain/arm/scmi_pm_domain.c
··· 22 22 23 23 #define to_scmi_pd(gpd) container_of(gpd, struct scmi_pm_domain, genpd) 24 24 25 - static int scmi_pd_power(struct generic_pm_domain *domain, bool power_on) 25 + static int scmi_pd_power(struct generic_pm_domain *domain, u32 state) 26 26 { 27 - u32 state; 28 27 struct scmi_pm_domain *pd = to_scmi_pd(domain); 29 - 30 - if (power_on) 31 - state = SCMI_POWER_STATE_GENERIC_ON; 32 - else 33 - state = SCMI_POWER_STATE_GENERIC_OFF; 34 28 35 29 return power_ops->state_set(pd->ph, pd->domain, state); 36 30 } 37 31 38 32 static int scmi_pd_power_on(struct generic_pm_domain *domain) 39 33 { 40 - return scmi_pd_power(domain, true); 34 + return scmi_pd_power(domain, SCMI_POWER_STATE_GENERIC_ON); 41 35 } 42 36 43 37 static int scmi_pd_power_off(struct generic_pm_domain *domain) 44 38 { 45 - return scmi_pd_power(domain, false); 39 + return scmi_pd_power(domain, SCMI_POWER_STATE_GENERIC_OFF); 46 40 } 47 41 48 42 static int scmi_pm_domain_probe(struct scmi_device *sdev)