Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp556162rdf; Tue, 21 Nov 2023 09:35:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyqb+RLvhCF72YAl05ho2z/mFTYuVgXy/KvUkgZqIigypTziDA4fCH479R7ZT5rNZn0tiJ X-Received: by 2002:a17:902:f604:b0:1cc:70dd:62e7 with SMTP id n4-20020a170902f60400b001cc70dd62e7mr12258513plg.32.1700588113615; Tue, 21 Nov 2023 09:35:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700588113; cv=none; d=google.com; s=arc-20160816; b=J3R7TfUdkjeZPuGoW4Xh9IR6Ac/SEIRXtbMbmz4GENCvVz+9BWQ09orxs0a+yQVwNy jYD+/oKaHMwPl/lrnvJSNptnFTTvtKIAj1pcL+U4O9vcUq8pqtx/izVQsIk6q+UJTeil VLt9M4Ythj2YR6pKDs7OMicmcRg5W9TgJ1PUAFuzruKET5AnqQUtxb+Co5GVR0bd2MQ5 3GuXwNbDWbtIvQ07nOWZThSLnbNUNpFElsUfKl5IVzMnOvq1/Uz8htFuylhxoLRq4nUs O/M5/rA9urwPFISCRCxJgu4VzqP1x3vS9sti03CNTjzBDEZnZtOctkAHfib0+iWvB2+S de7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ByVZEV/reknZ3Zg3wcfs0e7TZbUblroVpHLSlR/l4z4=; fh=7A+/HZITRchWLZG6kM7e9SZGiZQY5A+zjbrsBPnC3ik=; b=fL1DLzkc6VDI7h1198bqENITdM8M52sRU5utAt4F3nLJ80cRSD1mXmTyHiFB4bJkSj fgDV0OKC4bf0do/oGg2FSmdYN1fZp+e1q2P8YhKtJtIGkCnuoGJ1hNlbYiSLy/fvxEzQ 7IuMliEPrA9L48R1mZGfZXk/ZJEz4NXr6DbxGCxrHNc6qlWE/GjH2mC+UuIBZIbISLiy /8YCXPGRhJCEq19U4AjuDXL/9B57paWwR44Qh8jPJte4lGfRvwCA0IRaqgxnDfTPaFt9 /zmnJNUbqCcsTdqNm9Z/iEE7V4Q9o06GmkiGyGEoQIK1pPL5iNonMsF7tll2XNNzUJ6F 4NVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DXUlAaqP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f1-20020a170902ff0100b001c62cfff798si10396763plj.372.2023.11.21.09.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 09:35:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DXUlAaqP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 00ACA814C6AD; Tue, 21 Nov 2023 09:35:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbjKURet (ORCPT + 99 others); Tue, 21 Nov 2023 12:34:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjKURet (ORCPT ); Tue, 21 Nov 2023 12:34:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92A59C1 for ; Tue, 21 Nov 2023 09:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700588084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ByVZEV/reknZ3Zg3wcfs0e7TZbUblroVpHLSlR/l4z4=; b=DXUlAaqPC7JW+y1GKcPSJwgh1hMHYPAlQGwZ/92bpvJMrSyodzbny3hppyJPCDh3TE90pm CvB9SOx9LScZjyj+eRtNSC6Ve2Smw/439eUPwHDqugfVhYBOEWzMuBlw3+6LoxQqc6zZD4 991IytghcHDxa4gKGkMXMxvY9Qks0fg= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-Kr7p22T7O_2r_CvgGi462Q-1; Tue, 21 Nov 2023 12:34:38 -0500 X-MC-Unique: Kr7p22T7O_2r_CvgGi462Q-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a01783d1ab7so87284866b.0 for ; Tue, 21 Nov 2023 09:34:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588077; x=1701192877; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ByVZEV/reknZ3Zg3wcfs0e7TZbUblroVpHLSlR/l4z4=; b=Vcf9i5qIkYSWtT0b1MdAgHdxQ6SLTlsofCCsD9NELTqw4q6xjRflGL87z9UQ3RasQp veQ6rasTEtwZKk1BiCIKINTcFEvn38AmKObPdhO5RgDgS97cr04iHInJybBKk/ZM7jDv Uw2191FktbA6TEqXgw9EIcVCpQZQ0/lVwL8utYHZ4ibXCaR9O8ojSWnDuiuqs9YArG+M 0asaqGkd0Tm1rOiYH3aEPt1Sz8z4n5j0h6yz0ki+nbqAlPXh9CBJkb996M1FuTmVd/Jm VHJxXdZ8Pc/pSpsSWlzoTKmjn46cZOfHk0dTi9Xex/eLKLEcgWxL9atBWB0dSFwabtw7 FwCw== X-Gm-Message-State: AOJu0Yx/RMnWW4Z4T55xqqSkbz3RG3r5GzATYFjkoDlsyYKQfTx7Emye byhlfoa1GzknCgdEA3HLpW8QjYr940Te1Fzj95ObT9BrIO3Pj94qHRljD2xNUMmI8MbNDodrYVG WVNFwajNSUpvRkEr5EHVI5fm5 X-Received: by 2002:a05:6402:b39:b0:543:5789:4d6c with SMTP id bo25-20020a0564020b3900b0054357894d6cmr36677edb.2.1700588077104; Tue, 21 Nov 2023 09:34:37 -0800 (PST) X-Received: by 2002:a05:6402:b39:b0:543:5789:4d6c with SMTP id bo25-20020a0564020b3900b0054357894d6cmr36656edb.2.1700588076759; Tue, 21 Nov 2023 09:34:36 -0800 (PST) Received: from ?IPV6:2001:1c00:2a07:3a01:6c4:9fb2:fbc:7029? (2001-1c00-2a07-3a01-06c4-9fb2-0fbc-7029.cable.dynamic.v6.ziggo.nl. [2001:1c00:2a07:3a01:6c4:9fb2:fbc:7029]) by smtp.gmail.com with ESMTPSA id k26-20020a056402049a00b0054855988fedsm4544787edv.37.2023.11.21.09.34.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Nov 2023 09:34:36 -0800 (PST) Message-ID: <6a4134f1-4075-43d6-b238-56a31197f7fc@redhat.com> Date: Tue, 21 Nov 2023 18:34:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] leds: class: Don't expose color sysfs entry Content-Language: en-US To: Takashi Iwai , Lee Jones Cc: Pavel Machek , Jean-Jacques Hiblot , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, =?UTF-8?Q?Johannes_Pen=C3=9Fel?= , Jeremy Soller , Bagas Sanjaya References: <20231121162359.9332-1-tiwai@suse.de> From: Hans de Goede In-Reply-To: <20231121162359.9332-1-tiwai@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 21 Nov 2023 09:35:11 -0800 (PST) Hi, On 11/21/23 17:23, Takashi Iwai wrote: > The commit c7d80059b086 ("leds: class: Store the color index in struct > led_classdev") introduced a new sysfs entry "color" that is commonly > created for the led classdev. Unfortunately, this conflicts with the > "color" sysfs entry of already existing drivers such as Logitech HID > or System76 ACPI drivers. The driver probe fails due to the conflict, > hence it leads to a severe regression with the missing keyboard, for > example. > > This patch reverts partially the change in the commit above for > removing the led class color sysfs entries again for addressing the > regressions. The newly introduced led_classdev.color field is kept as > it's already used by other driver. > > Fixes: c7d80059b086 ("leds: class: Store the color index in struct led_classdev") > Reported-by: Johannes Penßel > Closes: https://lore.kernel.org/r/b5646db3-acff-45aa-baef-df3f660486fb@gmail.com > Link: https://bugzilla.kernel.org/show_bug.cgi?id=218045 > Link: https://bugzilla.kernel.org/show_bug.cgi?id=218155 > Link: https://bugzilla.suse.com/show_bug.cgi?id=1217172 > Signed-off-by: Takashi Iwai Thank you for taking care of this, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > > This is a sort of v2 patch, as it turned out that the full revert > leads to a build error. > > Documentation/ABI/testing/sysfs-class-led | 9 --------- > drivers/leds/led-class.c | 14 -------------- > 2 files changed, 23 deletions(-) > > diff --git a/Documentation/ABI/testing/sysfs-class-led b/Documentation/ABI/testing/sysfs-class-led > index b2ff0012c0f2..2e24ac3bd7ef 100644 > --- a/Documentation/ABI/testing/sysfs-class-led > +++ b/Documentation/ABI/testing/sysfs-class-led > @@ -59,15 +59,6 @@ Description: > brightness. Reading this file when no hw brightness change > event has happened will return an ENODATA error. > > -What: /sys/class/leds//color > -Date: June 2023 > -KernelVersion: 6.5 > -Description: > - Color of the LED. > - > - This is a read-only file. Reading this file returns the color > - of the LED as a string (e.g: "red", "green", "multicolor"). > - > What: /sys/class/leds//trigger > Date: March 2006 > KernelVersion: 2.6.17 > diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c > index 974b84f6bd6a..ba1be15cfd8e 100644 > --- a/drivers/leds/led-class.c > +++ b/drivers/leds/led-class.c > @@ -75,19 +75,6 @@ static ssize_t max_brightness_show(struct device *dev, > } > static DEVICE_ATTR_RO(max_brightness); > > -static ssize_t color_show(struct device *dev, > - struct device_attribute *attr, char *buf) > -{ > - const char *color_text = "invalid"; > - struct led_classdev *led_cdev = dev_get_drvdata(dev); > - > - if (led_cdev->color < LED_COLOR_ID_MAX) > - color_text = led_colors[led_cdev->color]; > - > - return sysfs_emit(buf, "%s\n", color_text); > -} > -static DEVICE_ATTR_RO(color); > - > #ifdef CONFIG_LEDS_TRIGGERS > static BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0); > static struct bin_attribute *led_trigger_bin_attrs[] = { > @@ -102,7 +89,6 @@ static const struct attribute_group led_trigger_group = { > static struct attribute *led_class_attrs[] = { > &dev_attr_brightness.attr, > &dev_attr_max_brightness.attr, > - &dev_attr_color.attr, > NULL, > }; >