From patchwork Thu May 14 07:43:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1289962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49N3SW3m7Pz9sV8; Thu, 14 May 2020 17:43:39 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jZ8Wl-0000gn-6h; Thu, 14 May 2020 07:43:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jZ8WQ-0000YI-Ra for kernel-team@lists.ubuntu.com; Thu, 14 May 2020 07:43:14 +0000 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 1jZ8WQ-0003wZ-Dp for kernel-team@lists.ubuntu.com; Thu, 14 May 2020 07:43:14 +0000 Received: by mail-pl1-f200.google.com with SMTP id j23so1747738pll.16 for ; Thu, 14 May 2020 00:43:14 -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:in-reply-to :references; bh=CnvNLegPwsOir1iKGE9o7xJc8akSu8oX4VfydZXMiwg=; b=F6PH+XWVXkjezM9rNt8c4QGxmy7lPg7+dsTR1wbWFi6wmLjXnpC24GA6BNnTyds8ib kwaI/jDmcu3YuIYb+jNMxIW8UWIT51jdP4bVd4R4gfv0/llk0VUG90VTPr2neYFLdMpd IZw1KZ4P+PeBYjEqLdJIZWTXa/p1DWtqvCuX///+APqBXxTbMguYnWHW7nqicJJX/8Wu pDxiX/vwTRKYuOA14CxjNEnixziK9CCbhrB7i6j42WDVPb0mpcZYzGrMAD93ujFikxGY tjoZvsXGc6fsTqeRxwnTf+78ozcTnanfqUw7J1vo1YEEdqwraE7uRVkJR2r0ygGF2/NN 2IUw== X-Gm-Message-State: AOAM531h6eVDNovjjIy90wm/3qNSXhHl2RZipiZcsLQHVPe29YLmGzP8 wWCAqzdcOoWf1PkAZneaxvGhCS/wIZNaOmsOv4X+M639hh1y13aWOiCTRqtSe39bMx4SxT6imY0 eYFGezHEufEIIJe9E/HsxHnRyi+L5PvG2R8Zpu0TqXw== X-Received: by 2002:a65:5781:: with SMTP id b1mr499379pgr.388.1589442192886; Thu, 14 May 2020 00:43:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvgVrMGQwrY3WVsx6PN2u0zydiwVjDeymW7TlN2FhrfL5yarDbZopkn51uAIYKn5iPQZhyJA== X-Received: by 2002:a65:5781:: with SMTP id b1mr499372pgr.388.1589442192670; Thu, 14 May 2020 00:43:12 -0700 (PDT) Received: from canonical.com (114-43-71-139.dynamic-ip.hinet.net. [114.43.71.139]) by smtp.gmail.com with ESMTPSA id q21sm1533034pfg.131.2020.05.14.00.43.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 May 2020 00:43:12 -0700 (PDT) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 1/1][SRU][OEM-5.6] UBUNTU: SAUCE: platform/x86: dell-laptop: don't register platform::micmute if the related tokens don't exist Date: Thu, 14 May 2020 15:43:08 +0800 Message-Id: <20200514074308.19829-2-koba.ko@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514074308.19829-1-koba.ko@canonical.com> References: <20200514074308.19829-1-koba.ko@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Koba Ko BugLink: https://bugs.launchpad.net/bugs/1877275 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 74e988f839e8..4c1dd1d4e60b 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;