linux/drivers/usb
Uwe Kleine-König fc153aba3e usb: max-3421: Use driver data instead of maintaining a list of bound devices
Instead of maintaining a single-linked list of devices that must be
searched linearly in .remove() just use spi_set_drvdata() to remember the
link between the spi device and the driver struct. Then the global list
and the next member can be dropped.

This simplifies the driver, reduces the memory footprint and the time to
search the list. Also it makes obvious that there is always a corresponding
driver struct for a given device in .remove(), so the error path for
!max3421_hcd can be dropped, too.

As a side effect this fixes a data inconsistency when .probe() races with
itself for a second max3421 device in manipulating max3421_hcd_list. A
similar race is fixed in .remove(), too.

Fixes: 2d53139f31 ("Add support for using a MAX3421E chip as a host driver.")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211018204028.2914597-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-21 12:52:28 +02:00
..
atm usb: atm: Use struct_size() helper 2021-10-05 12:50:22 +02:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 usb: cdns3: fix race condition before setting doorbell 2021-09-14 10:32:41 +02:00
chipidea Merge 5.15-rc5 into usb-next 2021-10-11 07:39:38 +02:00
class Merge 5.15-rc5 into usb-next 2021-10-11 07:39:38 +02:00
common Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-05 13:45:16 +02:00
core usb: core: config: Change sizeof(struct ...) to sizeof(*...) 2021-10-06 08:25:47 +02:00
dwc2 usb: dwc2: drd: reset current session before setting the new one 2021-10-21 12:49:01 +02:00
dwc3 usb: dwc3: gadget: Change to dev_dbg() when queuing to inactive gadget/ep 2021-10-20 19:37:27 +02:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget usb: gadget: u_ether: use eth_hw_addr_set() 2021-10-20 19:31:50 +02:00
host usb: max-3421: Use driver data instead of maintaining a list of bound devices 2021-10-21 12:52:28 +02:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1760: otg control register access 2021-08-27 16:11:39 +02:00
misc Revert "usb: misc: ehset: Workaround for "special" hubs" 2021-10-07 12:48:54 +02:00
mon
mtu3 usb: mtu3: fix random remote wakeup 2021-08-26 13:41:52 +02:00
musb Merge 5.15-rc6 into usb-next 2021-10-18 09:40:52 +02:00
phy USB: phy: tahvo:remove unnecessary debug log 2021-10-05 12:51:07 +02:00
renesas_usbhs usb: renesas_usbhs: Fix spelling mistake "faile" -> "failed" 2021-08-27 10:29:32 +02:00
roles usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial USB: serial: qcserial: add EM9191 QDL support 2021-10-07 15:39:06 +02:00
storage usb-storage: Add compatibility quirk flags for iODD 2531/2541 2021-10-18 17:05:34 +02:00
typec usb: typec: tipd: Enable event interrupts by default 2021-10-20 19:31:13 +02:00
usbip usbip:vhci_hcd USB port can get stuck in the disabled state 2021-08-26 13:29:27 +02:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile usb: host: remove line for obsolete config USB_HWA_HCD 2021-08-18 15:32:19 +02:00
usb-skeleton.c usb: usb-skeleton: Update min() to min_t() 2021-10-05 12:56:48 +02:00