From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 08/11] smc911x: embed eth_device into priv
Date: Thu, 28 Jul 2011 15:42:01 +0200 [thread overview]
Message-ID: <1311860524-28566-9-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1311860524-28566-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/smc911x.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 615fd61..8c6f9fc 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -368,6 +368,7 @@
#define CHIP_9221 0x9221
struct smc911x_priv {
+ struct eth_device edev;
struct mii_device miidev;
void __iomem *base;
};
@@ -712,12 +713,10 @@ static int smc911x_probe(struct device_d *dev)
dev_info(dev, "detected %s controller\n", chip_ids[i].name);
- edev = xzalloc(sizeof(struct eth_device) +
- sizeof(struct smc911x_priv));
+ priv = xzalloc(sizeof(*priv));
+ edev = &priv->edev;
dev->type_data = edev;
- edev->priv = (struct smc911x_priv *)(edev + 1);
-
- priv = edev->priv;
+ edev->priv = priv;
edev->init = smc911x_init_dev;
edev->open = smc911x_eth_open;
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-07-28 13:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 13:41 more switches to resources Sascha Hauer
2011-07-28 13:41 ` [PATCH 01/11] serial netx: get rid of map_base Sascha Hauer
2011-07-28 13:41 ` [PATCH 02/11] serial s3c: " Sascha Hauer
2011-07-28 13:41 ` [PATCH 03/11] serial pl010: " Sascha Hauer
2011-07-28 13:41 ` [PATCH 04/11] serial stm: " Sascha Hauer
2011-07-28 13:41 ` [PATCH 05/11] serial mpc5xxx: " Sascha Hauer
2011-07-28 13:41 ` [PATCH 06/11] smc911x: use dev_* instead of printf Sascha Hauer
2011-07-28 13:42 ` [PATCH 07/11] smc911x: switch to use resources Sascha Hauer
2011-07-28 13:42 ` Sascha Hauer [this message]
2011-07-28 13:42 ` [PATCH 09/11] ARM pcm037: Fix wrong sdram base Sascha Hauer
2011-07-28 13:42 ` [PATCH 10/11] smc91111: switch to resources Sascha Hauer
2011-07-28 13:42 ` [PATCH 11/11] fec_mpc5200: " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311860524-28566-9-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox