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