Skip to contentSkip to conversation

regulator: gpio: replace !strcmp with sysfs_streq

PATCH New [email protected] 1 participant 1 message Oct 8, 2022 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: gpio: replace !strcmp with sysfs_streq

From: ye xingchen <[email protected]>

Replace the open-code with sysfs_streq().

---
 drivers/regulator/gpio-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/gpio-regulator.c +2 -2
index 95e61a2f43f5..9a5d6047ad81 100644
@@ -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",
Signature · 1 line
2.25.1