[PATCH 2/2] crypto - img-hash: Drop of_match_ptr for ID table

Herbert Xu herbert at gondor.apana.org.au
Fri Mar 17 01:30:32 PDT 2023


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.

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.

Cheers,
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the linux-arm-kernel mailing list