gpio: aspeed: Rework register type accessors
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 29 Jun 2018 04:11:16 +0000 (14:11 +1000)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 2 Jul 2018 14:10:07 +0000 (16:10 +0200)
commit44ddf559d5792b2bffcd44febf9b7b55b03e06b4
tree0f03179e6e34d20b0c9d4e1e23a88678998ebb3c
parentce397d215ccd07b8ae3f71db689aedb85d56ab40
gpio: aspeed: Rework register type accessors

Use a single accessor function for all register types instead
of several spread around. This will make it easier/cleaner
to introduce new registers and keep the mechanism in one
place.

The big switch/case is optimized at compile time since the
switch value is a constant.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-aspeed.c