]> Pileus Git - ~andy/linux/commitdiff
can: mscan: add a comment on reg to idx mapping
authorGerhard Sittig <gsi@denx.de>
Fri, 23 Aug 2013 11:09:02 +0000 (13:09 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 29 Aug 2013 20:49:35 +0000 (22:49 +0200)
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>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/mscan/mpc5xxx_can.c

index 5b0ee8ef5885e54a610030b9318445bae8aaf321..bc422ba3d13b796fb6f7f934be66b00d3837090c 100644 (file)
@@ -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;