public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Viresh Kumar <viresh.kumar@st.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Tony Lindgren <tony@atomide.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Haojian Zhuang <haojian.zhuang@marvell.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	linux-i2c@vger.kernel.org, Peter Korsgaard <jacmet@sunsite.dk>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Stephen Warren <swarren@nvidia.com>,
	Barry Song <21cnbao@gmail.com>,
	Jochen Friedrich <jochen@scram.de>,
	Deepak Sikri <deepak.sikri@st.com>, Li Yang <leoli@freescale.com>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Vitaly Wool <vitalywool@gmail.com>,
	Wolfram Sang <wolfram@the-dreams.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Tang Yuantian <B29983@freescale.com>,
	Olof Johansson <olof@lixom.net>, Magnus Damm <damm@opensource>
Subject: Re: [PATCH] i2c: let the core register devices from devicetree
Date: Thu, 14 Jun 2012 12:42:24 +0200	[thread overview]
Message-ID: <20120614124224.58a9e823@endymion.delvare> (raw)
In-Reply-To: <1339622215-4733-1-git-send-email-w.sang@pengutronix.de>

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 <w.sang@pengutronix.de>
> ---
> 
> 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 <linux/irqflags.h>
>  #include <linux/rwsem.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/of_i2c.h>
>  #include <asm/uaccess.h>
>  
>  #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

  parent reply	other threads:[~2012-06-14 10:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 21:12 [PATCH] i2c: let the core register devices from devicetree Wolfram Sang
2012-06-13 21:33 ` Benjamin Herrenschmidt
2012-06-14  9:14   ` Wolfram Sang
2012-06-14 11:35     ` Benjamin Herrenschmidt
2012-06-13 22:03 ` Stephen Warren
2012-06-14  4:40 ` Grant Likely
2012-06-14  7:31 ` Peter Korsgaard
2012-06-14  7:53 ` viresh kumar
2012-06-14 10:28 ` Pawel Moll
2012-06-14 10:42 ` Jean Delvare [this message]
2012-06-14 17:29 ` Linus Walleij
2012-06-21  1:16 ` Barry Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120614124224.58a9e823@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=21cnbao@gmail.com \
    --cc=B29983@freescale.com \
    --cc=damm@opensource \
    --cc=deepak.sikri@st.com \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@marvell.com \
    --cc=hskinnemoen@gmail.com \
    --cc=jacmet@sunsite.dk \
    --cc=jochen@scram.de \
    --cc=kgene.kim@samsung.com \
    --cc=ldewangan@nvidia.com \
    --cc=leoli@freescale.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=s.hauer@pengutronix.de \
    --cc=swarren@nvidia.com \
    --cc=tony@atomide.com \
    --cc=viresh.kumar@st.com \
    --cc=vitalywool@gmail.com \
    --cc=w.sang@pengutronix.de \
    --cc=wolfram@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox