From: Lennert Buytenhek Date: Thu, 20 Nov 2008 11:57:36 +0000 (-0800) Subject: mv643xx_eth: introduce per-port register area pointer X-Git-Tag: v2.6.29-rc1~581^2~632 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37a6084f4b4693a408ac2fb229843af9f9f301ce;p=pandora-kernel.git mv643xx_eth: introduce per-port register area pointer The mv643xx_eth driver uses the rdl()/wrl() macros to read and write hardware registers. Per-port registers are accessed in the following way: #define PORT_STATUS(p) (0x0444 + ((p) << 10)) [...] static inline u32 rdl(struct mv643xx_eth_private *mp, int offset) { return readl(mp->shared->base + offset); } [...] port_status = rdl(mp, PORT_STATUS(mp->port_num)); By giving the per-port 'struct mv643xx_eth_private' its own 'void __iomem *base' pointer that points to the per-port register area, we can get rid of both the double indirection and the << 10 that is done for every per-port register access -- this patch does that. Signed-off-by: Lennert Buytenhek Signed-off-by: David S. Miller --- Reading git-diff-tree failed