net: dsa: b53: Fix sparse warnings in b53_mmap.c
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 2 Apr 2018 23:17:01 +0000 (16:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Apr 2018 15:15:27 +0000 (11:15 -0400)
commit861690d0543949633c97ebe9b2fcd55c27b9bda4
tree1c332e26df66bf8e24fea9a2f1dcf7f17c0d74e6
parent3848ec5dc82ce648a84ed10021ce2562fdac7c6a
net: dsa: b53: Fix sparse warnings in b53_mmap.c

sparse complains about the following warnings:

drivers/net/dsa/b53/b53_mmap.c:33:31: warning: incorrect type in
initializer (different address spaces)
drivers/net/dsa/b53/b53_mmap.c:33:31:    expected unsigned char
[noderef] [usertype] <asn:2>*regs
drivers/net/dsa/b53/b53_mmap.c:33:31:    got void *priv

and indeed, while what we are doing is functional, we are dereferencing
a void * pointer into a void __iomem * which is not great. Just use the
defined b53_mmap_priv structure which holds our register base and use
that.

Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_mmap.c