diff options
author | David S. Miller <davem@davemloft.net> | 2015-03-09 23:38:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-09 23:38:02 -0400 |
commit | 3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (patch) | |
tree | 02e95f15bd8a04071a9a36f534a92a066a8ce66a /drivers/net/ethernet/stmicro | |
parent | 8ac467e837a24eb024177b4b01013d8e6764913a (diff) | |
parent | affb8172de395a6e1db52ed9790ca0456d8c29a9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/cadence/macb.c
Overlapping changes in macb driver, mostly fixes and cleanups
in 'net' overlapping with the integration of at91_ether into
macb in 'net-next'.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index fb846ebba1d9..f9b42f11950f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -272,6 +272,37 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
272 | struct stmmac_priv *priv = NULL; | 272 | struct stmmac_priv *priv = NULL; |
273 | struct plat_stmmacenet_data *plat_dat = NULL; | 273 | struct plat_stmmacenet_data *plat_dat = NULL; |
274 | const char *mac = NULL; | 274 | const char *mac = NULL; |
275 | int irq, wol_irq, lpi_irq; | ||
276 | |||
277 | /* Get IRQ information early to have an ability to ask for deferred | ||
278 | * probe if needed before we went too far with resource allocation. | ||
279 | */ | ||
280 | irq = platform_get_irq_byname(pdev, "macirq"); | ||
281 | if (irq < 0) { | ||
282 | if (irq != -EPROBE_DEFER) { | ||
283 | dev_err(dev, | ||
284 | "MAC IRQ configuration information not found\n"); | ||
285 | } | ||
286 | return irq; | ||
287 | } | ||
288 | |||
289 | /* On some platforms e.g. SPEAr the wake up irq differs from the mac irq | ||
290 | * The external wake up irq can be passed through the platform code | ||
291 | * named as "eth_wake_irq" | ||
292 | * | ||
293 | * In case the wake up interrupt is not passed from the platform | ||
294 | * so the driver will continue to use the mac irq (ndev->irq) | ||
295 | */ | ||
296 | wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq"); | ||
297 | if (wol_irq < 0) { | ||
298 | if (wol_irq == -EPROBE_DEFER) | ||
299 | return -EPROBE_DEFER; | ||
300 | wol_irq = irq; | ||
301 | } | ||
302 | |||
303 | lpi_irq = platform_get_irq_byname(pdev, "eth_lpi"); | ||
304 | if (lpi_irq == -EPROBE_DEFER) | ||
305 | return -EPROBE_DEFER; | ||
275 | 306 | ||
276 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 307 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
277 | addr = devm_ioremap_resource(dev, res); | 308 | addr = devm_ioremap_resource(dev, res); |
@@ -323,39 +354,15 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
323 | return PTR_ERR(priv); | 354 | return PTR_ERR(priv); |
324 | } | 355 | } |
325 | 356 | ||
357 | /* Copy IRQ values to priv structure which is now avaialble */ | ||
358 | priv->dev->irq = irq; | ||
359 | priv->wol_irq = wol_irq; | ||
360 | priv->lpi_irq = lpi_irq; | ||
361 | |||
326 | /* Get MAC address if available (DT) */ | 362 | /* Get MAC address if available (DT) */ |
327 | if (mac) | 363 | if (mac) |
328 | memcpy(priv->dev->dev_addr, mac, ETH_ALEN); | 364 | memcpy(priv->dev->dev_addr, mac, ETH_ALEN); |
329 | 365 | ||
330 | /* Get the MAC information */ | ||
331 | priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); | ||
332 | if (priv->dev->irq < 0) { | ||
333 | if (priv->dev->irq != -EPROBE_DEFER) { | ||
334 | netdev_err(priv->dev, | ||
335 | "MAC IRQ configuration information not found\n"); | ||
336 | } | ||
337 | return priv->dev->irq; | ||
338 | } | ||
339 | |||
340 | /* | ||
341 | * On some platforms e.g. SPEAr the wake up irq differs from the mac irq | ||
342 | * The external wake up irq can be passed through the platform code | ||
343 | * named as "eth_wake_irq" | ||
344 | * | ||
345 | * In case the wake up interrupt is not passed from the platform | ||
346 | * so the driver will continue to use the mac irq (ndev->irq) | ||
347 | */ | ||
348 | priv->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq"); | ||
349 | if (priv->wol_irq < 0) { | ||
350 | if (priv->wol_irq == -EPROBE_DEFER) | ||
351 | return -EPROBE_DEFER; | ||
352 | priv->wol_irq = priv->dev->irq; | ||
353 | } | ||
354 | |||
355 | priv->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi"); | ||
356 | if (priv->lpi_irq == -EPROBE_DEFER) | ||
357 | return -EPROBE_DEFER; | ||
358 | |||
359 | platform_set_drvdata(pdev, priv->dev); | 366 | platform_set_drvdata(pdev, priv->dev); |
360 | 367 | ||
361 | pr_debug("STMMAC platform driver registration completed"); | 368 | pr_debug("STMMAC platform driver registration completed"); |