summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-08-20 12:27:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-06 15:59:46 +0200
commit2828c318b3c124a370e2e8844a927734b8b49faf (patch)
tree3ebc59178961cfda9f095673d6dbd2f44fd7a7d2
parentd8959245329917f93a6345fd6eef828c646600fb (diff)
misc: ad525x_dpot: Use str_enabled_disabled() in sysfs_show_reg()
Remove hard-coded strings by using the str_enabled_disabled() helper function and silence the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_enabled_disabled(..) Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250820102734.760844-2-thorsten.blum@linux.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/ad525x_dpot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 756ef6912b5a..04683b981e54 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -73,6 +73,7 @@
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include "ad525x_dpot.h"
@@ -418,10 +419,8 @@ static ssize_t sysfs_show_reg(struct device *dev,
s32 value;
if (reg & DPOT_ADDR_OTP_EN)
- return sprintf(buf, "%s\n",
- test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask) ?
- "enabled" : "disabled");
-
+ return sprintf(buf, "%s\n", str_enabled_disabled(
+ test_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask)));
mutex_lock(&data->update_lock);
value = dpot_read(data, reg);