From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756852Ab3BVTtv (ORCPT ); Fri, 22 Feb 2013 14:49:51 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:52595 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808Ab3BVTts (ORCPT ); Fri, 22 Feb 2013 14:49:48 -0500 Message-ID: <5127CBD9.9050501@wwwdotorg.org> Date: Fri, 22 Feb 2013 12:49:45 -0700 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Rhyland Klein CC: Anton Vorontsov , David Woodhouse , Grant Likely , Rob Herring , linux-tegra@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 2/3] power: power_supply: Add core support for supplied_nodes References: <1361488272-21010-1-git-send-email-rklein@nvidia.com> <1361488272-21010-3-git-send-email-rklein@nvidia.com> In-Reply-To: <1361488272-21010-3-git-send-email-rklein@nvidia.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2013 04:11 PM, Rhyland Klein wrote: > With the growing support for dt, it make sense to try to make use of > dt features to make the general code cleaner. This patch is an > attempt to commonize how chargers and their supplies are linked. > > Following common dt convention, the "supplied-to" char** list is > replaced with phandle lists defined in the supplies which contain > phandles of their suppliers. > > This has the effect however of introducing an inversion in the internal > mechanics of how this information is stored. In the case of non-dt, > the char** list of supplies is stored in the charger. In the dt case, > a device_node * list is stored in the supplies of their chargers, > however this seems to be the only way to support this. When parsing the DT, you can convert from phandle (or struct device_node *) to the name of the referenced supply by simple lookup. So, you could store supply names rather than device_node *. Can't you then also fill in the referenced supply's existing char** list of supplies? Of course, making this interact-with/use -EPROBE_DEFERRED might be challenging, since this would be operating in the inverse order to other producer/consumer relationships, which might cause loops.