linux/drivers/usb
Rajat Jain 70f400d4d9 driver core: Move the "removable" attribute from USB to core
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>
2021-05-27 09:36:31 +02:00
..
atm usb: atm: cxacru: Fix typo in comment 2021-05-21 20:05:40 +02:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 USB: cdnsp: drop irq-flags initialisations 2021-05-21 20:05:56 +02:00
chipidea USB: chipidea: remove dentry storage for debugfs file 2021-05-27 09:34:34 +02:00
class cdc-wdm: untangle a circular dependency between callback and softint 2021-05-10 14:39:51 +02:00
common usb: common: usb-conn-gpio: use usb_role_string() to print role status 2021-05-27 09:17:18 +02:00
core driver core: Move the "removable" attribute from USB to core 2021-05-27 09:36:31 +02:00
dwc2 USB: dwc2: drop irq-flags initialisations 2021-05-21 20:05:56 +02:00
dwc3 usb: dwc3: trace: Remove unused fields in dwc3_log_trb 2021-05-27 09:30:01 +02:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget USB: gadget: pxa27x_udc: remove dentry storage for debugfs file 2021-05-27 09:35:04 +02:00
host USB: fotg210-hcd: remove dentry storage for debugfs file 2021-05-27 09:35:16 +02:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1763: add peripheral mode 2021-05-21 20:05:32 +02:00
misc usb: misc: adutux: fix whitespace coding style issue 2021-04-22 10:49:53 +02:00
mon
mtu3 usb: mtu3: drop CONFIG_OF 2021-03-26 14:47:19 +01:00
musb usb: musb: Check devctl status again for a spurious session request 2021-05-21 14:07:57 +02:00
phy usb: phy: isp1301: Deduplicate of_find_i2c_device_by_node() 2021-05-24 15:27:17 +02:00
renesas_usbhs usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler() 2021-03-23 12:42:15 +01:00
roles usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial USB/Thunderbolt patches for 5.13-rc1 2021-04-26 11:32:23 -07:00
storage usb: storage: datafab: remove redundant assignment of variable result 2021-04-22 10:52:10 +02:00
typec usb: typec: mux: Remove requirement for the "orientation-switch" device property 2021-05-27 09:23:57 +02:00
usbip Scheduler updates for this cycle are: 2021-04-28 13:33:57 -07:00
Kconfig
Makefile usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
usb-skeleton.c