@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
+#include <linux/string_choices.h>
#include "rcar-gen4-sysc.h"
@@ -171,7 +172,7 @@ static int rcar_gen4_sysc_power(u8 pdr, bool on)
out:
spin_unlock_irqrestore(&rcar_gen4_sysc_lock, flags);
- pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off",
+ pr_debug("sysc power %s domain %d: %08x -> %d\n", str_on_off(on),
pdr, ioread32(rcar_gen4_sysc_base + SYSCISCR(reg_idx)), ret);
return ret;
}
@@ -17,6 +17,7 @@
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/soc/renesas/rcar-sysc.h>
+#include <linux/string_choices.h>
#include "rcar-sysc.h"
@@ -162,7 +163,7 @@ static int rcar_sysc_power(const struct rcar_sysc_pd *pd, bool on)
spin_unlock_irqrestore(&rcar_sysc_lock, flags);
- pr_debug("sysc power %s domain %d: %08x -> %d\n", on ? "on" : "off",
+ pr_debug("sysc power %s domain %d: %08x -> %d\n", str_on_off(on),
pd->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret);
return ret;
}
@@ -21,6 +21,7 @@
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/mfd/syscon.h>
+#include <linux/string_choices.h>
#include <soc/rockchip/pm_domains.h>
#include <soc/rockchip/rockchip_sip.h>
#include <dt-bindings/power/px30-power.h>
@@ -595,7 +596,7 @@ static int rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
is_on == on, 0, 10000);
if (ret) {
dev_err(pmu->dev, "failed to set domain '%s' %s, val=%d\n",
- genpd->name, on ? "on" : "off", is_on);
+ genpd->name, str_on_off(on), is_on);
return ret;
}
@@ -13,6 +13,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of.h>
@@ -38,7 +39,6 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
struct exynos_pm_domain *pd;
void __iomem *base;
u32 timeout, pwr;
- char *op;
pd = container_of(domain, struct exynos_pm_domain, pd);
base = pd->base;
@@ -51,8 +51,8 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
while ((readl_relaxed(base + 0x4) & pd->local_pwr_cfg) != pwr) {
if (!timeout) {
- op = (power_on) ? "enable" : "disable";
- pr_err("Power domain %s %s failed\n", domain->name, op);
+ pr_err("Power domain %s %s failed\n", domain->name,
+ str_enable_disable(power_on));
return -ETIMEDOUT;
}
timeout--;
@@ -12,6 +12,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
+#include <linux/string_choices.h>
#include <dt-bindings/power/starfive,jh7110-pmu.h>
/* register offset */
@@ -155,7 +156,7 @@ static int jh7110_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on)
if (ret) {
dev_err(pmu->dev, "%s: failed to power %s\n",
- pmd->genpd.name, on ? "on" : "off");
+ pmd->genpd.name, str_on_off(on));
return -ETIMEDOUT;
}
@@ -198,7 +199,7 @@ static int jh71xx_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on)
if (is_on == on) {
dev_dbg(pmu->dev, "pm domain [%s] is already %sable status.\n",
- pmd->genpd.name, on ? "en" : "dis");
+ pmd->genpd.name, str_enable_disable(on));
return 0;
}