kernel_samsung_a53x/drivers/usb/core
Rajat Jain 3a0ed2d406 driver core: Move the "removable" attribute from USB to core
[ Upstream commit 70f400d4d957c2453c8689552ff212bc59f88938 ]

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.

Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Rajat Jain <rajatja@google.com>
Link: https://lore.kernel.org/r/20210524171812.18095-1-rajatja@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 432e664e7c98 ("drm/amdgpu: don't use ATRM for external devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:11:13 +01:00
..
buffer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2024-11-18 12:11:10 +01:00
devices.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
devio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
driver.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
endpoint.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
generic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hcd-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hcd.c usb: core: Track SuperSpeed Plus GenXxY 2024-11-08 11:26:12 +01:00
hub.c driver core: Move the "removable" attribute from USB to core 2024-11-18 12:11:13 +01:00
hub.h usb: hub: Guard against accesses to uninitialized BOS descriptors 2024-11-08 11:26:08 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ledtrig-usbport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
message.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
notify.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
otg_productlist.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
phy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
phy.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
port.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
quirks.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.c driver core: Move the "removable" attribute from USB to core 2024-11-18 12:11:13 +01:00
urb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb-acpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usb_host_certify.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00