On Wed, Apr 16, 2014 at 12:15 PM, Mark Brown broonie@kernel.org wrote:
On Wed, Apr 16, 2014 at 11:10:15AM -0500, Rob Herring wrote:
Yes. If this going to be a common pattern, a of_get_machine_compatible() helper might be useful. Usually, any code searching by path makes me suspicious.
I've always been surprised we don't have more infrastructure for quirking off machine type in a similar way to how ACPI systems use DMI.
We used to have machine_is_blah which is kind of replaced by of_machine_is_compatible, but yes that is a bit limited. What the fsl ssi driver is doing isn't really a quirk anyway.
PCI also has a whole infrastructure for applying quirks. We could do something similar which could add/fix properties or do various setup. Then we'd be able to scatter calls everywhere:
OF_FIXUP("some-compatible-str", fixup_function);
I don't know that we want to encourge that, but would be a way to separate handling old/broken bindings separately from current code paths. I guess the question is whether we have many existing cases (PPC, I'm looking at you) that would benefit.
BTW, I did propose something similar with conditional initcalls a while back[1]. Perhaps as a fixup would be more acceptable than an initcall.
Rob
[1] http://comments.gmane.org/gmane.linux.drivers.devicetree/50117