From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MElCx-0001pq-TS for qemu-devel@nongnu.org; Thu, 11 Jun 2009 10:24:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MElCt-0001oa-T4 for qemu-devel@nongnu.org; Thu, 11 Jun 2009 10:24:47 -0400 Received: from [199.232.76.173] (port=40172 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MElCt-0001oX-QT for qemu-devel@nongnu.org; Thu, 11 Jun 2009 10:24:43 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57199) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MElCt-0005Pq-FM for qemu-devel@nongnu.org; Thu, 11 Jun 2009 10:24:43 -0400 Message-ID: <4A31132E.5040307@redhat.com> Date: Thu, 11 Jun 2009 16:22:38 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/4] Add device tree machine References: <20090610173803.4674.82538.stgit@wren.home> <20090610173821.4674.58171.stgit@wren.home> <4A31078C.9000403@redhat.com> <200906111439.26304.paul@codesourcery.com> In-Reply-To: <200906111439.26304.paul@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org 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