Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-26 Thread Benjamin Herrenschmidt
On Wed, 2014-11-26 at 19:39 -0800, Greg KH wrote: > Are you going to resend a changed version of this? Yes, I've been distracted by a few other things, but I suppose I should do it :-) Possibly tomorrow. Arnd, are you doing that helper you suggested to get to the of_node or should I ? Cheers,

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-26 Thread Greg KH
On Thu, Nov 13, 2014 at 12:10:47PM +1100, Benjamin Herrenschmidt wrote: > So I've been annoyed lately with having a bunch of devices such as i2c > eeproms (for use by VPDs, server world !) and other bits and pieces that > I want to be able to identify from userspace, and possibly provide >

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-26 Thread Greg KH
On Thu, Nov 13, 2014 at 12:10:47PM +1100, Benjamin Herrenschmidt wrote: So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I want to be able to identify from userspace, and possibly provide additional

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-26 Thread Benjamin Herrenschmidt
On Wed, 2014-11-26 at 19:39 -0800, Greg KH wrote: Are you going to resend a changed version of this? Yes, I've been distracted by a few other things, but I suppose I should do it :-) Possibly tomorrow. Arnd, are you doing that helper you suggested to get to the of_node or should I ? Cheers,

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Grant Likely
On Wed, Nov 19, 2014 at 3:39 PM, Rob Herring wrote: > On Wed, Nov 19, 2014 at 8:49 AM, Arnd Bergmann wrote: >> On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: >>> > static inline struct device_node *dev_of_node(struct device *of_node) >>> > { >>> > if (!IS_ENABLED(CONFIG_OF))

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Rob Herring
On Wed, Nov 19, 2014 at 8:49 AM, Arnd Bergmann wrote: > On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: >> > static inline struct device_node *dev_of_node(struct device *of_node) >> > { >> > if (!IS_ENABLED(CONFIG_OF)) >> > return NULL; >> > >> > return

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: > > static inline struct device_node *dev_of_node(struct device *of_node) > > { > > if (!IS_ENABLED(CONFIG_OF)) > > return NULL; > > > > return dev->of_node; > > } > > > > Adding the IS_ENABLED() in a lot of

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Rob Herring
On Wed, Nov 19, 2014 at 2:38 AM, Arnd Bergmann wrote: > On Wednesday 19 November 2014 13:35:44 Benjamin Herrenschmidt wrote: >> On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: >> > Hi Rob, >> > >> > >> diff --git a/drivers/base/core.c b/drivers/base/core.c >> > >> index 20da3ad..8c7b607

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 13:35:44 Benjamin Herrenschmidt wrote: > On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: > > Hi Rob, > > > > >> diff --git a/drivers/base/core.c b/drivers/base/core.c > > >> index 20da3ad..8c7b607 100644 > > >> --- a/drivers/base/core.c > > >> +++

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 13:35:44 Benjamin Herrenschmidt wrote: On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: Hi Rob, diff --git a/drivers/base/core.c b/drivers/base/core.c index 20da3ad..8c7b607 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -493,6

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Rob Herring
On Wed, Nov 19, 2014 at 2:38 AM, Arnd Bergmann a...@arndb.de wrote: On Wednesday 19 November 2014 13:35:44 Benjamin Herrenschmidt wrote: On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: Hi Rob, diff --git a/drivers/base/core.c b/drivers/base/core.c index 20da3ad..8c7b607 100644

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: static inline struct device_node *dev_of_node(struct device *of_node) { if (!IS_ENABLED(CONFIG_OF)) return NULL; return dev-of_node; } Adding the IS_ENABLED() in a lot of drivers isn't

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Rob Herring
On Wed, Nov 19, 2014 at 8:49 AM, Arnd Bergmann a...@arndb.de wrote: On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: static inline struct device_node *dev_of_node(struct device *of_node) { if (!IS_ENABLED(CONFIG_OF)) return NULL; return

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-19 Thread Grant Likely
On Wed, Nov 19, 2014 at 3:39 PM, Rob Herring robherri...@gmail.com wrote: On Wed, Nov 19, 2014 at 8:49 AM, Arnd Bergmann a...@arndb.de wrote: On Wednesday 19 November 2014 08:45:58 Rob Herring wrote: static inline struct device_node *dev_of_node(struct device *of_node) { if

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Benjamin Herrenschmidt
On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: > Hi Rob, > > >> diff --git a/drivers/base/core.c b/drivers/base/core.c > >> index 20da3ad..8c7b607 100644 > >> --- a/drivers/base/core.c > >> +++ b/drivers/base/core.c > >> @@ -493,6 +493,15 @@ static int device_add_attrs(struct device *dev)

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Benjamin Herrenschmidt
On Tue, 2014-11-18 at 10:37 -0600, Rob Herring wrote: > On Wed, Nov 12, 2014 at 7:10 PM, Benjamin Herrenschmidt > wrote: > > So I've been annoyed lately with having a bunch of devices such as i2c > > eeproms (for use by VPDs, server world !) and other bits and pieces that > > I want to be able to

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Jeremy Kerr
Hi Rob, > struct device doesn't have an of_node member if !CONFIG_OF, so we'll > need to disable this block in the preprocessor. Scratch that, I was looking at the wrong header - we do indeed have the of_node available independently of CONFIG_OF, and this makes the logic a little cleaner.

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Jeremy Kerr
Hi Rob, >> diff --git a/drivers/base/core.c b/drivers/base/core.c >> index 20da3ad..8c7b607 100644 >> --- a/drivers/base/core.c >> +++ b/drivers/base/core.c >> @@ -493,6 +493,15 @@ static int device_add_attrs(struct device *dev) >> goto err_remove_dev_groups; >> }

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Rob Herring
On Wed, Nov 12, 2014 at 7:10 PM, Benjamin Herrenschmidt wrote: > So I've been annoyed lately with having a bunch of devices such as i2c > eeproms (for use by VPDs, server world !) and other bits and pieces that > I want to be able to identify from userspace, and possibly provide > additional data

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Rob Herring
On Wed, Nov 12, 2014 at 7:10 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I want to be able to identify from userspace, and possibly

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Jeremy Kerr
Hi Rob, diff --git a/drivers/base/core.c b/drivers/base/core.c index 20da3ad..8c7b607 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -493,6 +493,15 @@ static int device_add_attrs(struct device *dev) goto err_remove_dev_groups; } +#ifdef

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Jeremy Kerr
Hi Rob, struct device doesn't have an of_node member if !CONFIG_OF, so we'll need to disable this block in the preprocessor. Scratch that, I was looking at the wrong header - we do indeed have the of_node available independently of CONFIG_OF, and this makes the logic a little cleaner. Cheers,

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Benjamin Herrenschmidt
On Tue, 2014-11-18 at 10:37 -0600, Rob Herring wrote: On Wed, Nov 12, 2014 at 7:10 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I

Re: [PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-18 Thread Benjamin Herrenschmidt
On Wed, 2014-11-19 at 10:39 +1100, Jeremy Kerr wrote: Hi Rob, diff --git a/drivers/base/core.c b/drivers/base/core.c index 20da3ad..8c7b607 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -493,6 +493,15 @@ static int device_add_attrs(struct device *dev)

[PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-12 Thread Benjamin Herrenschmidt
So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I want to be able to identify from userspace, and possibly provide additional data about from FW. Basically, it boils down to correlating the sysfs

[PATCH] drivers/core/of: Add symlink to device-tree from devices with an OF node

2014-11-12 Thread Benjamin Herrenschmidt
So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I want to be able to identify from userspace, and possibly provide additional data about from FW. Basically, it boils down to correlating the sysfs