Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1224242
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 06/16] usb: gadget: amd5536udc: remove unnecessary conditions |
| Date | 2015-09-14 17:20 +0200 |
| Message-ID | <q8DI0-1xe-59@gated-at.bofh.it> (permalink) |
| References | <q8DHY-1xe-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The condition checking for irq_registered, regs, mem_region and active are not required as this is the remove function. And we are in the remove means that probe was successful and they can never be NULL at this point of code. It was required in the original code as the remove function was part of the error handler of probe function. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> --- drivers/usb/gadget/udc/amd5536udc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 3ae0bb8..e2f6128 100644 --- a/drivers/usb/gadget/udc/amd5536udc.c +++ b/drivers/usb/gadget/udc/amd5536udc.c @@ -3135,15 +3135,11 @@ static void udc_pci_remove(struct pci_dev *pdev) /* reset controller */ writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg); - if (dev->irq_registered) - free_irq(pdev->irq, dev); - if (dev->regs) - iounmap(dev->regs); - if (dev->mem_region) - release_mem_region(pci_resource_start(pdev, 0), + free_irq(pdev->irq, dev); + iounmap(dev->regs); + release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); - if (dev->active) - pci_disable_device(pdev); + pci_disable_device(pdev); udc_remove(dev); } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 06/16] usb: gadget: amd5536udc: remove unnecessary conditions Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-14 17:20 +0200
csiph-web