[PATCH 3.16 195/346] gpio: Fix OF build problem on UM

From: Ben Hutchings
Date: Sun Nov 13 2016 - 22:01:00 EST


3.16.39-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Linus Walleij <linus.walleij@xxxxxxxxxx>

commit 2527ecc9195e9c66252af24c4689e8a67cd4ccb9 upstream.

The UserMode (UM) Linux build was failing in gpiolib-of as it requires
ioremap()/iounmap() to exist, which is absent from UM. The non-existence
of IO memory is negatively defined as CONFIG_NO_IOMEM which means we
need to depend on HAS_IOMEM.

Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/gpio/Kconfig | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -50,6 +50,7 @@ config GPIO_DEVRES
config OF_GPIO
def_bool y
depends on OF
+ depends on HAS_IOMEM

config GPIO_ACPI
def_bool y
--- a/arch/mips/kvm/kvm_mips.c
+++ b/arch/mips/kvm/kvm_mips.c
@@ -1211,7 +1211,7 @@ int __init kvm_mips_init(void)
*/
kvm_mips_gfn_to_pfn = gfn_to_pfn;
kvm_mips_release_pfn_clean = kvm_release_pfn_clean;
- kvm_mips_is_error_pfn = is_error_pfn;
+ kvm_mips_is_error_pfn = is_error_noslot_pfn;

pr_info("KVM/MIPS Initialized\n");
return 0;