diff mbox

[next,1/2] net: can: mscan: add a comment on reg to idx mapping

Message ID 1377208917-16698-1-git-send-email-agust@denx.de
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Anatolij Gustschin Aug. 22, 2013, 10:01 p.m. UTC
From: Gerhard Sittig <gsi@denx.de>

add a comment about the magic of deriving an MSCAN component index
from the peripheral's physical address / register offset

Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
 drivers/net/can/mscan/mpc5xxx_can.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Marc Kleine-Budde Aug. 23, 2013, 7:30 a.m. UTC | #1
On 08/23/2013 12:01 AM, Anatolij Gustschin wrote:
> From: Gerhard Sittig <gsi@denx.de>
> 
> add a comment about the magic of deriving an MSCAN component index
> from the peripheral's physical address / register offset
> 
> Cc: linux-can@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Gerhard Sittig <gsi@denx.de>

Anatolij, I'm missung your S-o-b here. Can you repost both patches?

Marc
Anatolij Gustschin Aug. 23, 2013, 11 a.m. UTC | #2
On Fri, 23 Aug 2013 09:30:55 +0200
Marc Kleine-Budde <mkl@pengutronix.de> wrote:

> On 08/23/2013 12:01 AM, Anatolij Gustschin wrote:
> > From: Gerhard Sittig <gsi@denx.de>
> > 
> > add a comment about the magic of deriving an MSCAN component index
> > from the peripheral's physical address / register offset
> > 
> > Cc: linux-can@vger.kernel.org
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Gerhard Sittig <gsi@denx.de>
> 
> Anatolij, I'm missung your S-o-b here. Can you repost both patches?

Yes, will do it.

Anatolij
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 5b0ee8e..bc422ba 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -148,7 +148,10 @@  static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
 		goto exit_put;
 	}
 
-	/* Determine the MSCAN device index from the physical address */
+	/* Determine the MSCAN device index from the peripheral's
+	 * physical address. Register address offsets against the
+	 * IMMR base are:  0x1300, 0x1380, 0x2300, 0x2380
+	 */
 	pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
 	BUG_ON(!pval || plen < sizeof(*pval));
 	clockidx = (*pval & 0x80) ? 1 : 0;