]> git.baikalelectronics.ru Git - kernel.git/commit
gpio-rcar: use devm_ioremap_resource()
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thu, 12 Oct 2017 21:08:14 +0000 (00:08 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 31 Oct 2017 08:52:13 +0000 (09:52 +0100)
commit952d53426132c684fa9c984209da47d96e09ab31
treed35b970244b38ef6429f914f70b5bcad240cb11d
parent72b2f7d1a2766c5a1cdca6b6e2c5c01196555a65
gpio-rcar: use devm_ioremap_resource()

Using devm_ioremap_resource() has several advantages over devm_ioremap():
- it checks the passed resource's validity;
- it calls devm_request_mem_region() to check for the resource overlap;
- it prints an error message in case of error.

We can call devm_ioremap_resource() instead of devm_ioremap_nocache()
as ioremap() and ioremap_nocache()  are implemented identically on ARM.
Doing this saves 2 LoCs and 80 bytes (AArch64 gcc 4.8.5).

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-rcar.c