Re: [PATCH v2] leds: triggers: send uevent when changing triggers

Colin Cross
2012-08-07T20:47:26Z

On Tue, Aug 7, 2012 at 1:42 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Aug 07, 2012 at 12:58:15PM -0700, Colin Cross wrote:
>> Some triggers create sysfs files when they are enabled. Send a uevent
>> "change" notification whenever the trigger is changed to allow userspace
>> processes such as udev to modify permissions on the new files.
>>
>> A change notification will also be sent during registration of led class
>> devices or led triggers if the default trigger of an led class device
>> is found.
>
> Why would a change event be needed at this point in time? Nothing would
> have changed from the original "add" notification, right?

If the led class device has a default trigger configured,
device_create will called before the trigger has been set and the
trigger sysfs files have been created. The "change" notification will
happen after the extra files have been created.