Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1051194lqo; Sat, 11 May 2024 05:36:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXavwdE7W8PPnPLjwB7xbcycFhPWjLMrQrhA7qvOotdVfTo8vLDw9q83+cbPMDnmeFoGM7GK+SbP2YgT7fCaYHc9t99YY5J/NXCCQPcgQ== X-Google-Smtp-Source: AGHT+IETbv2Op7h0ATMeBZYNVEAJZdVKqC+UxN9V29oXmgLKJ0AMtrWnpE4DoZWaha3hv5dGH6OO X-Received: by 2002:a05:6214:4806:b0:6a0:def5:8281 with SMTP id 6a1803df08f44-6a16791bce2mr88940536d6.11.1715430997117; Sat, 11 May 2024 05:36:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715430997; cv=pass; d=google.com; s=arc-20160816; b=USZHLC+iRJ9c/CLiGji9nWApmC2JWToP1bbxxUoetu2DMRgE5jOdhfjutBXL6lHhpQ E+oAVJDewD4NzSeWZaLEBpj4hIU5p8q9WluNOuqJY31HVmZji/pjxd0h4QVSmZKk9Y6M qAPTM1UdHgg/caQ66wmuqv6o88QQA938nqPf03bFAFamTHpUP3xWXPM16npcDjPwZ7Fd XqXI0STqhm4jgvyN7FGsFkGMs6sUT+AxQcqeuVS2s+IImFGS75jMGYN1SwaArjGfvLT7 TAfiMwrnVq4DRPc8SSvQZRvOY6/N2QyxozSkMQYU3AFAzfSR8V3MuKvevYtsiOnZ4qI6 6Ycg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gLhuT+oWLYe8VAd+4kBJ2yh31MpICmbd3ylxkbHpSO0=; fh=s8tDITE9pv/wZDV1F0l0j04EpuKG6KQip2v+js6oBnw=; b=UhUnBt0z+mS5XB7w6p4wfgvPB6mtEv/MmaHz37RZHBySUDUPKz56y0pVladhqHCcfk NQ2XgA8g1oRQTFsul9VZsAbziXL26bsQDYHokEaEkzhuLmO/B/ZlWAG/XsQwru6Qpb7z cmLn/+y4xUSYFpMMp3J0E/GOkgMFRxRfHdeW4ARGSDLY+Y/Ze2es6WQGx6q/l4XDch4I 3MnALOGnEvMC+iNx7QNSKbd8kPoEpHzr3sVueZY0YWrtbkYe7fnB9r+96DsmFYXQvhRL nTsXiPI9+Huew7/qhZEuUhh/Qdm8Acm+ZY9Dx4THrkpC/ttR489Y1pBgFGqJUYMyCDOF NIOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OtMisOm7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4532-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d6d11si58469066d6.45.2024.05.11.05.36.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 05:36:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4532-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OtMisOm7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4532-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4532-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BC10A1C20BF6 for ; Sat, 11 May 2024 12:36:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2B1A1D54F; Sat, 11 May 2024 12:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OtMisOm7" X-Original-To: linux-bluetooth@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 A0EB350286 for ; Sat, 11 May 2024 12:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715430991; cv=none; b=gQ9KlC5IWKEzQiIeOPUweWZg4BKKChlbddbu1f171Kx9GSPPvO4yXpH482bR7MPmNWHud028qPjsk/NXfU8Y+Zmj+UXR7NadUFc2JXKLj39efMJX9BIkJ6Hd2FaoiDUXxCTWsYtebn+RO5eI+wovIJwF6HQwpvYnL7IcMJrve4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715430991; c=relaxed/simple; bh=tdF40W5/p7BNpqk7dLQhpUrEV33iYOSR9aYMnXyOXoY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qWn5T5xKOL3ErihRDXBgmvWBmKHa8Zcy/jt5bd4cKgBe69HP3b5slvXe36tfN2u7GJYGDomiX0r5lA64JvKYumu8Hg3ZwGLySAfxvakD3sEt6ORZUowFw2MDIrCJLQtNZ1vRbi5iMn2BlqlgtgiBc/LQg5delboh6csiJEo7tn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OtMisOm7; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715430988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gLhuT+oWLYe8VAd+4kBJ2yh31MpICmbd3ylxkbHpSO0=; b=OtMisOm7F11ukdOBpNBZhBItMrTlL8wO/JBuapilYNVbdNkiDcB17iiLo/FAnVP6ViMfWB 2ZGAizsYmImlra/yirkvkdshHF+HJ/8us5JSXgryRrHOThmZ8wbqJFgQUrtzLu8n7P3gm1 dkzD7TgHV6gD8fvbcibJG0BuFAmVIss= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-cJlqn6TuOrqo0Sepr6n1eg-1; Sat, 11 May 2024 08:35:12 -0400 X-MC-Unique: cJlqn6TuOrqo0Sepr6n1eg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04A4F80027F; Sat, 11 May 2024 12:35:12 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB02C2087D71; Sat, 11 May 2024 12:35:10 +0000 (UTC) From: Hans de Goede To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Hans de Goede , Pavel Machek , Lee Jones , linux-leds@vger.kernel.org, linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: Use led_set_brightness() in LED trigger activate() callback Date: Sat, 11 May 2024 14:35:10 +0200 Message-ID: <20240511123510.22303-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 A LED trigger's activate() callback gets called when the LED trigger gets activated for a specific LED, so that the trigger code can ensure the LED state matches the current state of the trigger condition (LED_FULL when HCI_UP is set in this case). led_trigger_event() is intended for trigger condition state changes and iterates over _all_ LEDs which are controlled by this trigger changing the brightness of each of them. In the activate() case only the brightness of the LED which is being activated needs to change and that LED is passed as an argument to activate(), switch to led_set_brightness() to only change the brightness of the LED being activated. Note this is compile tested only. Signed-off-by: Hans de Goede --- net/bluetooth/leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/leds.c b/net/bluetooth/leds.c index f46847632ffa..6e349704efe4 100644 --- a/net/bluetooth/leds.c +++ b/net/bluetooth/leds.c @@ -48,7 +48,7 @@ static int power_activate(struct led_classdev *led_cdev) htrig = to_hci_basic_led_trigger(led_cdev->trigger); powered = test_bit(HCI_UP, &htrig->hdev->flags); - led_trigger_event(led_cdev->trigger, powered ? LED_FULL : LED_OFF); + led_set_brightness(led_cdev, powered ? LED_FULL : LED_OFF); return 0; } -- 2.44.0