Skip to content

Commit 9895463

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 cde10a9 commit 9895463

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

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

177-
disable_pci:
178-
pci_disable_device(pdev);
179-
180177
put_pci:
181178
pci_dev_put(func);
182179

0 commit comments

Comments
 (0)