From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: [PATCH 6/6] i2c/pxa2xx: pass of_node from platform driver to adapter and publish Date: Thu, 2 Dec 2010 21:09:49 +0100 Message-ID: <1291320589-31570-7-git-send-email-bigeasy@linutronix.de> References: <1291320589-31570-1-git-send-email-bigeasy@linutronix.de> Return-path: In-Reply-To: <1291320589-31570-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Sebastian Andrzej Siewior , Dirk Brandewie List-Id: linux-i2c@vger.kernel.org the of_node will auto-publish devices which are added to the device tree. Commit 925bb9c6 aka ("of/i2c: Fix module load order issue caused by of_i2c.c) moved the of_i2c_register_devices() function from the i2c core back to the drivers. This patch does the same thing for the pxa driver. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Dirk Brandewie --- drivers/i2c/busses/i2c-pxa.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index c2089fe..294ac6c 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1118,12 +1119,16 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c->adap.algo_data = i2c; i2c->adap.dev.parent = &dev->dev; +#ifdef CONFIG_OF + i2c->adap.dev.of_node = dev->dev.of_node; +#endif ret = i2c_add_numbered_adapter(&i2c->adap); if (ret < 0) { printk(KERN_INFO "I2C: Failed to add bus\n"); goto eadapt; } + of_i2c_register_devices(&i2c->adap); platform_set_drvdata(dev, i2c); -- 1.7.3.2