Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp120019ybg; Mon, 8 Jun 2020 18:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygbHXx3d+08RCX5bvS0K/SSaLX/4ZdB0fTK705IFtdLIqV6UgszYXpNeA6uAotheZ9VTbs X-Received: by 2002:aa7:c942:: with SMTP id h2mr25053535edt.23.1591665015188; Mon, 08 Jun 2020 18:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665015; cv=none; d=google.com; s=arc-20160816; b=BX5FE4vYGDVKZ7a+FIbOc4EvKLui8NJqEG7rQgLRcsRQ8HizMJ0ZQNnGX141E23iuk v6SMM8XDqw58Hfi1Gjl/WbQXFY8Dp77UtZ61H2z+3OknFOTXHzm8Uf4Agba95qHgR6IW A9OW1KPvuFQ31NN6gzDOMFWFDS29U0yJ97BQzZtZtygRwoPHjqBuZjNzamk6hg56QDnK XMVRU3ZWXqNWXd8F2PkarlYK9XQ0kpBhxfRk9UCUMNL9atGDC39dSngivs746seWdpyG MJKRFmU0UTrxdmj5BN6PZEjCov3jDObb3DBagbrhqeUomtklM7EljYIFHlfHaDlPOiqw bybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DIYRmaEEu3PCW5L/Cvb5+rL2huzdiMv6Esl/McBnEU8=; b=i8a1cNY5baiXR242FAwSX7Qel6dNuBRx76GiUkBRqpgbduJrein6aMZYFp56IzHIP7 3E1JLOq86hllLZl6pdvzBUsalMKzRNdVksy9ibPe7YxEH1lzt7jRHJq3wToqw2f/6Q5Y 2J0Pr7LMW1Big1fU/R41cee0gd2RBZyQKYpDQNr7TT4DYPvZs7YqMMitZdv5/NJqnRQ9 RObjdb/3JZktdrUHRv7GaOKcNH8uxRwd8zBGJVnNbzPuAM9k0SOQl0FENLLT2zH7CdVp 3pLcMikP1Ru2hzTi2NAFCmQ8yqFMohjRUHiLTW8OR6S9Yubzbnzi6b9191pM3mdpwQPa S+RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aI6GHyKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si8652824edv.204.2020.06.08.18.09.52; Mon, 08 Jun 2020 18:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aI6GHyKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728425AbgFIBGO (ORCPT + 99 others); Mon, 8 Jun 2020 21:06:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:51016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgFHXHK (ORCPT ); Mon, 8 Jun 2020 19:07:10 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63B41208FE; Mon, 8 Jun 2020 23:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657630; bh=fsEGIbz/4fPJrX1KDAkRizHiHWLMOJDJ+GaVZBcdVZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aI6GHyKmWLXMKv0pktwtRNZ83P8eY9hvwHbvrGEPYmfEfu3pGdSk13JL5GmIHzsJX NbAgfiLypM89nWkL6r1N9CzJpSEQ+5xs1pTSDA1YTXUgRytpjExiRk8DMUFrch/lZd ddJfW45LyU1gFD/sqgM1+dHD8Iv9ojmuhld4iPoQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Koba Ko , Mario Limonciello , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Andy Shevchenko , Sasha Levin , platform-driver-x86@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 049/274] platform/x86: dell-laptop: don't register micmute LED if there is no token Date: Mon, 8 Jun 2020 19:02:22 -0400 Message-Id: <20200608230607.3361041-49-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Koba Ko [ Upstream commit 257e03a334ccb96e657bf5f6ab3b5693a22c2aa4 ] On Dell G3-3590, error message is issued during boot up, "platform::micmute: Setting an LED's brightness failed (-19)", but there's no micmute led on the machine. Get the related tokens of SMBIOS, GLOBAL_MIC_MUTE_DISABLE/ENABLE. If one of two tokens doesn't exist, don't call led_classdev_register() for platform::micmute. After that, you wouldn't see the platform::micmute in /sys/class/leds/, and the error message wouldn't see in dmesg. Fixes: d00fa46e0a2c6 ("platform/x86: dell-laptop: Add micmute LED trigger support") Signed-off-by: Koba Ko Reviewed-by: Mario Limonciello Reviewed-by: Pali Rohár Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- drivers/platform/x86/dell-laptop.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index f8d3e3bd1bb5..5e9c2296931c 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -2204,10 +2204,13 @@ static int __init dell_init(void) dell_laptop_register_notifier(&dell_laptop_notifier); - micmute_led_cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE); - ret = led_classdev_register(&platform_device->dev, &micmute_led_cdev); - if (ret < 0) - goto fail_led; + if (dell_smbios_find_token(GLOBAL_MIC_MUTE_DISABLE) && + dell_smbios_find_token(GLOBAL_MIC_MUTE_ENABLE)) { + micmute_led_cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE); + ret = led_classdev_register(&platform_device->dev, &micmute_led_cdev); + if (ret < 0) + goto fail_led; + } if (acpi_video_get_backlight_type() != acpi_backlight_vendor) return 0; -- 2.25.1