From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934700AbcIPMH0 (ORCPT ); Fri, 16 Sep 2016 08:07:26 -0400 Received: from foss.arm.com ([217.140.101.70]:54690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758006AbcIPMHS (ORCPT ); Fri, 16 Sep 2016 08:07:18 -0400 Subject: Re: [PATCH] of/platform: Initialise dev->fwnode appropriately To: Rob Herring References: <38259ab3716da072fab37f06d034329244491c13.1473865096.git.robin.murphy@arm.com> <20160915133657.GB14424@rob-hp-laptop> Cc: frowand.list@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, okaya@codeaurora.org, yisen.zhuang@huawei.com, salil.mehta@huawei.com From: Robin Murphy Message-ID: Date: Fri, 16 Sep 2016 13:07:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160915133657.GB14424@rob-hp-laptop> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/09/16 14:36, Rob Herring wrote: > On Wed, Sep 14, 2016 at 04:01:24PM +0100, Robin Murphy wrote: >> Whilst we're some of the way towards a universal firmware property >> interface, drivers which deal with both OF and ACPI probing end up >> having to do things like this: >> >> dev->of_node ? &dev->of_node->fwnode : dev->fwnode >> >> This seems unnecessary, when the OF code could instead simply fill in >> the device's fwnode when binding the of_node, and let the drivers use >> dev->fwnode either way. Let's give it a go and see what falls out. >> >> Signed-off-by: Robin Murphy >> --- >> drivers/of/platform.c | 2 ++ >> 1 file changed, 2 insertions(+) > > I've applied this, but what about non-platform devices such as i2c? I was indeed wondering that, coming from the perspective of DMA/IOMMU configuration which doesn't really apply beyond the PCI and platform buses. More generally, at this point it's largely for the benefit of subsystems which need to chuck around firmware data for other devices that don't exist yet (or at all), which maybe is just the DMA and IRQ layers. I guess beyond that it comes down to auditing the intersection between callers of the property API and OF-probed buses, then killing the dev_fwnode() helper in property.c and making sure nothing else breaks. The possible alternative would be pushing this right down into device_initialize(), but that seems a bit wrong. Thanks, Robin. > > Rob >