On 03/13/2012 03:34 PM, David Miller wrote:
> From: Dong Aisheng <[email protected]>
> Date: Tue, 13 Mar 2012 19:40:05 +0800
>
>> From: Dong Aisheng <[email protected]>
>>
>> This function will return 1 even the device node passed in
>> is NULL which is a little error-prone.
>> Change to return 0 if the device node passed in is NULL.
>>
>> Signed-off-by: Dong Aisheng <[email protected]>
>
> I think this is a hard error and therefore BUG_ON(!device) is
> more appropriate.
Shouldn't removing a node from the dts and adding 'status = "disabled";'
to a node give the same behavior? Then you can do something like this:
if (of_device_is_available(of_find_compatible_node("blah")))
//foo
Rob
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss