linux/drivers/usb/host
Uwe Kleine-König 101485e566 usb: max-3421: Use driver data instead of maintaining a list of bound devices
commit fc153aba3ef371d0d76eb88230ed4e0dee5b38f2 upstream.

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-11-26 10:47:23 +01:00
..
Kconfig USB changes for 5.4-rc1 2019-09-18 10:33:46 -07:00
Makefile usb: remove ehci-w90x900 driver 2019-08-10 09:28:28 +02:00
bcma-hcd.c
ehci-atmel.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-dbg.c
ehci-exynos.c usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() 2020-06-30 15:36:49 -04:00
ehci-fsl.c usb: host: Stops USB controller init if PLL fails to lock 2019-07-03 18:52:20 +02:00
ehci-fsl.h usb: phy: Workaround for USB erratum-A005728 2019-07-03 18:52:20 +02:00
ehci-grlib.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-hcd.c usb: ehci: handshake CMD_RUN instead of STS_HALT 2021-11-12 14:43:02 +01:00
ehci-hub.c USB: ehci: fix an interrupt calltrace error 2021-01-27 11:47:50 +01:00
ehci-mem.c
ehci-mv.c USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable() 2021-09-22 12:26:28 +02:00
ehci-mxc.c USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() 2020-06-24 17:50:29 +02:00
ehci-npcm7xx.c
ehci-omap.c usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe 2020-12-30 11:51:22 +01:00
ehci-orion.c usb: ehci-orion: Handle errors of clk_prepare_enable() in probe 2021-09-15 09:47:36 +02:00
ehci-pci.c USB:ehci:fix Kunpeng920 ehci hardware problem 2021-08-15 13:08:04 +02:00
ehci-platform.c usb: ehci: handshake CMD_RUN instead of STS_HALT 2021-11-12 14:43:02 +01:00
ehci-pmcmsp.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-ppc-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-ps3.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-q.c USB: EHCI: Do not return -EPIPE when hub is disconnected 2019-12-31 16:46:07 +01:00
ehci-sched.c
ehci-sh.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-spear.c
ehci-st.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-sysfs.c
ehci-tegra.c
ehci-timer.c
ehci-xilinx-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci.h usb: ehci: handshake CMD_RUN instead of STS_HALT 2021-11-12 14:43:02 +01:00
fhci-dbg.c
fhci-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c usb: host: use usb_endpoint_maxp instead of usb_maxpacket 2019-04-19 14:23:34 +02:00
fhci-tds.c
fhci.h
fotg210-hcd.c usb: host: fotg210: fix the actual_length of an iso packet 2021-09-22 12:26:28 +02:00
fotg210.h usb: host: fotg210: fix the actual_length of an iso packet 2021-09-22 12:26:28 +02:00
fsl-mph-dr-of.c usb: host: fsl-mph-dr-of: check return of dma_set_mask() 2020-11-05 11:43:29 +01:00
imx21-dbg.c
imx21-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
imx21-hcd.h
isp116x-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
isp116x.h
isp1362-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
isp1362.h usb: isp1362: Spelling s/eclusive/exclusive/ 2019-06-18 08:51:28 +02:00
max3421-hcd.c usb: max-3421: Use driver data instead of maintaining a list of bound devices 2021-11-26 10:47:23 +01:00
ohci-at91.c USB: host: ohci-at91: add sam9x60-sfr definition for ohci 2019-01-18 09:58:04 +01:00
ohci-da8xx.c usb: ohci-da8xx: ensure error return on variable error is set 2020-01-14 20:08:29 +01:00
ohci-dbg.c
ohci-exynos.c usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe() 2020-09-03 11:27:08 +02:00
ohci-hcd.c usb: ohci: Make distrust_firmware param default to false 2021-01-23 15:57:54 +01:00
ohci-hub.c
ohci-mem.c usb: host: Fix excessive alignment restriction for local memory allocations 2019-06-28 07:57:07 +02:00
ohci-nxp.c usb: ohci-nxp: enable compile-testing 2019-08-15 21:32:56 +02:00
ohci-omap.c
ohci-pci.c usb: pci-quirks: Minor cleanup for AMD PLL quirk 2019-07-25 10:40:02 +02:00
ohci-platform.c Revert "usb/ohci-platform: Fix a warning when hibernating" 2020-07-22 09:32:55 +02:00
ohci-ppc-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-ps3.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-pxa27x.c usb: host: ohci-pxa27x: Fix and & vs | typo 2019-08-21 09:59:30 -07:00
ohci-q.c
ohci-s3c2410.c usb: ohci-s3c2410: Remove set but not used variable 'hcd' 2019-06-03 15:21:57 +02:00
ohci-sa1111.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-sm501.c USB: ohci-sm501: Add missed iounmap() in remove 2020-06-30 15:36:48 -04:00
ohci-spear.c USB: ohci-spear: Remove set but not used variable 'ohci' 2019-06-03 15:21:57 +02:00
ohci-st.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ohci-tmio.c usb: host: ohci-tmio: check return value after calling platform_get_resource() 2021-11-26 10:47:15 +01:00
ohci.h USB: use genalloc for USB HCs with local memory 2019-06-03 16:00:07 +02:00
oxu210hp-hcd.c usb: oxu210hp-hcd: Fix memory leak in oxu_create 2020-12-30 11:51:22 +01:00
pci-quirks.c usb: pci-quirks: Minor cleanup for AMD PLL quirk 2019-07-25 10:40:02 +02:00
pci-quirks.h usb: pci-quirks: Minor cleanup for AMD PLL quirk 2019-07-25 10:40:02 +02:00
r8a66597-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
r8a66597.h
sl811-hcd.c usb: sl811-hcd: improve misleading indentation 2021-05-22 11:38:27 +02:00
sl811.h
sl811_cs.c
ssb-hcd.c
u132-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-debug.c
uhci-grlib.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-hcd.c USB: drop HCD_LOCAL_MEM flag 2019-06-03 16:00:08 +02:00
uhci-hcd.h
uhci-hub.c
uhci-pci.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-platform.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c usb: host: Remove call to memset after dma_alloc_coherent 2019-07-25 11:10:54 +02:00
xhci-dbgcap.h
xhci-dbgtty.c usb: xhci: dbc: Use GFP_KERNEL instead of GFP_ATOMIC in 'xhci_dbc_alloc_requests()' 2019-09-03 15:49:11 +02:00
xhci-debugfs.c xhci: fix unsafe memory usage in xhci tracing 2021-09-12 08:56:41 +02:00
xhci-debugfs.h usb: xhci: remove unused member 'parent' in xhci_regset struct 2019-02-20 20:18:23 +01:00
xhci-ext-caps.c xhci-ext-caps.c: Add missing platform_device_put() on error in xhci_create_intel_xhci_sw_pdev() 2019-10-04 14:37:53 +02:00
xhci-ext-caps.h usb: xhci: Increase timeout for HC halt 2021-05-19 10:08:31 +02:00
xhci-histb.c xhci: hisilicon: fix refercence leak in xhci_histb_probe 2020-11-18 19:20:29 +01:00
xhci-hub.c xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay 2021-11-17 09:48:16 +01:00
xhci-mem.c xhci: solve a double free problem while doing s4 2021-07-14 16:53:01 +02:00
xhci-mtk-sch.c usb: xhci-mtk: improve bandwidth scheduling with TT 2021-05-14 09:44:11 +02:00
xhci-mtk.c usb: xhci-mtk: support quirk to disable usb2 lpm 2021-05-11 14:04:06 +02:00
xhci-mtk.h usb: xhci-mtk: improve bandwidth scheduling with TT 2021-05-14 09:44:11 +02:00
xhci-mvebu.c usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-10 09:25:33 +01:00
xhci-mvebu.h usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-10 09:25:33 +01:00
xhci-pci.c usb: xhci: Enable runtime-pm by default on AMD Yellow Carp platform 2021-11-17 09:48:16 +01:00
xhci-plat.c usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-10 09:25:33 +01:00
xhci-plat.h usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-10 09:25:33 +01:00
xhci-rcar.c usb: host: xhci-rcar: Don't reload firmware after the completion 2021-09-12 08:56:41 +02:00
xhci-rcar.h usb: host: xhci-rcar: Use xhci_plat_priv.quirks instead of code settings 2019-09-03 15:53:27 +02:00
xhci-ring.c xhci: Fix command ring pointer corruption while aborting a command 2021-10-20 11:40:13 +02:00
xhci-tegra.c xhci: tegra: Delay for disabling LFPS detector 2021-01-27 11:47:51 +01:00
xhci-trace.c
xhci-trace.h xhci: fix unsafe memory usage in xhci tracing 2021-09-12 08:56:41 +02:00
xhci.c Revert "xhci: Set HCD flag to defer primary roothub registration" 2021-11-06 13:59:45 +01:00
xhci.h xhci: fix unsafe memory usage in xhci tracing 2021-09-12 08:56:41 +02:00