[PATCH linux-next] regulator: gpio: replace !strcmp with sysfs_streq
From: yexingchen116
Date: Sat Oct 08 2022 - 04:13:29 EST
From: ye xingchen <ye.xingchen@xxxxxxxxxx>
Replace the open-code with sysfs_streq().
Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
drivers/regulator/gpio-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 95e61a2f43f5..9a5d6047ad81 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -211,9 +211,9 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
config->type = REGULATOR_VOLTAGE;
ret = of_property_read_string(np, "regulator-type", ®type);
if (ret >= 0) {
- if (!strncmp("voltage", regtype, 7))
+ if (sysfs_streq(regtype, "voltage"))
config->type = REGULATOR_VOLTAGE;
- else if (!strncmp("current", regtype, 7))
+ else if (sysfs_streq(regtype, "current"))
config->type = REGULATOR_CURRENT;
else
dev_warn(dev, "Unknown regulator-type '%s'\n",
--
2.25.1