From patchwork Tue Aug 8 21:04:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 13347055 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B6E2174C1 for ; Tue, 8 Aug 2023 21:06:12 +0000 (UTC) Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203ED5A74 for ; Tue, 8 Aug 2023 14:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=zXQU5nftJUwqDXbgW7ERPV1vkM/LkTMl+b3TCckj99o=; b=ab84kOno4qIrJvOJPOcYfDc/FK nD/SaSkvV4Q4rXmX53vKCj5gNcKvaZx061z8jhMwYpCtk30eGeH1+t7MWo+pgBJQTx5I0gMjSXnMr L0krI/k56GMoWD+prgQ9T3AspCdH2+GbMHQ/wMpJxedObwhvyKbe1QNOlSRFkLc878/M=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qTTsw-003WGb-Uh; Tue, 08 Aug 2023 23:04:58 +0200 From: Andrew Lunn To: netdev Cc: Heiner Kallweit , Russell King , Simon Horman , Christian Marangi , Daniel Golle , Andrew Lunn Subject: [PATCH net-next v3 4/4] leds: trig-netdev: Disable offload on deactivation of trigger Date: Tue, 8 Aug 2023 23:04:36 +0200 Message-Id: <20230808210436.838995-5-andrew@lunn.ch> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230808210436.838995-1-andrew@lunn.ch> References: <20230808210436.838995-1-andrew@lunn.ch> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Ensure that the offloading of blinking is stopped when the trigger is deactivated. Calling led_set_brightness() is documented as stopping offload and setting the LED to a constant brightness. Suggested-by: Daniel Golle Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman --- drivers/leds/trigger/ledtrig-netdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 3d215a556e20..42f758880ef8 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -595,6 +595,8 @@ static void netdev_trig_deactivate(struct led_classdev *led_cdev) cancel_delayed_work_sync(&trigger_data->work); + led_set_brightness(led_cdev, LED_OFF); + dev_put(trigger_data->net_dev); kfree(trigger_data);