Re: [PATCH v1] leds: trigger: pattern: notify userpace if pattern finished

From: Andy Shevchenko
Date: Fri Sep 02 2022 - 01:35:54 EST


On Fri, Sep 2, 2022 at 1:43 AM Dmitry Rokosov <ddrokosov@xxxxxxxxxxxxxx> wrote:

...

> > > +static void pattern_trig_remove_pattern_ended(struct led_classdev *led_cdev)
> > > +{
> > > + struct pattern_trig_data *data = led_get_trigger_data(led_cdev);
> > > +
> > > + sysfs_put(data->pattern_ended);
> > > + device_remove_file(led_cdev->dev, &dev_attr_pattern_ended);
> > > +}
> >
> > I'm wondering if you can always have a file and instead provide a
> > value there, so user space may use epoll() mechanism on that. It will
> > simplify your code here.
>
> Could you please explain what you mean? In the current implementation
> userspace can use epoll() already.

On the suddenly disappeared file?

--
With Best Regards,
Andy Shevchenko