On 17/03/2023 09:30, Herbert Xu wrote: > On Fri, Mar 17, 2023 at 09:12:05AM +0100, Krzysztof Kozlowski wrote: >> >> The missing dependency on OF is not a problem. The OF code is prepare >> and will work fine if the driver is built with !OF. The point is that >> with !OF after dropping of_match_ptr(), the driver could match via ACPI >> (PRP0001). If we make it depending on OF, the driver won't be able to >> use it, unless kernel is built with OF which is unlikely for ACPI systems. > > I know it works now, but what I'm saying is that if struct device_driver > actually had of_match_table as conditional on OF, which ideally it > should, then removing of_match_ptr will break the build. > > I know that it's currently unconditionally defined, but that's > just wasting memory on non-OF machines such as x86. That's not true. There is no waste because having it on x86 allows to match via ACPI PRP0001. It's on purpose there. > So either this driver is OF-only, in which case you can drop > the of_match_ptr but must add a dependency on OF. Or it's not > OF-only, in which case you should use of_match_ptr. There are OF-drivers used on ACPI and x86/arm64. The true question is whether this device will be ever used on ACPI via PRP0001, but you are not referring to this? Best regards, Krzysztof