Re: [PATCH v2 2/2] leds: trigger: pattern: notify usespace if pattern finished

From: Andy Shevchenko
Date: Mon Nov 21 2022 - 08:27:24 EST


On Mon, Nov 21, 2022 at 2:39 PM Martin Kurbanov
<mmkurbanov@xxxxxxxxxxxxxx> wrote:
>
> In the current moment, userspace caller can schedule LED pattern with

a LED pattern

> appropriate parameters, but it doesn't have ability to listen to any
> events indicated pattern finished. This patch implements such an event
> using sysfs node and sysfs_notify_dirent() call.

...

> +Date: October 2022
> +KernelVersion: 6.1

It can't be. Have you read my previous comments?

...

> + 1 means pattern is running and number 0 are finish or not run.

are finished

...

> +static void pattern_trig_remove_is_running(struct led_classdev *led_cdev)
> +{
> + struct pattern_trig_data *data = led_get_trigger_data(led_cdev);
> +
> + sysfs_put(data->is_running_kn);
> + device_remove_file(led_cdev->dev, &dev_attr_is_running);
> +}

If the file is opened at this time, what would happen during execution
of this function?

--
With Best Regards,
Andy Shevchenko