[PATCH 1/2] x86/platform/intel-mid: Create pinctrl platform device at later initcall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Postpone "pinctrl-merrifield" platform device creation later than
subsys_initcall. This is preparation for an another patch that does ACPI
namespace walk which is not possible yet at subsys_initcall phase.

Currently if kernel is built with ACPI support and platform has the ACPI
device "INTC1002" with the same MMIO resources than "pinctrl-merrifield"
platform device then these devices conflict and typically probing of
"INTC1002" will fail in drivers/pinctrl/intel/pinctrl-merrifield.c due
conflicting resources:

[    0.873523] pinctrl-merrifield INTC1002:00: can't request region for resource [mem 0xff0c0000-0xff0c7fff]
[    0.879464] pinctrl-merrifield: probe of INTC1002:00 failed with error -16

Moreover also dependent drivers/gpio/gpio-merrifield.c will fail to
probe due it tries to bind with pinctrl device named after "INTC1002"
rather than "pinctrl-merrifield" when "INTC1002" is present in ACPI tables:

[    5.825231] gpio gpiochip0: (0000:00:0c.0): could not create pin range
[    5.825710] gpio-merrifield 0000:00:0c.0: failed to add GPIO pin range

Signed-off-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx>
---
Andy: I'm not sure is this with the next patch the right fix or would it be
possible to just delete this "pinctrl-merrifield" initialization filei? I
went to this path since I don't know are there platforms without
"INTC1002" in their ACPI tables or do some users want to run non-ACPI
kernels.
---
 .../x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
index 4de8a664e6a1..43f801b66c1a 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
@@ -40,4 +40,4 @@ static int __init mrfld_pinctrl_init(void)
 
 	return -ENODEV;
 }
-arch_initcall(mrfld_pinctrl_init);
+device_initcall(mrfld_pinctrl_init);
-- 
2.20.1




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux