Messages in this thread | | | Date | Wed, 7 Dec 2016 19:07:15 +0000 | From | Mark Rutland <> | Subject | Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated driver |
| |
On Wed, Dec 07, 2016 at 05:55:51PM +0000, Luis Oliveira wrote: > +#ifndef CONFIG_ACPI > + if (!device_property_match_string(&pdev->dev, "mode", "slave")) > + i2c_dw_configure_slave(pdev); > + else > +#endif
This kind of ifdeffery doesn't make sense. A single kernel binary may support both ACPI and DT (but only one is used at runtime). Note that this is the case for arm64 (our Kconfig has select OF, and our defconfig has CONFIG_ACPI=y), so this logic is broken for DT arm64 platforms.
If you're trying to ensure that this *only* works in the DT case, explicitly check for an of_node, or use the of_* accessors.
That applies for all instances of this pattern in this driver.
Thanks, Mark.
| |