lkml.org 
[lkml]   [2012]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] leds: triggers: send uevent when changing triggers
On Fri, Jul 27, 2012 at 12:51 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Jul 26, 2012 at 01:03:11PM +0800, Bryan Wu wrote:
>> Just one quick patch for my idea: emitting a uevent in sysfs_create_file().
>>
>> --
>> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
>> index 00012e3..04da869 100644
>> --- a/fs/sysfs/file.c
>> +++ b/fs/sysfs/file.c
>> @@ -570,10 +570,14 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd,
>> const struct attribute *attr,
>>
>> int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
>> {
>> + int err = 0;
>> +
>> BUG_ON(!kobj || !kobj->sd || !attr);
>>
>> - return sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR);
>> + err = sysfs_add_file(kobj->sd, attr, SYSFS_KOBJ_ATTR);
>> + kobject_uevent(kobj, KOBJ_CHANGE);
>
> That's a veritable flood of change events when a new kobject is created,
> right? It also created uevents for a device that has not told userspace
> that it is even present, which could cause massive confusion, don't you
> think?
>

Indeed, this is unacceptable. I reworked a new patchset and just sent
our for you review.

Thanks,
-Bryan


\
 
 \ /
  Last update: 2012-07-27 06:42    [W:0.105 / U:3.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site