linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] driver core: Change delimiter in devlink device's name to "--"
@ 2020-07-24 18:05 Saravana Kannan
  2020-07-27 14:21 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Saravana Kannan @ 2020-07-24 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Saravana Kannan, kernel-team, linux-kernel

The devlink device name is of the form "supplier:consumer". But ":" is
fairly common in device names and makes it visually hard to distinguish
supplier and consumer. So, replace it with "--" to make it easier.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 Documentation/ABI/testing/sysfs-class-devlink | 2 +-
 drivers/base/core.c                           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-class-devlink b/Documentation/ABI/testing/sysfs-class-devlink
index 3a24973abb83..64791b65c9a3 100644
--- a/Documentation/ABI/testing/sysfs-class-devlink
+++ b/Documentation/ABI/testing/sysfs-class-devlink
@@ -4,7 +4,7 @@ Contact:	Saravana Kannan <saravanak@google.com>
 Description:
 		Provide a place in sysfs for the device link objects in the
 		kernel at any given time.  The name of a device link directory,
-		denoted as ... above, is of the form <supplier>:<consumer>
+		denoted as ... above, is of the form <supplier>--<consumer>
 		where <supplier> is the supplier device name and <consumer> is
 		the consumer device name.
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b6e8b0bb76e4..4d05868d9356 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -623,7 +623,7 @@ struct device_link *device_link_add(struct device *consumer,
 
 	link->link_dev.class = &devlink_class;
 	device_set_pm_not_required(&link->link_dev);
-	dev_set_name(&link->link_dev, "%s:%s",
+	dev_set_name(&link->link_dev, "%s--%s",
 		     dev_name(supplier), dev_name(consumer));
 	if (device_register(&link->link_dev)) {
 		put_device(consumer);
-- 
2.28.0.rc0.142.g3c755180ce-goog


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

* Re: [PATCH v1] driver core: Change delimiter in devlink device's name to "--"
  2020-07-24 18:05 [PATCH v1] driver core: Change delimiter in devlink device's name to "--" Saravana Kannan
@ 2020-07-27 14:21 ` Rafael J. Wysocki
  2020-07-27 22:09   ` Saravana Kannan
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2020-07-27 14:21 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Cc: Android Kernel,
	Linux Kernel Mailing List

On Fri, Jul 24, 2020 at 8:05 PM Saravana Kannan <saravanak@google.com> wrote:
>
> The devlink device name is of the form "supplier:consumer". But ":" is
> fairly common in device names and makes it visually hard to distinguish
> supplier and consumer. So, replace it with "--" to make it easier.
>
> Signed-off-by: Saravana Kannan <saravanak@google.com>

Well, this makes sense in principle, but I wonder how much risk of
breaking anything in user space there is?

> ---
>  Documentation/ABI/testing/sysfs-class-devlink | 2 +-
>  drivers/base/core.c                           | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-devlink b/Documentation/ABI/testing/sysfs-class-devlink
> index 3a24973abb83..64791b65c9a3 100644
> --- a/Documentation/ABI/testing/sysfs-class-devlink
> +++ b/Documentation/ABI/testing/sysfs-class-devlink
> @@ -4,7 +4,7 @@ Contact:        Saravana Kannan <saravanak@google.com>
>  Description:
>                 Provide a place in sysfs for the device link objects in the
>                 kernel at any given time.  The name of a device link directory,
> -               denoted as ... above, is of the form <supplier>:<consumer>
> +               denoted as ... above, is of the form <supplier>--<consumer>
>                 where <supplier> is the supplier device name and <consumer> is
>                 the consumer device name.
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index b6e8b0bb76e4..4d05868d9356 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -623,7 +623,7 @@ struct device_link *device_link_add(struct device *consumer,
>
>         link->link_dev.class = &devlink_class;
>         device_set_pm_not_required(&link->link_dev);
> -       dev_set_name(&link->link_dev, "%s:%s",
> +       dev_set_name(&link->link_dev, "%s--%s",
>                      dev_name(supplier), dev_name(consumer));
>         if (device_register(&link->link_dev)) {
>                 put_device(consumer);
> --
> 2.28.0.rc0.142.g3c755180ce-goog
>

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

* Re: [PATCH v1] driver core: Change delimiter in devlink device's name to "--"
  2020-07-27 14:21 ` Rafael J. Wysocki
@ 2020-07-27 22:09   ` Saravana Kannan
  0 siblings, 0 replies; 3+ messages in thread
From: Saravana Kannan @ 2020-07-27 22:09 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg Kroah-Hartman, Cc: Android Kernel, Linux Kernel Mailing List

On Mon, Jul 27, 2020 at 7:21 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Jul 24, 2020 at 8:05 PM Saravana Kannan <saravanak@google.com> wrote:
> >
> > The devlink device name is of the form "supplier:consumer". But ":" is
> > fairly common in device names and makes it visually hard to distinguish
> > supplier and consumer. So, replace it with "--" to make it easier.
> >
> > Signed-off-by: Saravana Kannan <saravanak@google.com>
>
> Well, this makes sense in principle, but I wonder how much risk of
> breaking anything in user space there is?

The original patch got in only a week or two before this patch. So I
don't think there's any real risk of breaking user space here. Also,
it hasn't been part of any kernel release version yet. So I think we
are safe.

Also, Greg already took it.

-Saravana

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

end of thread, other threads:[~2020-07-27 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 18:05 [PATCH v1] driver core: Change delimiter in devlink device's name to "--" Saravana Kannan
2020-07-27 14:21 ` Rafael J. Wysocki
2020-07-27 22:09   ` Saravana Kannan

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).