clk: Use str_enable_disable-like helpers

Replace ternary (condition ? "enable" : "disable") syntax with helpers
from string_choices.h because:
1. Simple function call with one argument is easier to read. Ternary
operator has three arguments and with wrapping might lead to quite
long code.
2. Is slightly shorter thus also easier to read.
3. It brings uniformity in the text - same string.
4. Allows deduping by the linker, which results in a smaller binary
file.

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250114190612.846696-1-krzysztof.kozlowski@linaro.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by Krzysztof Kozlowski and committed by Stephen Boyd ab9f0d04 54e020bd

+9 -6
+2 -1
drivers/clk/bcm/clk-kona.c
··· 10 #include <linux/io.h> 11 #include <linux/kernel.h> 12 #include <linux/clk-provider.h> 13 14 /* 15 * "Policies" affect the frequencies of bus clocks provided by a ··· 503 return 0; 504 505 pr_err("%s: failed to %s gate for %s\n", __func__, 506 - enable ? "enable" : "disable", name); 507 508 return -EIO; 509 }
··· 10 #include <linux/io.h> 11 #include <linux/kernel.h> 12 #include <linux/clk-provider.h> 13 + #include <linux/string_choices.h> 14 15 /* 16 * "Policies" affect the frequencies of bus clocks provided by a ··· 502 return 0; 503 504 pr_err("%s: failed to %s gate for %s\n", __func__, 505 + str_enable_disable(enable), name); 506 507 return -EIO; 508 }
+3 -2
drivers/clk/clk-nomadik.c
··· 17 #include <linux/debugfs.h> 18 #include <linux/seq_file.h> 19 #include <linux/spinlock.h> 20 #include <linux/reboot.h> 21 22 /* ··· 117 118 val = readl(src_base + SRC_XTALCR); 119 pr_info("SXTALO is %s\n", 120 - (val & SRC_XTALCR_SXTALDIS) ? "disabled" : "enabled"); 121 pr_info("MXTAL is %s\n", 122 - (val & SRC_XTALCR_MXTALSTAT) ? "enabled" : "disabled"); 123 if (of_property_read_bool(np, "disable-sxtalo")) { 124 /* The machine uses an external oscillator circuit */ 125 val |= SRC_XTALCR_SXTALDIS;
··· 17 #include <linux/debugfs.h> 18 #include <linux/seq_file.h> 19 #include <linux/spinlock.h> 20 + #include <linux/string_choices.h> 21 #include <linux/reboot.h> 22 23 /* ··· 116 117 val = readl(src_base + SRC_XTALCR); 118 pr_info("SXTALO is %s\n", 119 + str_disabled_enabled(val & SRC_XTALCR_SXTALDIS)); 120 pr_info("MXTAL is %s\n", 121 + str_enabled_disabled(val & SRC_XTALCR_MXTALSTAT)); 122 if (of_property_read_bool(np, "disable-sxtalo")) { 123 /* The machine uses an external oscillator circuit */ 124 val |= SRC_XTALCR_SXTALDIS;
+2 -2
drivers/clk/clk-xgene.c
··· 7 */ 8 #include <linux/module.h> 9 #include <linux/spinlock.h> 10 #include <linux/io.h> 11 #include <linux/of.h> 12 #include <linux/clkdev.h> ··· 521 data = xgene_clk_read(pclk->param.csr_reg + 522 pclk->param.reg_clk_offset); 523 pr_debug("%s clock is %s\n", clk_hw_get_name(hw), 524 - data & pclk->param.reg_clk_mask ? "enabled" : 525 - "disabled"); 526 } else { 527 return 1; 528 }
··· 7 */ 8 #include <linux/module.h> 9 #include <linux/spinlock.h> 10 + #include <linux/string_choices.h> 11 #include <linux/io.h> 12 #include <linux/of.h> 13 #include <linux/clkdev.h> ··· 520 data = xgene_clk_read(pclk->param.csr_reg + 521 pclk->param.reg_clk_offset); 522 pr_debug("%s clock is %s\n", clk_hw_get_name(hw), 523 + str_enabled_disabled(data & pclk->param.reg_clk_mask)); 524 } else { 525 return 1; 526 }
+2 -1
drivers/clk/qcom/clk-rpmh.c
··· 9 #include <linux/module.h> 10 #include <linux/of.h> 11 #include <linux/platform_device.h> 12 #include <soc/qcom/cmd-db.h> 13 #include <soc/qcom/rpmh.h> 14 #include <soc/qcom/tcs.h> ··· 207 c->state = c->valid_state_mask; 208 209 WARN(1, "clk: %s failed to %s\n", c->res_name, 210 - enable ? "enable" : "disable"); 211 return ret; 212 } 213
··· 9 #include <linux/module.h> 10 #include <linux/of.h> 11 #include <linux/platform_device.h> 12 + #include <linux/string_choices.h> 13 #include <soc/qcom/cmd-db.h> 14 #include <soc/qcom/rpmh.h> 15 #include <soc/qcom/tcs.h> ··· 206 c->state = c->valid_state_mask; 207 208 WARN(1, "clk: %s failed to %s\n", c->res_name, 209 + str_enable_disable(enable)); 210 return ret; 211 } 212