linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/fsl_pq_mdio: fix handling of TBIPA register
@ 2013-08-01 17:49 Lutz Jaenicke
  2013-08-06 23:10 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Lutz Jaenicke @ 2013-08-01 17:49 UTC (permalink / raw)
  To: linuxppc-dev

The TBIPA register is part of gianfar's full register set. When starting
from the MII registers, the start address of struct gfar needs to
be determined via container_of().
Experienced with mpc8313 and "fsl,gianfar-mdio" device tree entries.

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
---
 drivers/net/ethernet/freescale/fsl_pq_mdio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index c93a056..9485fdb 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -193,7 +193,8 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
  */
 static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)
 {
-	struct gfar __iomem *enet_regs = p;
+	struct gfar __iomem *enet_regs = 
+		container_of(p, struct gfar, gfar_mii_regs);
 
 	return &enet_regs->tbipa;
 }
-- 
1.7.10.4

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

end of thread, other threads:[~2013-08-07 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01 17:49 [PATCH] net/fsl_pq_mdio: fix handling of TBIPA register Lutz Jaenicke
2013-08-06 23:10 ` Scott Wood
2013-08-06 23:55   ` Scott Wood
2013-08-07 14:22     ` Lutz Jaenicke
2013-08-07 21:26       ` Scott Wood

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).