linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels
@ 2024-02-20 13:54 Bartosz Golaszewski
  2024-02-21 22:49 ` Linus Walleij
  2024-02-23  8:57 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-02-20 13:54 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpio-sim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index c4106e37e6db..1f3dd95dd6da 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -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) {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels
  2024-02-20 13:54 [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels Bartosz Golaszewski
@ 2024-02-21 22:49 ` Linus Walleij
  2024-02-23  8:57 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2024-02-21 22:49 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

On Tue, Feb 20, 2024 at 2:54 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> 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
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

LGTM
Acked-by: Linus Walleij <linus.walleij@linaro.org>

I guess it could affect some tests?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels
  2024-02-20 13:54 [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels Bartosz Golaszewski
  2024-02-21 22:49 ` Linus Walleij
@ 2024-02-23  8:57 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-02-23  8:57 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

On Tue, Feb 20, 2024 at 2:54 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> 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
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/gpio/gpio-sim.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index c4106e37e6db..1f3dd95dd6da 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -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) {
> --
> 2.40.1
>

Patch applied.

Bart

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-23  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20 13:54 [PATCH] gpio: sim: delimit the fwnode name with a ":" when generating labels Bartosz Golaszewski
2024-02-21 22:49 ` Linus Walleij
2024-02-23  8:57 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).