Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp579273ybj; Thu, 7 May 2020 02:44:43 -0700 (PDT) X-Google-Smtp-Source: APiQypITTXlcpjpQCcotCcCaIa82xxbgOdaSrdyM6e7ipOHYvkb5nGMx2P499HrctTGbAys8O3zG X-Received: by 2002:a05:6402:1d88:: with SMTP id dk8mr11403484edb.52.1588844683677; Thu, 07 May 2020 02:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588844683; cv=none; d=google.com; s=arc-20160816; b=WHzf9JyRo9bsdN4HYhtHLlI1Q1Z8BZ7Z+ckxxb00VzuGBVktWPE1CXHjQuQBGXZcQ1 F3jggkeUglI03vt20Vb82wGCeDWutFQ8o+VqmdwtK0ctxyte1+IxdA5JERM+u8cu/zBf x/B7Sbla3TD6FeOx00/CCy2PyCTuOoOwxu3Ntu6KevEpj+qHAly7jl9eEHzR6hOfG6zv LHtf1N2CYid4w69/07mVTfXYFBG0dEjkjD7hDtlZi0LAwIP/YKrs5vGharmqB2NYxY3e BZp+H5l4FO8VYs/uDK9pbXKBjjLEBfK7LRREMhGEpU93/hHHiY2/dA2KcVPsknxvJzrc FNwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=2c0eBBtIepmDWT5vtHR8eCLoQ0+DU8y3zdqCJbavP80=; b=yhED3/V0zJu0noXhVilq6P78gNHp1qKdhxNZHH7Z2dge9dAxtUkaJu/2HIK7wty6qp dlWMFukMyqThDRkv73gAuvKEzSZ78m5+qRidqEpuIu8oQvxhmZNfW88Vv7ds9QAx3SHk aSP8tsB4RAjTzxXd81PulYLvLdAReVckrXHlPm6JshQ2C1IEXxyK9ESbotre8SwYYNi8 7nsY93qp++NCzCAofuBFlquLsQ17JWSRxd3RiGpqwSYhm8qunJ7cBpJk+AmOLuOIB9zl 6hIjS/0aMuRcQs8BS8tFDejjYpbtjmHJCFkGghIZggZCz7GV8cUac4RygqpG7kiy6QOL 6xpA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si2888761edy.543.2020.05.07.02.44.19; Thu, 07 May 2020 02:44:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725953AbgEGJmt (ORCPT + 99 others); Thu, 7 May 2020 05:42:49 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44439 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgEGJms (ORCPT ); Thu, 7 May 2020 05:42:48 -0400 Received: from mail-pg1-f200.google.com ([209.85.215.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jWd3G-000232-7f for linux-kernel@vger.kernel.org; Thu, 07 May 2020 09:42:46 +0000 Received: by mail-pg1-f200.google.com with SMTP id g11so3723662pgd.20 for ; Thu, 07 May 2020 02:42:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=2c0eBBtIepmDWT5vtHR8eCLoQ0+DU8y3zdqCJbavP80=; b=eExVK199R6uAt8yorrj+LXQhHqHS+jt7vdbUIvHRJ48YBlQVHcFTN6QtSDUB9EbePW 1rfG3Xnnoz2WCESYQ/lqXkut1NeUq1TBnt+Amkh6paX2dhuhuxCfxq96Ycj3Hbz2frpy GMGyU9Je6wIlNlO7RM515838zThUWb0UmJfkDIs9FtUHM19DV8cLVbYAHyhPpjAeYJ/y 1Nqt0IcdDGVhRIdtCIste6WWkFnxeATUeSB+S5/wofhLsQrOdjog0NizWsLTmFO9LGn4 GDhxHOuxUcPn59Ckk6jtKsc0vd4gYnLAY9S0KQLySSYVziAODDXc70PQzdWrmHEgrLnc f6ZA== X-Gm-Message-State: AGi0PubxEbtShrFn2SaGOyFdo5tbplUkhW6wYb0kN3+5M+QiCcWL54Eb x2kwu2X8wf/Cs5Ej/SSSCnhlicQ00dKmlyl+RPihiasCEN1ZjvH2eWK0M4MugeqQ1ZS2VWA6rcd 6t94n5hy/E+NC+jHcykhcdYKNDIDoXIzEpW6TYH8FZA== X-Received: by 2002:a17:90a:3441:: with SMTP id o59mr3759898pjb.185.1588844564678; Thu, 07 May 2020 02:42:44 -0700 (PDT) X-Received: by 2002:a17:90a:3441:: with SMTP id o59mr3759880pjb.185.1588844564483; Thu, 07 May 2020 02:42:44 -0700 (PDT) Received: from canonical.com (111-249-71-140.dynamic-ip.hinet.net. [111.249.71.140]) by smtp.gmail.com with ESMTPSA id i190sm4423030pfe.114.2020.05.07.02.42.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 May 2020 02:42:43 -0700 (PDT) From: koba.ko@canonical.com To: Matthew Garrett , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86: dell-laptop: don't register platform::micmute if the related tokens don't exist. Date: Thu, 7 May 2020 17:42:42 +0800 Message-Id: <20200507094242.7523-1-koba.ko@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Koba Ko Error messge is issued, "platform::micmute: Setting an LED's brightness failed (-19)", Even the device isn't presented. Get the related tokens of SMBIOS, GLOBAL_MIC_MUTE_DISABLE/ENABLE. If one of two tokens doesn't exist, don't register platform::micmute. Signed-off-by: Koba Ko --- 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 1e46022fb2c5..afc1ded83e56 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -2208,10 +2208,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.17.1