From: Florian Meier <florian.meier-oZ8rN/sblLk@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rpi-kernel
<linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] i2c: Fallback to of_node of parent
Date: Sat, 16 Nov 2013 16:40:31 +0100 [thread overview]
Message-ID: <528791EF.9060505@koalo.de> (raw)
Many busses (e.g. tegra, omap, bcm2835)
need to set the of_node of the adapter
device to the one of the parent device, i.e.
adap->dev.of_node = pdev->dev.of_node;
As suggested by Stephen Warren, this could also
be done in the i2c core and it is a common mistake
to forget this line:
I2C: BCM2835: Linking platform nodes to adapter nodes
i2c: Fix device tree binding for i2c-cbus-gpio
Signed-off-by: Florian Meier <florian.meier-oZ8rN/sblLk@public.gmane.org>
Suggested-by: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
---
drivers/i2c/i2c-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 430c001..c8e33a5 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1310,6 +1310,9 @@ int i2c_add_adapter(struct i2c_adapter *adapter)
struct device *dev = &adapter->dev;
int id;
+ if (!dev->of_node && dev->parent)
+ dev->of_node = dev->parent->of_node;
+
if (dev->of_node) {
id = of_alias_get_id(dev->of_node, "i2c");
if (id >= 0) {
--
1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: Florian Meier <florian.meier@koalo.de>
To: Wolfram Sang <wsa@the-dreams.de>, Stephen Warren <swarren@wwwdotorg.org>
Cc: linux-i2c@vger.kernel.org,
linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] i2c: Fallback to of_node of parent
Date: Sat, 16 Nov 2013 16:40:31 +0100 [thread overview]
Message-ID: <528791EF.9060505@koalo.de> (raw)
Many busses (e.g. tegra, omap, bcm2835)
need to set the of_node of the adapter
device to the one of the parent device, i.e.
adap->dev.of_node = pdev->dev.of_node;
As suggested by Stephen Warren, this could also
be done in the i2c core and it is a common mistake
to forget this line:
I2C: BCM2835: Linking platform nodes to adapter nodes
i2c: Fix device tree binding for i2c-cbus-gpio
Signed-off-by: Florian Meier <florian.meier@koalo.de>
Suggested-by: Stephen Warren <swarren@wwwdotorg.org>
---
drivers/i2c/i2c-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 430c001..c8e33a5 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1310,6 +1310,9 @@ int i2c_add_adapter(struct i2c_adapter *adapter)
struct device *dev = &adapter->dev;
int id;
+ if (!dev->of_node && dev->parent)
+ dev->of_node = dev->parent->of_node;
+
if (dev->of_node) {
id = of_alias_get_id(dev->of_node, "i2c");
if (id >= 0) {
--
1.7.9.5
next reply other threads:[~2013-11-16 15:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 15:40 Florian Meier [this message]
2013-11-16 15:40 ` [PATCH] i2c: Fallback to of_node of parent Florian Meier
[not found] ` <528791EF.9060505-oZ8rN/sblLk@public.gmane.org>
2013-11-16 16:06 ` Wolfram Sang
2013-11-16 16:06 ` Wolfram Sang
2013-11-16 16:11 ` Florian Meier
2013-11-16 16:11 ` Florian Meier
[not found] ` <CABDT8WzUoPmPzDnjD3w+Oj=jUVcMf91+toWDS+hK6CrXLveCFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-16 16:59 ` Florian Meier
2013-11-16 16:59 ` Florian Meier
2013-11-25 8:46 ` Wolfram Sang
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=528791EF.9060505@koalo.de \
--to=florian.meier-oz8rn/sbllk@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.