On Fri, Mar 11, 2022 at 03:48:14PM +0100, Emil Renner Berthing wrote: > ..rather than multiple calls to of_device_is_compatible(). > For reference this is the patch I wrote for the StarFive JH7100 tree. > Feel free to use it or do something better as you see fit. > if (np) { > + unsigned long quirks = (unsigned long)of_device_get_match_data(p->dev); It can be done outside of the np check with device property APIs in use. Also it needs to use (uintptr_t) for better coverage. unsigned long quirks = (uintptr_t)device_get_match_data(p->dev); Or use data structure as driver_data. const struct ... *data = device_get_match_data(p->dev); -- With Best Regards, Andy Shevchenko