Skip to contentSkip to conversation

gpio: sim: delimit the fwnode name with a ":" when generating labels

PATCH In review Bartosz Golaszewski 2 participants 3 messages Feb 20, 2024 – Feb 23, 2024 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: sim: delimit the fwnode name with a ":" when generating labels

From: Bartosz Golaszewski <[email protected]>

Typically, whenever a human-readable name is created for objects using a software node, its name is delimited with ":" as dashes are often used in other parts of the name. Make gpio-sim use the same pattern. This results in better looking default names:

gpio-sim.0:node0
gpio-sim.0:node1
gpio-sim.1:node0

---
 drivers/gpio/gpio-sim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-sim.c +2 -2
index c4106e37e6db..1f3dd95dd6da 100644
@@ -420,7 +420,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
 
 	ret = fwnode_property_read_string(swnode, "gpio-sim,label", &label);
 	if (ret) {
-		label = devm_kasprintf(dev, GFP_KERNEL, "%s-%pfwP",
+		label = devm_kasprintf(dev, GFP_KERNEL, "%s:%pfwP",
 				       dev_name(dev), swnode);
 		if (!label)
 			return -ENOMEM;
@@ -833,7 +833,7 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev)
 							  GFP_KERNEL);
 			else
 				hog->chip_label = kasprintf(GFP_KERNEL,
-							"gpio-sim.%u-%pfwP",
+							"gpio-sim.%u:%pfwP",
 							dev->id,
 							bank->swnode);
 			if (!hog->chip_label) {
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Typically, whenever a human-readable name is created for objects using a software node, its name is delimited with ":" as dashes are often used in other parts of the name. Make gpio-sim use the same pattern. This results in better looking default names:

Quoted 5 lines

gpio-sim.0:node0
gpio-sim.0:node1
gpio-sim.1:node0

LGTM

I guess it could affect some tests?

Yours,
Linus Walleij

#2 lore raw
In reply to Bartosz Golaszewski
Quoted 40 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Typically, whenever a human-readable name is created for objects using a software node, its name is delimited with ":" as dashes are often used in other parts of the name. Make gpio-sim use the same pattern. This results in better looking default names:

gpio-sim.0:node0
gpio-sim.0:node1
gpio-sim.1:node0

---
 drivers/gpio/gpio-sim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-sim.c +2 -3
index c4106e37e6db..1f3dd95dd6da 100644
@@ -420,7 +420,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
 
        ret = fwnode_property_read_string(swnode, "gpio-sim,label", &label);
        if (ret) {
-               label = devm_kasprintf(dev, GFP_KERNEL, "%s-%pfwP",
+               label = devm_kasprintf(dev, GFP_KERNEL, "%s:%pfwP",
                                       dev_name(dev), swnode);
                if (!label)
                        return -ENOMEM;
@@ -833,7 +833,7 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev)
                                                          GFP_KERNEL);
                        else
                                hog->chip_label = kasprintf(GFP_KERNEL,
-                                                       "gpio-sim.%u-%pfwP",
+                                                       "gpio-sim.%u:%pfwP",
                                                        dev->id,
                                                        bank->swnode);
                        if (!hog->chip_label) {
--
Quoted 2 lines

2.40.1

Patch applied.

Bart