Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1476474ybk; Sun, 10 May 2020 18:21:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLi6BISsJT3woJS9soEp585J8FzjIrKSFquWGnTSkZIpLaXrjurWLrigwXfJUYBK2LLUkIr X-Received: by 2002:a05:6402:297:: with SMTP id l23mr11907750edv.57.1589160079504; Sun, 10 May 2020 18:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589160079; cv=none; d=google.com; s=arc-20160816; b=nlZxox4Ham9CdRa2n0gjmYIw8bEvPJqm2Q6je3eUqA46gmcciw2ayQAKTbq2ngBSuz gNLwWqiecOMKWv8tTdu8zEDimDD+XL3nnq9BuhVeB5+q0pXhrqMATreNbQb6KYzCsfss /wl0Y5SJ+vFrXB4Z9tm5lIUblfCFcBsZ+OyN5DM/+37TSqn3MtyRDy58DTS+5ZEiOM1D fzKkD04rl0//TG7FhiMD8S+h6IHK8C60rWDt4ZizMw91mUIow/0Tlh9HA3xBuJKAhz9m /DlQ6gMu46vjxRVty2p+D+Y/UXrsDjTOpVazheTk77SwEbY9TxgFgJZpu0vnShYiMa5p aOKA== 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=npzJ2ssQsHpN36Phgsl48fh9Ati/w9bnMfzts9WzPbU=; b=af4pmJ/jgrdEYTKw6+1VDGgxxp1MEPrv1GlV+p8BiWIyIXVdE3qS15r8hdwU0e1z9H MbhhFCkYhwuTq69eElUMU73jddEFa6lQDX+lXnfDP912LrOtV+7OuE2mDh3VUCIrWDsS d0acQP5vc5FTg1H5g7xNVArxxUptYey5IH3LFSFawmHDi2EBAxTGKGsZ+asUNvcOKWs5 g74raHtYvC0GN2il/TRyooS3tWMPkOA2to00Tk291fVy/InqMNv4P8qZybSjLt0lPErY 3yxJ/umdj7odmhXXwj2OlA/iKt1FhJXYlN+Iixk+YcJG7XCltpmw6PG4q8p6yXQBptXA /MqQ== 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 p16si4916171ejz.195.2020.05.10.18.20.46; Sun, 10 May 2020 18:21:19 -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 S1729216AbgEKBQL (ORCPT + 99 others); Sun, 10 May 2020 21:16:11 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:49551 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729184AbgEKBQK (ORCPT ); Sun, 10 May 2020 21:16:10 -0400 Received: from mail-pl1-f200.google.com ([209.85.214.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jXx3A-0004k3-5j for linux-kernel@vger.kernel.org; Mon, 11 May 2020 01:16:08 +0000 Received: by mail-pl1-f200.google.com with SMTP id w11so6160080pll.15 for ; Sun, 10 May 2020 18:16:08 -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=npzJ2ssQsHpN36Phgsl48fh9Ati/w9bnMfzts9WzPbU=; b=Ee5KpJZeLZvjMfjgNwr9MjcCmZ2Rw/iVrAw3WvK4feRD5Mu0JFmPFPIkNdVXQIRyhR ucf4BvKsmPgDG0MdevyaZAog7i37SxuyvfQK6SC8ZxFzdWSpLASArPUw+ZEzZNSYu4Q0 yKtzWZiaKMbr5nUrX/MgcPSSGzqfOxn1qUC332OWSY8FQ9I7H/nGjORJ2KD+AE8Sse0F 8EnQBZ/Tyjxj7cbCv1t5yUjbXV8NTFLwFbbBBgO8jXpTknGHZgxurdib5Npt/q9uAPiI C+QWNVjyVszn35VKqqwEI6K2c5OZR4/MvBL6U4sPQAWwQLh1pllBZUgmvfwpu+Rrivr5 y3+Q== X-Gm-Message-State: AGi0PubLQ53DVJjJo/M4Y8M0Yhy2oiS7MAoaRC04Qr4K+PBuo/wdcKx5 ZKXwdZ69+3x5RnBTW1HpUV6CBdCSCSeFixmtpTWJsg3HNeZvu5/bqa8IxpYPOzJNsOfE3SaSHdM jWeKvVLXOorTVpyxrQC3iybzQx5VZEDHx1Y/REGjOfQ== X-Received: by 2002:a17:902:6114:: with SMTP id t20mr13273898plj.324.1589159766647; Sun, 10 May 2020 18:16:06 -0700 (PDT) X-Received: by 2002:a17:902:6114:: with SMTP id t20mr13273867plj.324.1589159766166; Sun, 10 May 2020 18:16:06 -0700 (PDT) Received: from canonical.com (111-249-68-192.dynamic-ip.hinet.net. [111.249.68.192]) by smtp.gmail.com with ESMTPSA id y8sm7887771pfg.216.2020.05.10.18.16.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 May 2020 18:16:05 -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, Mario.Limonciello@dell.com Subject: [PATCH] platform/x86: dell-laptop: don't register platform::micmute if the related tokens don't exist. Date: Mon, 11 May 2020 09:16:03 +0800 Message-Id: <20200511011603.4278-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 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. 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