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 wo

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 modi

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 simpli

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

[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 +++