Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1551775rwe; Thu, 1 Sep 2022 22:43:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR5s+USQAQ8Mz144WDjHIxTTQ+0o979tywG07+cO9KqiFhU3s+AZJN3LCCeoK2XYBgwLiBI9 X-Received: by 2002:a63:4719:0:b0:42c:5586:de2 with SMTP id u25-20020a634719000000b0042c55860de2mr17438314pga.158.1662097414867; Thu, 01 Sep 2022 22:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662097414; cv=none; d=google.com; s=arc-20160816; b=Pr/GsT3rhOA/1OW2HGEjC2t0D2Wwweh/IkRYthG5OW51+eBHQDSqpuv1mwFys8hNz9 ViRIRmHQveh00CM5FnaskeWAnuxAgV3wnqi73JwBwTm9b4LLJ2EwhbVgBjNPmW2Wyu/H mcLNAa9QRnAWHqn+yFbXJ2Mxb6Jl5cngixj54eB/9eu/iC+hFqZpzyM5lez5v5yHfYfF puy72c+7VuW+lRxuGIB1YkCVF4XAMTYqn8MZAokSzN6zA0/WBYbq9KO01ZKZYVxRVShg uZ+53Da8j+ap3zMo5cVY83wJE1275zTyd2sBOGjMKZvtAVKNyBVog51CYwacEB9oj+sV 459w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CjdSnX8tKDWhdJtdqaneyF+qDLboAux9fkOeHQPAim8=; b=A27XnwQ7SLZNu3SfuqmZrGPXgsMX8iELx+xYfpK68+IvQ7TyfdA0cjPB5lJkb1ZX+6 s8i9NBcU+RzVCLqoe8ByzfGGY17TuaZyXGhLiKOtRrTsBvpxhtxF/eXgzYzcMiN6Af4c e+HQIzekTEN4ZL4W5hHeAJ3Hq6fzrFDEDZob1PyruA3JMinhXTEVJotoaDOhT9JFg4x8 +Z3hRd9Edi9bKJNt1BwAGSJTh4xAHfsE9IrioDwSRhMZd1ppi8xI315OlpEuRtc8Ramn Bru85hQZIAj7/U8BbpeXFU8YwFF4gg5slOe84eDEofS47SusQuVc4RaMmLu4QXlJ67L3 6dPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TlcQlare; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i26-20020a633c5a000000b00419c3bbce5bsi951958pgn.795.2022.09.01.22.43.23; Thu, 01 Sep 2022 22:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TlcQlare; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235026AbiIBFfv (ORCPT + 99 others); Fri, 2 Sep 2022 01:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiIBFft (ORCPT ); Fri, 2 Sep 2022 01:35:49 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34FA647B86; Thu, 1 Sep 2022 22:35:48 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id r6so731506qtx.6; Thu, 01 Sep 2022 22:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=CjdSnX8tKDWhdJtdqaneyF+qDLboAux9fkOeHQPAim8=; b=TlcQlare3b/VilolwjEXzA6BdpmoQkz/xdaauz/exhPyFGr6lkRGvTCygYknIv+vAj XJvFfnhlxEp6PtoLzl8yG51c3s1m6mC7c8juPVL3zkBhdNqFxbXnXZaiOMhlsLD0pLoX R4/+SR11V9ydjoLqIrYx5fylgPlv8Pizf8nnhgGdqiSX6p+a5sncIqO/BdCEAstda1n5 YIASWyzrnaoF0L7S2vJlsONM+VrH7iWGpbuVxBh98rahNbmrDgoxJAVDyDPQVmluWFil XarB8oM3mcu76xMForVvySFcfLisYRuyQwpXoqVZooGxGicqU273tSN3GzcT8BhaP35Y Ai/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=CjdSnX8tKDWhdJtdqaneyF+qDLboAux9fkOeHQPAim8=; b=8NQxIIbPs0SPOcyb3Nl5NHdcGJIvyZvZTukeKlHL0yiAHtIUZfS8mcSRb6h4sgTyEJ tmBM859RNEf4FYHUDLZBmE9mKM4j6Rjm8fCtyvYvAMj19Cw1PnyBmUB2NbAgIBYiylqB iNMTdV6m854JvfKT/xsaTDH/9daBs3Z+7LDpYr1hbO8q1IchJOSRiVbONtqfnYm0oSYV Fd2L0NAAE9CSClUXptIm0o9e0gjiWiCGsq8HmMaOJLSg+FxryRHnEIkUy31K7iN8Da4O JNy0u+K7f0y96ply2+WLrx6uiGO1lRZ9MEbH/9dN9uL5gS/og3TaRVZX8whOot09z/Cw x63g== X-Gm-Message-State: ACgBeo1ZRjVxHKs4kjhe6oUz4kFDHlUqeActAnmbr7tNqmJK/rOFtZs1 rrj+mCWkcFBkRJbzsmSb/yavwUkak4cQ+ebvrPOBRQRQjOQ= X-Received: by 2002:a05:622a:40a:b0:343:77ba:727f with SMTP id n10-20020a05622a040a00b0034377ba727fmr27146665qtx.481.1662096947294; Thu, 01 Sep 2022 22:35:47 -0700 (PDT) MIME-Version: 1.0 References: <20220824114927.79231-1-mmkurbanov@sberdevices.ru> <20220901224345.fy6xvbpdn4axtlks@Rockosov-MBP> In-Reply-To: <20220901224345.fy6xvbpdn4axtlks@Rockosov-MBP> From: Andy Shevchenko Date: Fri, 2 Sep 2022 08:35:12 +0300 Message-ID: Subject: Re: [PATCH v1] leds: trigger: pattern: notify userpace if pattern finished To: Dmitry Rokosov Cc: Martin Kurbanov , Pavel Machek , Raphael Teysseyre , Baolin Wang , Linux LED Subsystem , Linux Kernel Mailing List , kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 2, 2022 at 1:43 AM Dmitry Rokosov 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