summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2015-05-20 21:03:07 +0300
committerDavid S. Miller <davem@davemloft.net>2015-05-22 01:57:26 +0300
commite56788cf13eef6e998bc03200df9e00f64a3202d (patch)
tree31049d4bc799d28b005beecfe1501e39f95c1fcf /drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
parent803f8fc46274bbd15757961be44a58ea6f3032d4 (diff)
downloadlinux-e56788cf13eef6e998bc03200df9e00f64a3202d.tar.xz
stmmac: let stmmac_dvr_probe take a struct of resources
Creat a struct that contain all the resources that needs to be assigned to the priv struct in stmmac_dvr_probe. This makes it possible to factor out more common code from the other probe functions and also use this struct to hold the resources as they are fetched. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 4743d0017d79..2c663ec2dfb3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -163,6 +163,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
{
struct stmmac_pci_info *info = (struct stmmac_pci_info *)id->driver_data;
struct plat_stmmacenet_data *plat;
+ struct stmmac_resources res;
struct stmmac_priv *priv;
int i;
int ret;
@@ -214,13 +215,16 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
pci_enable_msi(pdev);
- priv = stmmac_dvr_probe(&pdev->dev, plat, pcim_iomap_table(pdev)[i]);
+ memset(&res, 0, sizeof(res));
+ res.addr = pcim_iomap_table(pdev)[i];
+ res.wol_irq = pdev->irq;
+ res.irq = pdev->irq;
+
+ priv = stmmac_dvr_probe(&pdev->dev, plat, &res);
if (IS_ERR(priv)) {
dev_err(&pdev->dev, "%s: main driver probe failed\n", __func__);
return PTR_ERR(priv);
}
- priv->dev->irq = pdev->irq;
- priv->wol_irq = pdev->irq;
dev_dbg(&pdev->dev, "STMMAC PCI driver registration completed\n");