Lines Matching refs:pdev

48 static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id *id)
55 np = dev_of_node(&pdev->dev);
62 plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
66 plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
74 dev_info(&pdev->dev, "Found MDIO subnode\n");
78 plat->dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*plat->dma_cfg), GFP_KERNEL);
85 ret = pci_enable_device(pdev);
87 dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n", __func__);
93 if (pci_resource_len(pdev, i) == 0)
95 ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
103 plat->bus_id = pci_dev_id(pdev);
105 phy_mode = device_get_phy_mode(&pdev->dev);
107 dev_err(&pdev->dev, "phy_mode not found\n");
115 pci_set_master(pdev);
118 pci_enable_msi(pdev);
120 res.addr = pcim_iomap_table(pdev)[0];
124 dev_err(&pdev->dev, "IRQ macirq not found\n");
131 dev_info(&pdev->dev, "IRQ eth_wake_irq not found, using macirq\n");
137 dev_err(&pdev->dev, "IRQ eth_lpi not found\n");
142 ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
149 pci_disable_msi(pdev);
151 pci_disable_device(pdev);
157 static void loongson_dwmac_remove(struct pci_dev *pdev)
159 struct net_device *ndev = dev_get_drvdata(&pdev->dev);
164 stmmac_dvr_remove(&pdev->dev);
167 if (pci_resource_len(pdev, i) == 0)
169 pcim_iounmap_regions(pdev, BIT(i));
173 pci_disable_msi(pdev);
174 pci_disable_device(pdev);
179 struct pci_dev *pdev = to_pci_dev(dev);
186 ret = pci_save_state(pdev);
190 pci_disable_device(pdev);
191 pci_wake_from_d3(pdev, true);
197 struct pci_dev *pdev = to_pci_dev(dev);
200 pci_restore_state(pdev);
201 pci_set_power_state(pdev, PCI_D0);
203 ret = pci_enable_device(pdev);
207 pci_set_master(pdev);