Message ID | 20231030054757.3476-1-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2005628vqb; Sun, 29 Oct 2023 23:01:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBMyRVmf2sIcBji3zNWgGojtmQM1cupbnHlrlz/x9F6h0suBE6APbUycb5xU5eO24hd1KR X-Received: by 2002:a05:6a20:6a1a:b0:174:210c:34b2 with SMTP id p26-20020a056a206a1a00b00174210c34b2mr8805933pzk.19.1698645660119; Sun, 29 Oct 2023 23:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698645660; cv=none; d=google.com; s=arc-20160816; b=rqufmlYi85jV7bZMYUpgUc3HAHk6Dny18L4ye2Ho3IWoJBV/e+d22m9HqiuL4gsFDm 0zQFeciWzBCzz+oSDTejoDD3J9LD0r79mTEJ7aOUr/9DE7ILWJWAvEIBW4HKUasWh+1c OYK386lqdyqZJGBQguT7pPKNJbzfe4j7d5h2RoJhwbr2FeQ5t9L7PvEr9IkwwisW57hO 7HfsGNKJnQIMUYn2vAbjJqxtyL7P5LlrEWtNetBDNvaBzjd5TkVGK+PdStk1snsBQMqM nIxocXYFLrVsltjGtnxqWLIw2SHfN8HNjt7SfEIN6ow8L7Sk9c6D8Wm6qTexbuvjVtEB hZPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3KW3m9oq89/kPkojPWA6yp2P/L9l2qqQNI6VZgs0Msg=; fh=cRoczc41n3dsmT8Sdpt/Y6rooZj9aOZUmUTDt5QRalM=; b=af75mGrLzqB04IDbADY15pAXCx8pi2flRrPilGOLkywAKUJYkZlHjryTti9uo51s0x zCgzKrWzHVZxXVKqoQ7PrR8lU1k6SLgpfCP+ZxUnaf65ni2vvozbAygWFtOmdTIDmW3o xFWhGZAV0QSYukhFHl+MhmTbkuumHllgXxSExzzgO73hl8x4GmmyhgAFsBg5PWRO4bix 1jgTVvI7I4S85hSV3qNd7qpDouwVHvxEko++ZJLCEi9KsUUlz05Exb5KMp9LNcJeN72Q HrywJPLLZJL44zVFRqJDOUmzrI/aLROwSw26B1QeWYMt/54mrFwC6gMdIsFZE/ZfMWZN ORCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bIL2SBlu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ks11-20020a170903084b00b001bc674914b0si4533364plb.472.2023.10.29.23.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 23:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bIL2SBlu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 28D0B80A9753; Sun, 29 Oct 2023 23:00:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbjJ3GAP (ORCPT <rfc822;zxc52fgh@gmail.com> + 31 others); Mon, 30 Oct 2023 02:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjJ3GAO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Oct 2023 02:00:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F574A9; Sun, 29 Oct 2023 23:00:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FD29C433C8; Mon, 30 Oct 2023 06:00:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698645611; bh=2dWKctULE0nUwSFKf+fpemu7Au9dBQgPNQGUtB0+MJE=; h=From:To:Cc:Subject:Date:From; b=bIL2SBlu5W7TGq+ak6JLjazdG6JBVr8GqaDnjj7qb2rHncgBe6GmoFFNl6A/yRwYH t1yzCK0sLYxVTwRfu6IWB9cxEPrwJ5b3g+OZUw+epaYYirGuj4oZonSinZJ+kpZZc/ C5OM/cenQ9VasGgdkbnXykAQgJwD6xtNKvksRaJBb1Gj/w+0w4x7R3zfFtMP5kqwaL pV+5iVxeVStenTJX1QByCHVAlbMG3rZMmxUz0kObEyLIFqVALWmWXlSaq3kZdWAhqr aoPWq1ldBCh1dZAdcd8a8QyI7LMReW0pqYrM+tPxDANOKXphc0gqvXopUAh436dxtL plKGe1MpyBBdQ== From: Jisheng Zhang <jszhang@kernel.org> To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org> Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] leds: Expand led_colors[] array Date: Mon, 30 Oct 2023 13:47:57 +0800 Message-Id: <20231030054757.3476-1-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> 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]); Sun, 29 Oct 2023 23:00:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781159071661631870 X-GMAIL-MSGID: 1781159071661631870 |
Series |
leds: Expand led_colors[] array
|
|
Commit Message
Jisheng Zhang
Oct. 30, 2023, 5:47 a.m. UTC
commit 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID
definitions") expands LED_COLOR_ID definitions for dt-binding. However,
it doesn't expand the led_colors[] array in leds core, so if any of
the newly expaned LED_COLOR_ID definitions is used, the sysfs will
emit null in the led's name color part. Let's expand the led_colors[]
array too.
Before the commit:
/sys/class/leds # ls
(null):indicator-0
After the commit:
/sys/class/leds # ls
orange:indicator-0
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/leds/led-core.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Mon, 30 Oct 2023, Jisheng Zhang wrote: > commit 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID > definitions") expands LED_COLOR_ID definitions for dt-binding. However, > it doesn't expand the led_colors[] array in leds core, so if any of > the newly expaned LED_COLOR_ID definitions is used, the sysfs will > emit null in the led's name color part. Let's expand the led_colors[] > array too. > > Before the commit: > /sys/class/leds # ls > (null):indicator-0 > > After the commit: > /sys/class/leds # ls > orange:indicator-0 > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > drivers/leds/led-core.c | 5 +++++ > 1 file changed, 5 insertions(+) This already exists as: a067943129b4e leds: core: Add more colors from DT bindings to led_colors
On Thu, Nov 23, 2023 at 10:56:20AM +0000, Lee Jones wrote: > On Mon, 30 Oct 2023, Jisheng Zhang wrote: > > > commit 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID > > definitions") expands LED_COLOR_ID definitions for dt-binding. However, > > it doesn't expand the led_colors[] array in leds core, so if any of > > the newly expaned LED_COLOR_ID definitions is used, the sysfs will > > emit null in the led's name color part. Let's expand the led_colors[] > > array too. > > > > Before the commit: > > /sys/class/leds # ls > > (null):indicator-0 > > > > After the commit: > > /sys/class/leds # ls > > orange:indicator-0 > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > --- > > drivers/leds/led-core.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > This already exists as: > > a067943129b4e leds: core: Add more colors from DT bindings to led_colors well, my patch was sent earlier than this one... When I sent out the patch there's neither fix in mailist nor in your repo.
On Mon, 27 Nov 2023, Jisheng Zhang wrote: > On Thu, Nov 23, 2023 at 10:56:20AM +0000, Lee Jones wrote: > > On Mon, 30 Oct 2023, Jisheng Zhang wrote: > > > > > commit 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID > > > definitions") expands LED_COLOR_ID definitions for dt-binding. However, > > > it doesn't expand the led_colors[] array in leds core, so if any of > > > the newly expaned LED_COLOR_ID definitions is used, the sysfs will > > > emit null in the led's name color part. Let's expand the led_colors[] > > > array too. > > > > > > Before the commit: > > > /sys/class/leds # ls > > > (null):indicator-0 > > > > > > After the commit: > > > /sys/class/leds # ls > > > orange:indicator-0 > > > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > > --- > > > drivers/leds/led-core.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > This already exists as: > > > > a067943129b4e leds: core: Add more colors from DT bindings to led_colors > > well, my patch was sent earlier than this one... When I sent out the > patch there's neither fix in mailist nor in your repo. What makes you think that? The applied patch was submitted 8th October. https://lore.kernel.org/all/20231008144014.1180334-1-megi@xff.cz/ Yours was submitted 30th October, 3 weeks later. https://lore.kernel.org/all/20231030054757.3476-1-jszhang@kernel.org/
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index 04f9ea675f2c..742595d923ee 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c @@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ID_MAX] = { [LED_COLOR_ID_IR] = "ir", [LED_COLOR_ID_MULTI] = "multicolor", [LED_COLOR_ID_RGB] = "rgb", + [LED_COLOR_ID_PURPLE] = "purple", + [LED_COLOR_ID_ORANGE] = "orange", + [LED_COLOR_ID_PINK] = "pink", + [LED_COLOR_ID_CYAN] = "cyan", + [LED_COLOR_ID_LIME] = "lime", }; EXPORT_SYMBOL_GPL(led_colors);