Skip to content

Commit 01ffce6

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 9548742 commit 01ffce6

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
@@ -90,7 +90,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
9090
cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL);
9191
if (!cdnsp) {
9292
ret = -ENOMEM;
93-
goto disable_pci;
93+
goto put_pci;
9494
}
9595
}
9696

@@ -173,9 +173,6 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
173173
if (!pci_is_enabled(func))
174174
kfree(cdnsp);
175175

176-
disable_pci:
177-
pci_disable_device(pdev);
178-
179176
put_pci:
180177
pci_dev_put(func);
181178

0 commit comments

Comments
 (0)