aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdnsp-pci.c
diff options
context:
space:
mode:
authorMiaoqian Lin <[email protected]>2025-09-03 14:16:13 +0000
committerGreg Kroah-Hartman <[email protected]>2025-09-06 13:23:59 +0000
commite9c206324eeb213957a567a9d066bdeb355c7491 (patch)
treea2072e8c97ff8369bcce0e8c51a00ad52cb47a73 /drivers/usb/cdns3/cdnsp-pci.c
parentusb: host: xhci-tegra: Remove redundant ternary operators (diff)
downloadkernel-e9c206324eeb213957a567a9d066bdeb355c7491.tar.gz
kernel-e9c206324eeb213957a567a9d066bdeb355c7491.zip
usb: cdns3: cdnsp-pci: remove redundant pci_disable_device() call
The cdnsp-pci driver uses pcim_enable_device() to enable a PCI device, which means the device will be automatically disabled on driver detach through the managed device framework. The manual pci_disable_device() call in the error path is therefore redundant. Found via static anlaysis and this is similar to commit 99ca0b57e49f ("thermal: intel: int340x: processor: Fix warning during module unload"). Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Cc: [email protected] Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdnsp-pci.c')
-rw-r--r--drivers/usb/cdns3/cdnsp-pci.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c
index 8c361b8394e9..5e7b88ca8b96 100644
--- a/drivers/usb/cdns3/cdnsp-pci.c
+++ b/drivers/usb/cdns3/cdnsp-pci.c
@@ -85,7 +85,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL);
if (!cdnsp) {
ret = -ENOMEM;
- goto disable_pci;
+ goto put_pci;
}
}
@@ -168,9 +168,6 @@ free_cdnsp:
if (!pci_is_enabled(func))
kfree(cdnsp);
-disable_pci:
- pci_disable_device(pdev);
-
put_pci:
pci_dev_put(func);