[PATCH v2 06/28] drivers: Add generic helper to match by of_node

Suzuki K Poulose suzuki.poulose at arm.com
Mon Jun 17 09:59:03 UTC 2019


Hi

On 14/06/2019 21:31, Wolfram Sang wrote:
>> +
>> +int device_match_of_node(struct device *dev, const void *np)
>> +{
>> +	return dev->of_node == np;
>> +}
>> +EXPORT_SYMBOL_GPL(device_match_of_node);
> 
> Is it an option to 'static inline' this simple function in the header,
> saving the EXPORT?
> 

No. This is supposed to be passed on as a call back function pointer
for the APIs. Having it as a static inline, would simply replicate
the same function through the driver subsystems, which is one of the
issues that series is trying to solve. Also, by having them exported,
we can convert the new specialized device lookup functions,
*_find_device_by_<property> to be static inlines.

Suzuki


More information about the dri-devel mailing list