]> git.baikalelectronics.ru Git - kernel.git/commit
dsa: b53: fix big-endian register access
authorArnd Bergmann <arnd@arndb.de>
Thu, 16 Jun 2016 09:00:05 +0000 (11:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jun 2016 00:15:28 +0000 (17:15 -0700)
commitb21a9648df84de39107c59b02c63f7bd5b2dafad
tree88e902033a9983db060131a613b161194c3719a1
parent0af48dff07aece630d4e174a8312b2adca2aa38a
dsa: b53: fix big-endian register access

The b53 dsa register access confusingly uses __raw register accessors
when both the CPU and the device are big-endian, but it uses little-
endian accessors when the same device is used from a little-endian
CPU, which makes no sense.

This uses normal accessors in device-endianess all the time, which
will work in all four combinations of register and CPU endianess,
and it will have the same barrier semantics in all cases.

This also seems to take care of a (false positive) warning I'm getting:

drivers/net/dsa/b53/b53_mmap.c: In function 'b53_mmap_read64':
drivers/net/dsa/b53/b53_mmap.c:109:10: error: 'hi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  *val = ((u64)hi << 32) | lo;

I originally planned to submit another patch for that warning
and did this one as a preparation cleanup, but it does seem to be
sufficient by itself.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_mmap.c