Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp547306ybj; Thu, 7 May 2020 01:53:37 -0700 (PDT) X-Google-Smtp-Source: APiQypJSAzuJyFm7rOwowA8yxxtBGkmswlTDYF890pGmga1PHXq0rAn4Dn7FMlwaO/rygXfiQAfD X-Received: by 2002:a17:906:2548:: with SMTP id j8mr10896318ejb.378.1588841617553; Thu, 07 May 2020 01:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588841617; cv=none; d=google.com; s=arc-20160816; b=TUXgaA3iYAJkz6Pdeu3x0aSWKQvM6dzKdUaN1lJArEnXMN/CK2QUk7TDnNhyBS17wG pQw47X01nlm8oFMbJwvrrxSnXQwGskUNcK3QuwwYsE1pRPmaEnbAv6dWxNaIRifkhulZ kqL+L/ebo0haKOiNwSaFxkLmFdBySEcokqb3z+1mgcAHLuqeGTbDj/JvyFwpToYsB7oV NAqSoR5SbsJsqOjXth9pJkushjyvmqLGiCHBiTACm1IZ7gmC13hhTnOEcwKp/RwQSNUE jncTguhmHvdZKE3O8xBG3wwQQsfH2N68lnY/Rw71igDmVHq+2La0SbLWuC5MV+6kYU94 uI1Q== 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=nOtJNSzU/IvusKVXf0pPBVCTPzZSjjhY+JMbX/BgmI0=; b=cW53gOYvmlSJAc41qYLALlxbzURpHuKTxZraKFnaxQS9LM4yEmqrUIppuGJmPP+uax zXrhmfAygGJ3eMuTMY8RLj5SY/THCOFbN57ackwyTYR1g4/KPJC7nUUDyC6jWdV3iPVB hCAh1nU2xn+NZZsA5avmF8Wz2DJizohGhA1m8j04CDuB2lFw3jKynbBbtQNe8Ouc80+w IPOR1SVrBV66djQpSgUPHs3v47n7OSlHWqDWoS+iieFBHi4oYwSKaiiJnQlMNzMeTxoE O6X8LfWH4jE43oE2nVW+Yq6zkPjCwoqENaK0AMOsG98lPMpMs0D9zYf1WAxbDjN/eRLj iuNA== 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 dn6si2708144edb.514.2020.05.07.01.53.14; Thu, 07 May 2020 01:53:37 -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 S1725939AbgEGIti (ORCPT + 99 others); Thu, 7 May 2020 04:49:38 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43078 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbgEGIti (ORCPT ); Thu, 7 May 2020 04:49:38 -0400 Received: from mail-pj1-f70.google.com ([209.85.216.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jWcDo-0003Oo-4r for linux-kernel@vger.kernel.org; Thu, 07 May 2020 08:49:36 +0000 Received: by mail-pj1-f70.google.com with SMTP id l40so5165333pjb.8 for ; Thu, 07 May 2020 01:49:36 -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=nOtJNSzU/IvusKVXf0pPBVCTPzZSjjhY+JMbX/BgmI0=; b=GlssKzl4Q0ZkOAkWOAHk5h+dpVehN3YGmYC/u68Eq992xiuU3iXlUiypT6qTEZ09BS 3yVhCmo2VcJgbPZVxAQ5/p6Fjoh6hc1+CDOHJyAJdvD2T13GQg45pI+URya7Wz8ysTZA ktfw3MYsZIttPrpHz+9FOkuLos4B+/6A5DkFXQnObWWNNSatITm+LFPImVaZfqwnxATt 5hJJ839kRqSkVhmiRhIM/YFuQkrSZt6nm5nKIKBHPwQZJRLWxAkV1mOuSC7KM8JvMeMI ff3g4gqHbUBZZ5PPSAAbk6JLpAZnON156GUO5O7MAAHT4L0YgrPcOZ6YYByidUuoYryY x3Zw== X-Gm-Message-State: AGi0PuZSouuc3ncu43uKDOmW8OIaUjZv2SCosAcjdbED4iY2vMXsybs7 FHeRtcMlVFAHUB7cvVQS+A+IOzd9mFrhoN9l5m9kBFWWHKxuXKQPwNc7G+TXCBfUrWniWcKRd/d FLyDwmpv3HgSqI55HnVBi3qtIYsS6a2QSbDr/l+O09g== X-Received: by 2002:a05:6a00:2b4:: with SMTP id q20mr3533508pfs.104.1588841374686; Thu, 07 May 2020 01:49:34 -0700 (PDT) X-Received: by 2002:a05:6a00:2b4:: with SMTP id q20mr3533484pfs.104.1588841374345; Thu, 07 May 2020 01:49:34 -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 w11sm3279063pgj.4.2020.05.07.01.49.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 May 2020 01:49:33 -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 16:49:32 +0800 Message-Id: <20200507084932.5486-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 First, 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