All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Prashant Malani <pmalani@chromium.org>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Benson Leung <bleung@chromium.org>
Subject: Re: [PATCH] usb: typec: pd: Add symlink to linked device
Date: Mon, 21 Nov 2022 07:35:32 +0100	[thread overview]
Message-ID: <Y3scND+8DVe8SGeD@kroah.com> (raw)
In-Reply-To: <20221121062106.2569297-1-pmalani@chromium.org>

On Mon, Nov 21, 2022 at 06:20:39AM +0000, Prashant Malani wrote:
> There exists a symlink from a device to its USB Power Delivery object,
> but not the other way around. Add a symlink from the USB PD object to
> the device which it's associated with, and call it "device".
> 
> This is helpful to identify said device (a Type-C peripheral for
> example) during uevents, since during USB PD object
> creation/destruction, a uevent is generated for the PD object,
> but not the device linked to it.
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Benson Leung <bleung@chromium.org>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> ---
>  .../ABI/testing/sysfs-class-usb_power_delivery       |  6 ++++++
>  drivers/usb/typec/pd.c                               | 12 ++++++++++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-usb_power_delivery b/Documentation/ABI/testing/sysfs-class-usb_power_delivery
> index ce2b1b563cb3..e7d19193875f 100644
> --- a/Documentation/ABI/testing/sysfs-class-usb_power_delivery
> +++ b/Documentation/ABI/testing/sysfs-class-usb_power_delivery
> @@ -4,6 +4,12 @@ Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
>  Description:
>  		Directory for USB Power Delivery devices.
>  
> +What:		/sys/class/usb_power_delivery/.../device
> +Date:		November 2022
> +Contact:	Prashant Malani <pmalani@chromium.org>
> +Description:
> +		Symbolic link to the directory of the device to which the USB PD object is linked.

Line is way too long.

But wait, a "device" has a specific meaning in a sysfs file, and that is
not what is happening here.

Please don't make fake "device" symlinks when these are not really using
a device here.  Either fix it up to properly use the device structures
in the code, or call this something else.

What in userspace wants to see this symlink?

thanks,

greg k-h

  reply	other threads:[~2022-11-21  6:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  6:20 [PATCH] usb: typec: pd: Add symlink to linked device Prashant Malani
2022-11-21  6:35 ` Greg Kroah-Hartman [this message]
2022-11-21  7:16   ` Prashant Malani
2022-11-21  7:36     ` Greg Kroah-Hartman
2022-11-21 19:11       ` Prashant Malani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3scND+8DVe8SGeD@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bleung@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.