Skip to content

Commit 534be87

Browse files
Yuuoniygregkh
authored andcommitted
usb: cdns3: cdnsp-pci: remove redundant pci_disable_device() call
commit e9c2063 upstream. 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 99ca0b5 ("thermal: intel: int340x: processor: Fix warning during module unload"). Fixes: 3d82904 ("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]>
1 parent 8d5f3bb commit 534be87

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/usb/cdns3/cdnsp-pci.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
8585
cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL);
8686
if (!cdnsp) {
8787
ret = -ENOMEM;
88-
goto disable_pci;
88+
goto put_pci;
8989
}
9090
}
9191

@@ -168,9 +168,6 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
168168
if (!pci_is_enabled(func))
169169
kfree(cdnsp);
170170

171-
disable_pci:
172-
pci_disable_device(pdev);
173-
174171
put_pci:
175172
pci_dev_put(func);
176173

0 commit comments

Comments
 (0)