From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/5] net i.MX fec: embed ethernet device into priv
Date: Thu, 28 Jul 2011 12:08:31 +0200 [thread overview]
Message-ID: <1311847712-23515-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1311847712-23515-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/fec_imx.c | 4 ++--
drivers/net/fec_imx.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 6886ccc..72f7faa 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -605,9 +605,9 @@ static int fec_probe(struct device_d *dev)
#ifdef CONFIG_ARCH_IMX27
PCCR0 |= PCCR0_FEC_EN;
#endif
- edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
+ fec = xzalloc(sizeof(*fec));
+ edev = &fec->edev;
dev->type_data = edev;
- fec = (struct fec_priv *)xzalloc(sizeof(*fec));
edev->priv = fec;
edev->open = fec_open;
edev->init = fec_init;
diff --git a/drivers/net/fec_imx.h b/drivers/net/fec_imx.h
index e07071a..19f4709 100644
--- a/drivers/net/fec_imx.h
+++ b/drivers/net/fec_imx.h
@@ -144,6 +144,7 @@ struct buffer_descriptor {
* @brief i.MX27-FEC private structure
*/
struct fec_priv {
+ struct eth_device edev;
void __iomem *regs;
xceiver_type xcv_type; /* transceiver type */
struct buffer_descriptor __iomem *rbd_base; /* RBD ring */
--
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 10:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 10:08 i.MX fec cleanup Sascha Hauer
2011-07-28 10:08 ` [PATCH 1/5] ARM dma_alloc_coherent: Fix alignment for !MMU case Sascha Hauer
2011-07-28 10:08 ` [PATCH 2/5] net i.MX fec: make multi instance safe Sascha Hauer
2011-07-28 10:08 ` [PATCH 3/5] net i.MX fec: remove unnecessary alignment Sascha Hauer
2011-07-28 10:08 ` Sascha Hauer [this message]
2011-07-28 10:08 ` [PATCH 5/5] net i.MX fec: rename driver struct to be generic 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=1311847712-23515-5-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