From: Gerhard Sittig Date: Fri, 23 Aug 2013 11:09:02 +0000 (+0200) Subject: can: mscan: add a comment on reg to idx mapping X-Git-Tag: v3.12-rc1~132^2~83^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a09b12e0c2ef26a0e2230606a6159d3038a1572;p=platform%2Fkernel%2Flinux-exynos.git can: mscan: add a comment on reg to idx mapping 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 Signed-off-by: Anatolij Gustschin Signed-off-by: Marc Kleine-Budde --- 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;