From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: Re: [PATCH] i2c: let the core register devices from devicetree Date: Thu, 14 Jun 2012 12:42:24 +0200 Message-ID: <20120614124224.58a9e823@endymion.delvare> References: <1339622215-4733-1-git-send-email-w.sang@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1339622215-4733-1-git-send-email-w.sang@pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Wolfram Sang Cc: Viresh Kumar , Mauro Carvalho Chehab , Tony Lindgren , Linus Walleij , Haojian Zhuang , Grant Likely , Laxman Dewangan , linux-i2c@vger.kernel.org, Peter Korsgaard , Kukjin Kim , Stephen Warren , Barry Song <21cnbao@gmail.com>, Jochen Friedrich , Deepak Sikri , Li Yang , Haavard Skinnemoen , Pawel Moll , Vitaly Wool , Wolfram Sang , Sascha Hauer , Rusty Russell , Tang Yuantian , Olof Johansson , Magnus Damm List-Id: linux-i2c@vger.kernel.org Hi Wolfram, On Wed, 13 Jun 2012 23:12:10 +0200, Wolfram Sang wrote: > Currently, every driver has to do it on its own, but it should be done > in the core, like we already do with board_info structs. > > Signed-off-by: Wolfram Sang > --- > > Based on v3.5-rc2. Only build tested, I don't have a OF based device > around at the moment. > (...) > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c > index a6ad32b..4791833 100644 > --- a/drivers/i2c/i2c-core.c > +++ b/drivers/i2c/i2c-core.c > @@ -39,6 +39,7 @@ > #include > #include > #include > +#include > #include > > #include "i2c-core.h" > @@ -880,6 +881,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap) > #endif > > /* create pre-declared device nodes */ > + of_i2c_register_devices(adap); > + > if (adap->nr < __i2c_first_dynamic_bus_num) > i2c_scan_static_board_info(adap); > This was proposed in the past, and rejected because of dependency issues. I don't think the situation changed. of_i2c needs i2c-core for i2c_new_device(), and with the change above, i2c-core needs of_i2c for of_i2c_register_devices(). If either is built as a module, it will fail. This might be the reason why of_spi ended up being merged into drivers/spi according to Grant? I have no objection to the same being done for of_i2c if it makes everybody happy, as long as it does not create additional dependencies (i.e. I2C should not depend on OF.) -- Jean Delvare