Lines Matching refs:dev

57 	struct udc		*dev;  in udc_pci_remove()  local
59 dev = pci_get_drvdata(pdev); in udc_pci_remove()
63 if (WARN_ON(dev->driver)) in udc_pci_remove()
67 free_dma_pools(dev); in udc_pci_remove()
70 writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg); in udc_pci_remove()
71 free_irq(pdev->irq, dev); in udc_pci_remove()
72 iounmap(dev->virt_addr); in udc_pci_remove()
77 udc_remove(dev); in udc_pci_remove()
86 struct udc *dev; in udc_pci_probe() local
93 dev_dbg(&pdev->dev, "already probed\n"); in udc_pci_probe()
98 dev = kzalloc(sizeof(struct udc), GFP_KERNEL); in udc_pci_probe()
99 if (!dev) in udc_pci_probe()
113 dev_dbg(&pdev->dev, "pci device used already\n"); in udc_pci_probe()
118 dev->virt_addr = ioremap(resource, len); in udc_pci_probe()
119 if (!dev->virt_addr) { in udc_pci_probe()
120 dev_dbg(&pdev->dev, "start address cannot be mapped\n"); in udc_pci_probe()
126 dev_err(&pdev->dev, "irq not set\n"); in udc_pci_probe()
131 spin_lock_init(&dev->lock); in udc_pci_probe()
133 dev->csr = dev->virt_addr + UDC_CSR_ADDR; in udc_pci_probe()
135 dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR; in udc_pci_probe()
137 dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR; in udc_pci_probe()
139 dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR); in udc_pci_probe()
140 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR); in udc_pci_probe()
142 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { in udc_pci_probe()
143 dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq); in udc_pci_probe()
148 pci_set_drvdata(pdev, dev); in udc_pci_probe()
151 dev->chiprev = pdev->revision; in udc_pci_probe()
156 dev->phys_addr = resource; in udc_pci_probe()
157 dev->irq = pdev->irq; in udc_pci_probe()
158 dev->pdev = pdev; in udc_pci_probe()
159 dev->dev = &pdev->dev; in udc_pci_probe()
163 retval = init_dma_pools(dev); in udc_pci_probe()
169 if (udc_probe(dev)) { in udc_pci_probe()
174 udc = dev; in udc_pci_probe()
180 free_dma_pools(dev); in udc_pci_probe()
182 free_irq(pdev->irq, dev); in udc_pci_probe()
184 iounmap(dev->virt_addr); in udc_pci_probe()
190 kfree(dev); in udc_pci_probe()