Subject: Re: [PATCH] powerpc: Remove device_type = "rtc" properties in .dts files

From: Matt Sealey <[email-masked]>
Date: Wed, 22 Oct 2008 13:40:50 -0500

Anton Vorontsov wrote:
> On Wed, Oct 22, 2008 at 08:38:03AM -0500, Matt Sealey wrote:
>> I'm extremely troubled that it is "not used in the code", surely 
>> device_type is checked as a legacy for Open Firmware (otherwise a lot of 
>> devices may never be detected!),
> 
> Checked where? 

of_find_device_by_type() goes through it and 
of_find_compatible_node() - while not directly, checks the 
type field of the node which is filled in from device_type 
BEFORE it checks the compatible property.

This isn't specific CHRP/FDT platform code it's in the generic 
tree scanning functions.

> platforms, the CHRP is running real OF, so it is irrelevant if it
> checks for device_type = "rtc" or not.)

Except when there is no compatible property because the device 
is adequately identified by device_type (for instance if you 
are looking for every serial port on a system, device_type is 
your only hope without checking for every different KIND of 
serial port you may ever possibly encounter.. or if you are 
checking for what kind of console OF attached you to (be it 
display/keyboard combination or serial or something else).

It's a useful property that should be kept around, you never 
know when it might be needed :D but of course since it's not 
in ePAPR, no point in shoving it in when "compatible" 
describes your board very very accurately anyway (except when 
you have no need to be very very accurate and are just looking 
for serial ports... :)

-- 
Matt Sealey <[email-masked]>
Genesi, Manager, Developer Relations