2022-10-08 09:37:03

by ye xingchen

[permalink] [raw]
Subject: [PATCH linux-next] regulator: gpio: replace !strcmp with sysfs_streq

From: ye xingchen <[email protected]>

Replace the open-code with sysfs_streq().

Signed-off-by: ye xingchen <[email protected]>
---
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", &regtype);
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