|
From: | Gerd Hoffmann |
Subject: | Re: [Qemu-devel] [PATCH 2/4] Add device tree machine |
Date: | Thu, 11 Jun 2009 16:22:38 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 |
On 06/11/09 15:39, Paul Brook wrote:
On Thursday 11 June 2009, Gerd Hoffmann wrote:Where do device properties come from? Only the fdt tree? If so, do we need the property lists in the first place? We could get them directly from the fdt tree instead.The FDT doesn't contain any type information.
Which isn't a issue IMHO. The driver which needs the value knows the type to expect, doesn't it?
To outline in more detail what I mean: Now we have (picking an example with int type): dt_add_props(), calling fdt_getprop() + fdt32_to_cpu() + qdev_set_prop_int(). And i2c_slave_qdev_init(), calling qdev_get_prop_int(). I think instead we can do: Have a helper named --say -- qdev_get_fdt_int(), calling fdt_getprop() + fdt32_to_cpu(), returning an int. Then have i2c_slave_qdev_init() calling qdev_get_fdt_int().i.e. don't extract and save the properties at all, instead have helper functions to get them directly from the fdt tree.
cheers, Gerd
[Prev in Thread] | Current Thread | [Next in Thread] |