summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2015-05-20 20:03:07 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-21 18:57:26 -0400
commite56788cf13eef6e998bc03200df9e00f64a3202d (patch)
tree31049d4bc799d28b005beecfe1501e39f95c1fcf /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
parent803f8fc46274bbd15757961be44a58ea6f3032d4 (diff)
downloadtalos-obmc-linux-e56788cf13eef6e998bc03200df9e00f64a3202d.tar.gz
talos-obmc-linux-e56788cf13eef6e998bc03200df9e00f64a3202d.zip
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_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 396eb59768be..c73570f93279 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2797,7 +2797,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
* stmmac_dvr_probe
* @device: device pointer
* @plat_dat: platform data pointer
- * @addr: iobase memory address
+ * @res: stmmac resource pointer
* Description: this is the main probe function used to
* call the alloc_etherdev, allocate the priv structure.
* Return:
@@ -2806,7 +2806,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
*/
struct stmmac_priv *stmmac_dvr_probe(struct device *device,
struct plat_stmmacenet_data *plat_dat,
- void __iomem *addr)
+ struct stmmac_resources *res)
{
int ret = 0;
struct net_device *ndev = NULL;
@@ -2825,8 +2825,15 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
stmmac_set_ethtool_ops(ndev);
priv->pause = pause;
priv->plat = plat_dat;
- priv->ioaddr = addr;
- priv->dev->base_addr = (unsigned long)addr;
+ priv->ioaddr = res->addr;
+ priv->dev->base_addr = (unsigned long)res->addr;
+
+ priv->dev->irq = res->irq;
+ priv->wol_irq = res->wol_irq;
+ priv->lpi_irq = res->lpi_irq;
+
+ if (res->mac)
+ memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN);
dev_set_drvdata(device, priv);
OpenPOWER on IntegriCloud