netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macb: don't use platform_set_drvdata() on a net_device
@ 2011-02-28 14:05 Jamie Iles
  2011-02-28 20:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jamie Iles @ 2011-02-28 14:05 UTC (permalink / raw)
  To: netdev; +Cc: Jamie Iles, Nicolas Ferre

Commit 71d6429 (Driver core: convert platform_{get,set}_drvdata to
static inline functions) now triggers a warning in the macb network
driver:

  CC      drivers/net/macb.o
drivers/net/macb.c: In function ‘macb_mii_init’:
drivers/net/macb.c:263: warning: passing argument 1 of ‘platform_set_drvdata’ from incompatible pointer type
include/linux/platform_device.h:138: note: expected ‘struct platform_device *’ but argument is of type ‘struct net_device *’

Use dev_set_drvdata() on the device embedded in the net_device instead.

Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 drivers/net/macb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index f69e73e..79ccb54 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -260,7 +260,7 @@ static int macb_mii_init(struct macb *bp)
 	for (i = 0; i < PHY_MAX_ADDR; i++)
 		bp->mii_bus->irq[i] = PHY_POLL;
 
-	platform_set_drvdata(bp->dev, bp->mii_bus);
+	dev_set_drvdata(&bp->dev->dev, bp->mii_bus);
 
 	if (mdiobus_register(bp->mii_bus))
 		goto err_out_free_mdio_irq;
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] macb: don't use platform_set_drvdata() on a net_device
  2011-02-28 14:05 [PATCH] macb: don't use platform_set_drvdata() on a net_device Jamie Iles
@ 2011-02-28 20:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-02-28 20:22 UTC (permalink / raw)
  To: jamie; +Cc: netdev, nicolas.ferre

From: Jamie Iles <jamie@jamieiles.com>
Date: Mon, 28 Feb 2011 14:05:25 +0000

> Commit 71d6429 (Driver core: convert platform_{get,set}_drvdata to
> static inline functions) now triggers a warning in the macb network
> driver:
> 
>   CC      drivers/net/macb.o
> drivers/net/macb.c: In function ‘macb_mii_init’:
> drivers/net/macb.c:263: warning: passing argument 1 of ‘platform_set_drvdata’ from incompatible pointer type
> include/linux/platform_device.h:138: note: expected ‘struct platform_device *’ but argument is of type ‘struct net_device *’
> 
> Use dev_set_drvdata() on the device embedded in the net_device instead.
> 
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-28 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 14:05 [PATCH] macb: don't use platform_set_drvdata() on a net_device Jamie Iles
2011-02-28 20:22 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).