Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp617555ybj; Thu, 7 May 2020 03:44:09 -0700 (PDT) X-Google-Smtp-Source: APiQypKxelePLWbzmYjnG3rTMqIQUZ6FXfr/iMNA3GT6V5gEuqlLN7Lrq00M+0lZA8tiQAoCko1W X-Received: by 2002:aa7:dc4b:: with SMTP id g11mr10666891edu.223.1588848249342; Thu, 07 May 2020 03:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588848249; cv=none; d=google.com; s=arc-20160816; b=r/kfXt0moRciAhVV/IHVy/oIHOZZr9GnSq2UjpWrqEEOyx317T1NTnAqJBIeFkvkBG bNuo54lbThySW4drqKvAG9LiPQG3I0t4dftlEm4rBOTH8DqL3LvbWw0qE2zlsATKrZXr FKH6qeMczv6ZFPE0cho/mK7HofazUMQgGzNRjoDw6Yz6hf+KSFTYkCbGeobZfe4+WHQB NbNNBzB33gOwDMEOvpeSAyM7aDK17mhv3Rk0q0SOBrefWi3TfvE9Sq5wlD7dzB2grIyC 3Jb8lZySxIYTwRb6sfwXWnDiszW+0LdslgxiTSBwUD6rR7ClWYFdSoSexjd5PPbbuAGY QA1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4Kys6xR/y3HlGpmyn8tfctWY6mMEvfogLBDOY++2Egk=; b=ntJ8QsNOJgeq4crQ+mq9qb76pwkzaWdpf4JJBE5VnjZSQa6Gsn86aX9xxgJ8XL3ZUo VPj1eRl2Obsri1i5fmb6HbYFvE2e7oVmshwSHV1vvroglcXlrcX2JuMD03LrQlPM90qj 4e59hR4ZH9IRhzzptlcvBpASCW9Rs+Ir4jzIhoiRahjoxWyDJ339ToqphNgk/CNNw1ti Dam1KQd4Cjngxyg/luEs3l4RmfbrresLBtn7E5mobpGBUoybs3zEX5VrKEW2Cz9EIkq+ T5G10xRHWDILM8TyOm3CD8mTV0KrybYAU44G/yhlNTwewm6zy1oyK5mL+PZkYWvdSI4h 0uAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UG9JPxSw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci9si2901921ejc.125.2020.05.07.03.43.45; Thu, 07 May 2020 03:44:09 -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=@gmail.com header.s=20161025 header.b=UG9JPxSw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgEGKl5 (ORCPT + 99 others); Thu, 7 May 2020 06:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725834AbgEGKl4 (ORCPT ); Thu, 7 May 2020 06:41:56 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35FE5C061A10; Thu, 7 May 2020 03:41:55 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t9so2489641pjw.0; Thu, 07 May 2020 03:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Kys6xR/y3HlGpmyn8tfctWY6mMEvfogLBDOY++2Egk=; b=UG9JPxSwDPC4ExTcSv4dkgpCkQtSVpcuVp98P/8swZIJPT5PwjekODVGjR6W5VGHeG FMqJird6yUefjXLIgStPiXTFjL3wk5LNY261y8WuVslOGwYpSG3n0Ddg3BfZm/1Pyuze Wr+0fsXoiUNsp+uhxClV21ewiIpYNBHS9kB547Caplboj1t0AGCQQ/992rC3U78Ygj9t 2DBoQ5QmfVR2vjr0v4TnOJvtMgzUXXrMEztdstousaFWPbHqh4Nd3ZplHXjwvru2ro83 QhsHCqyd67epPUj+XBUQVLgFWKb2hKo9EVPPWBgWSAC6HGN3ci3wR45yHRUXl9B02LJy LLHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Kys6xR/y3HlGpmyn8tfctWY6mMEvfogLBDOY++2Egk=; b=Qawyl39t5GBXF0sd0KycFx7kYcJ9jxf1VunDPGpagfqpPh0QUJ8xKudNIRkNYjZ4we VF8UfiGYL+stWSq7f2fup/yugu3Dj+esFZpMlrBWkDOtyuzDSF+O+W+SFqXmsFmqxRmV jaG+WJwrKloyEv81VhZtMm5mmWAujXcu1kzJD83YDUVa/ePcWoDJ/Sm6I1s3g9SVHOwV 4+cHzqjf3943k7QVR/M+Q2T3rJLtAyTEdmuX0nudRuNcORkDSQjb77dL36wOB5tVzAS5 zDWw8+2Fm4yGZi5sBVe7OiJZzm3mjaHxyGtfqzyuvsD22LMXUsc68Iy8Pr4sz6bya635 Eujw== X-Gm-Message-State: AGi0PuaAAT3+XRKIH2CM6dWGTYmVGHa3UqaXFQRUE743s1ymyuGsY96R Ds7Ph8pSf+WNPuO7kx/9Joc1lcRZLgYagtJIrFo= X-Received: by 2002:a17:90a:340c:: with SMTP id o12mr14144430pjb.22.1588848114587; Thu, 07 May 2020 03:41:54 -0700 (PDT) MIME-Version: 1.0 References: <20200507094242.7523-1-koba.ko@canonical.com> In-Reply-To: <20200507094242.7523-1-koba.ko@canonical.com> From: Andy Shevchenko Date: Thu, 7 May 2020 13:41:42 +0300 Message-ID: Subject: Re: [PATCH] platform/x86: dell-laptop: don't register platform::micmute if the related tokens don't exist. To: koba.ko@canonical.com, Mario Limonciello Cc: Matthew Garrett , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Darren Hart , Andy Shevchenko , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Cc: Mario On Thu, May 7, 2020 at 12:42 PM wrote: > > 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. > What the exact platform you are experiencing that on? > 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 > -- With Best Regards, Andy Shevchenko