lkml.org 
[lkml]   [2022]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] usb: typec: pd: Add symlink to linked device
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
\
 
 \ /
  Last update: 2022-11-21 07:36    [W:0.070 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site