mirror-linux/drivers/phy
Ma Ke b2ea5f4958 phy: Fix error handling in tegra_xusb_port_init
If device_add() fails, do not use device_unregister() for error
handling. device_unregister() consists two functions: device_del() and
put_device(). device_unregister() should only be called after
device_add() succeeded because device_del() undoes what device_add()
does if successful. Change device_unregister() to put_device() call
before returning from the function.

As comment of device_add() says, 'if device_add() succeeds, you should
call device_del() when you want to get rid of it. If device_add() has
not succeeded, use only put_device() to drop the reference count'.

Found by code review.

Cc: stable@vger.kernel.org
Fixes: 53d2a715c2 ("phy: Add Tegra XUSB pad controller support")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20250303072739.3874987-1-make24@iscas.ac.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2025-05-14 12:28:43 +01:00
..
allwinner phy: sun4i-usb: Remove unused of_gpio.h 2024-12-08 21:37:32 +05:30
amlogic
broadcom phy: usb: Toggle the PHY power during init 2024-12-04 19:45:35 +05:30
cadence phy-for-6.13 2024-11-27 13:33:43 -08:00
freescale phy-for-6.15 2025-04-01 12:47:11 -07:00
hisilicon phy: HiSilicon: Don't use "proxy" headers 2024-12-08 21:36:59 +05:30
ingenic
intel phy: Switch back to struct platform_driver::remove() 2024-10-17 20:33:03 +05:30
lantiq
marvell phy: marvell: Fix spelling mistake "exlicitly" -> "explicitly" 2024-12-04 19:41:59 +05:30
mediatek phy: Use (of|device)_property_present() for non-boolean properties 2025-02-10 22:40:56 +05:30
microchip phy: PHY_LAN966X_SERDES should depend on SOC_LAN966 || MCHP_LAN966X_PCI 2025-02-14 18:04:57 +05:30
motorola phy: mapphone-mdm6600: use gpiod_multi_set_value_cansleep 2025-02-17 14:27:34 +01:00
mscc
nuvoton
qualcomm phy: qcom-qmp-ufs: check for mode type for phy setting 2025-04-11 12:42:26 +05:30
ralink
realtek USB / Thunderbolt (USB4) changes for 6.13-rc1 2024-11-29 11:19:31 -08:00
renesas phy: renesas: rcar-gen3-usb2: Set timing registers only once 2025-05-14 12:25:09 +01:00
rockchip phy: phy-rockchip-samsung-hdptx: Fix PHY PLL output 50.25MHz error 2025-05-14 09:55:09 +01:00
samsung phy-for-6.15 2025-04-01 12:47:11 -07:00
socionext
st phy-for-6.15 2025-04-01 12:47:11 -07:00
starfive phy: starfive: jh7110-usb: Fix USB 2.0 host occasional detection failure 2025-05-14 09:45:12 +01:00
sunplus
tegra phy: Fix error handling in tegra_xusb_port_init 2025-05-14 12:28:43 +01:00
ti phy: ti: gmii-sel: Do not use syscon helper to build regmap 2025-02-14 18:00:01 +05:30
xilinx phy: Switch back to struct platform_driver::remove() 2024-10-17 20:33:03 +05:30
Kconfig phy: add NXP PTN3222 eUSB2 to USB2 redriver 2024-10-17 20:48:27 +05:30
Makefile phy: add NXP PTN3222 eUSB2 to USB2 redriver 2024-10-17 20:48:27 +05:30
phy-airoha-pcie-regs.h phy: airoha: Fix REG_CSR_2L_RX{0,1}_REV0 definitions 2024-10-17 20:52:48 +05:30
phy-airoha-pcie.c phy: airoha: Fix REG_CSR_2L_JCPLL_SDM_HREN config in airoha_pcie_phy_init_ssc_jcpll() 2024-10-17 20:52:48 +05:30
phy-can-transceiver.c phy: can-transceiver: Re-instate "mux-states" property presence check 2025-04-11 17:00:15 +05:30
phy-core-mipi-dphy.c
phy-core.c phy: core: Remove unused phy_pm_runtime_(allow|forbid) 2025-03-10 12:58:07 +05:30
phy-lgm-usb.c phy: Switch back to struct platform_driver::remove() 2024-10-17 20:33:03 +05:30
phy-lpc18xx-usb-otg.c
phy-nxp-ptn3222.c phy: add NXP PTN3222 eUSB2 to USB2 redriver 2024-10-17 20:48:27 +05:30
phy-pistachio-usb.c
phy-xgene.c