diff options
author | 2025-01-14 20:06:12 +0100 | |
---|---|---|
committer | 2025-01-15 12:27:04 -0800 | |
commit | ab9f0d04ffa9af09a8b0f44940df47c581f1cd00 (patch) | |
tree | 8c20ee808bf4ab84cea95aa5bafe617387a9f7ff /drivers/clk/bcm/clk-kona.c | |
parent | clk: clk-loongson2: Switch to use devm_clk_hw_register_fixed_rate_parent_data() (diff) | |
download | wireguard-linux-ab9f0d04ffa9af09a8b0f44940df47c581f1cd00.tar.xz wireguard-linux-ab9f0d04ffa9af09a8b0f44940df47c581f1cd00.zip |
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>
Diffstat (limited to 'drivers/clk/bcm/clk-kona.c')
-rw-r--r-- | drivers/clk/bcm/clk-kona.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c index ec5749e301ba..2b0ea882f1e4 100644 --- a/drivers/clk/bcm/clk-kona.c +++ b/drivers/clk/bcm/clk-kona.c @@ -10,6 +10,7 @@ #include <linux/io.h> #include <linux/kernel.h> #include <linux/clk-provider.h> +#include <linux/string_choices.h> /* * "Policies" affect the frequencies of bus clocks provided by a @@ -502,7 +503,7 @@ static int clk_gate(struct ccu_data *ccu, const char *name, return 0; pr_err("%s: failed to %s gate for %s\n", __func__, - enable ? "enable" : "disable", name); + str_enable_disable(enable), name); return -EIO; } |