Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-26 Thread Guenter Roeck
On 09/26/2013 01:28 AM, Wolfram Sang wrote: Hi, What race condition? Userspace trying to access the name attribute before it is created. See http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ Thanks! Have you tried this with two instances? I don't think it will

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-26 Thread Wolfram Sang
Hi, > > What race condition? > > > > Userspace trying to access the name attribute before it is created. > See http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ Thanks! > > Have you tried this with two instances? I don't think it will work since > > class_register

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-26 Thread Wolfram Sang
Hi, What race condition? Userspace trying to access the name attribute before it is created. See http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ Thanks! Have you tried this with two instances? I don't think it will work since class_register modifies the

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-26 Thread Guenter Roeck
On 09/26/2013 01:28 AM, Wolfram Sang wrote: Hi, What race condition? Userspace trying to access the name attribute before it is created. See http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/ Thanks! Have you tried this with two instances? I don't think it will

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-25 Thread Guenter Roeck
On Wed, Sep 25, 2013 at 10:20:35PM +0200, Wolfram Sang wrote: > On Sat, Aug 31, 2013 at 09:30:19AM -0700, Guenter Roeck wrote: > > The 'name' attribute is needed for all i2c-dev class devices, meaning > > it can be created automatically by pointing to it in the class data > > structure. This

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-25 Thread Wolfram Sang
On Sat, Aug 31, 2013 at 09:30:19AM -0700, Guenter Roeck wrote: > The 'name' attribute is needed for all i2c-dev class devices, meaning > it can be created automatically by pointing to it in the class data > structure. This simplifies the code and reduces the probability for race > conditions.

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-25 Thread Wolfram Sang
On Sat, Aug 31, 2013 at 09:30:19AM -0700, Guenter Roeck wrote: The 'name' attribute is needed for all i2c-dev class devices, meaning it can be created automatically by pointing to it in the class data structure. This simplifies the code and reduces the probability for race conditions. What

Re: [PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-09-25 Thread Guenter Roeck
On Wed, Sep 25, 2013 at 10:20:35PM +0200, Wolfram Sang wrote: On Sat, Aug 31, 2013 at 09:30:19AM -0700, Guenter Roeck wrote: The 'name' attribute is needed for all i2c-dev class devices, meaning it can be created automatically by pointing to it in the class data structure. This simplifies

[PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-08-31 Thread Guenter Roeck
The 'name' attribute is needed for all i2c-dev class devices, meaning it can be created automatically by pointing to it in the class data structure. This simplifies the code and reduces the probability for race conditions. Signed-off-by: Guenter Roeck --- drivers/i2c/i2c-dev.c | 32

[PATCH] i2c: i2c-dev: Create 'name' attribute automatically

2013-08-31 Thread Guenter Roeck
The 'name' attribute is needed for all i2c-dev class devices, meaning it can be created automatically by pointing to it in the class data structure. This simplifies the code and reduces the probability for race conditions. Signed-off-by: Guenter Roeck li...@roeck-us.net --- drivers/i2c/i2c-dev.c