[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YK9M+OQ33+A5PFVB@kroah.com>
Date: Thu, 27 May 2021 09:40:40 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Rajat Jain <rajatja@...gle.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Alan Stern <stern@...land.harvard.edu>,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-usb@...r.kernel.org, helgaas@...nel.org,
Oliver Neukum <oneukum@...e.com>,
David Laight <David.Laight@...lab.com>,
Krzysztof WilczyĆski <kw@...ux.com>,
rajatxjain@...il.com, jsbarnes@...gle.com, dtor@...gle.com
Subject: Re: [PATCH v5 1/2] driver core: Move the "removable" attribute from
USB to core
On Mon, May 24, 2021 at 10:18:11AM -0700, Rajat Jain wrote:
> Move the "removable" attribute from USB to core in order to allow it to be
> supported by other subsystem / buses. Individual buses that want to support
> this attribute can populate the removable property of the device while
> enumerating it with the 3 possible values -
> - "unknown"
> - "fixed"
> - "removable"
> Leaving the field unchanged (i.e. "not supported") would mean that the
> attribute would not show up in sysfs for that device. The UAPI (location,
> symantics etc) for the attribute remains unchanged.
>
> Move the "removable" attribute from USB to the device core so it can be
> used by other subsystems / buses.
>
> By default, devices do not have a "removable" attribute in sysfs.
>
> If a subsystem or bus driver wants to support a "removable" attribute, it
> should call device_set_removable() before calling device_register() or
> device_add(), e.g.:
>
> device_set_removable(dev, DEVICE_REMOVABLE);
> device_register(dev);
>
> The possible values and the resulting sysfs attribute contents are:
>
> DEVICE_REMOVABLE_UNKNOWN -> "unknown"
> DEVICE_REMOVABLE -> "removable"
> DEVICE_FIXED -> "fixed"
>
> Convert the USB "removable" attribute to use this new device core
> functionality. There should be no user-visible change in the location or
> semantics of attribute for USB devices.
>
> Signed-off-by: Rajat Jain <rajatja@...gle.com>
> Reviewed-by: Bjorn Helgaas <bhelgaas@...gle.com>
> ---
> v5: - Update commit log per Bjorn's suggestion, and add "Reviewed by".
> - don't check for dev!=NULL
I've applied this series to my USB tree now, thanks for reworking it so
many times.
greg k-h
Powered by blists - more mailing lists