From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966373AbbJ3Wwo (ORCPT ); Fri, 30 Oct 2015 18:52:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43248 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965292AbbJ3Wwn (ORCPT ); Fri, 30 Oct 2015 18:52:43 -0400 Date: Fri, 30 Oct 2015 15:52:42 -0700 From: Greg Kroah-Hartman To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Alan Stern , Grant Likely , Mark Brown , Rob Herring , Tomeu Vizoso , Thierry Reding , Dmitry Torokhov , Geert Uytterhoeven , Michael Turquette Subject: Re: [RFD] Functional dependencies between devices Message-ID: <20151030225242.GA2480@kroah.com> References: <1623682.7KVblAB3KQ@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623682.7KVblAB3KQ@vostro.rjw.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2015 at 04:24:14PM +0100, Rafael J. Wysocki wrote: > My idea is to represent a supplier-consumer dependency between devices (or > more precisely between device+driver combos) as a "link" object containing > pointers to the devices in question, a list node for each of them and some > additional information related to the management of those objects, ie. > something like: > > struct device_link { > struct device *supplier; > struct list_head supplier_node; > struct device *consumer; > struct list_head consumer_node; > > }; > > In general, there will be two lists of those things per device, one list > of links to consumers and one list of links to suppliers. > > In that picture, links will be created by calling, say: > > int device_add_link(struct device *me, struct device *my_supplier, unsigned int flags); At first glance, I like this, nice. Now to see how well it can be implemented :) Again, nice job. greg k-h