Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5799340imu; Tue, 13 Nov 2018 11:57:02 -0800 (PST) X-Google-Smtp-Source: AJdET5cAOOtt3m7SwHNhcmAC4PXR+oa5EDBjld2AAHQOd+w4mrHEX3bnGmn3ndiJqoM2jBS1iEy8 X-Received: by 2002:a63:91c1:: with SMTP id l184mr5987550pge.29.1542139022296; Tue, 13 Nov 2018 11:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542139022; cv=none; d=google.com; s=arc-20160816; b=qiCJN1KG292tLwPjHHqYnMCmRx9pKj8PKk4+a0+AlddBbsI9s++SqevTl3Zh+vu5mq dNiMSLBIU0uPV5qo+tdGIiEHJ7bOXkPru+ParWRQ6jNlf7YDrmMLWIDENSgKd6s0vhZK m5mR8PzUla6lxjteTcrTZxl3ox0lZdEJ8SA0ki4j+iBE8zAs1ClsF9e0nIVYU3PkuMGu dLp5Wbk4Am2n+FF00edzWU7rQZPGYmBIwPPE8nGMSQkNbP/oiKWK8mq8lG3Q/A2UeX/v 5cWqaMYag3qKIx2tt1kQv+rcu2SB+w5mxr6wgsXwF83/3XUAAAOLmwOOXnQxGyR/AEDp 3wIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=rwoFuAldS9odiU9TIbYEW6zjfFSPr2jCKBI0wPMos2U=; b=PC2ZpvlGkZCuqjXIkAotI3zd0yCWEVQBy6uM/M9J/TQGb5ieuIYqXvB38VkFjgfpke VSYPdtQtz7rWD7fObIpodwHZuqCfE4E6st8/raouRgpPBwGa4zo0oT/YkORT0c0Psiih jUp9DW+IiVSezlCwsy+gXYzjVJQjB2wRSPHoMau9U+jJvweXaylJ+tjJrjIKqoI7Rp46 K9kj1Ko0chmTOTUa6zf8fwr/goVOE1C/d40hzf++eM4X8Z/PZb2xTDS4n+JmehdssVpi O5CoB6ZI7UhsCFfE4NuNJYbzumuLXRjDLsQJs4/WqZnZ6hN3RUG4HpyfKtJngJ+roate kLXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lfqqu0cL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a5si20243390pgg.120.2018.11.13.11.56.46; Tue, 13 Nov 2018 11:57:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lfqqu0cL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730849AbeKNFzM (ORCPT + 99 others); Wed, 14 Nov 2018 00:55:12 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40100 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbeKNFzM (ORCPT ); Wed, 14 Nov 2018 00:55:12 -0500 Received: by mail-ed1-f66.google.com with SMTP id d3so11009530edx.7; Tue, 13 Nov 2018 11:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rwoFuAldS9odiU9TIbYEW6zjfFSPr2jCKBI0wPMos2U=; b=lfqqu0cL8xM1CDznoZElh2H9EDWgqRpO1UqA8oOBlwzQF/hyUJ90IvaefAxNwmU/qA z+uBAMVFRAbry/0wVxgqmxbm/A+R6cAENkfvfkeQjssYI9qsKeckzMZt0cjnysKX2vMS Jnmqhku/7E+tf18H3GQbqVHhaPPrEhkirvAcM6nG1hQf/PhwOSjMXP/PYwYExKcSqzqY cmn+SMdYZktLJ5mhpjT56/MfD384MhRaEWmdxTb7QUiR4GYEAAXScr6llTP1HMIKU/i6 lmdau/j+zbpWJpsyhKfasmG+nyicWnFCvcRI85zd8eA7fGaeS3HfAH6u5RawFWAUISTW V7ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rwoFuAldS9odiU9TIbYEW6zjfFSPr2jCKBI0wPMos2U=; b=aY46gIi/vqmn7zxgMoRNnql8/tlvCuxr1mXJPnJYswn8j0I2DZBSkOyCRT4sVRpzTm rCcTc+dMAUGvqoFtipaI2gmjY7TsB3YlqthXtmxJH1b3kZdwMKXqbgLg8Kb+kJ+owWJ+ 981K5OoC+L1ZjQ0yHTJmI03zRCUbWwCER+ZwpYHhVKtg/yYUkdXZX6RXahS+H9ESOi6S VeeomCcfq7Uq6oE34OkJrSevNl9pjQ+D00KngPiBCIYLARFFVE/PZdSIXKIAJAvibr+7 8KOZwa0MNwboIGT49MxtSfpq0+ev9+l/KTKvuyweQoGPJz/zx6ApJIRQPmc9YBSZsEsy 6kUg== X-Gm-Message-State: AGRZ1gI3rZoNelZI0blEMWHXBFyU5ElsqtPs8+b+AknwijxTMyRam0Wk dbk1QdJAD05RUD/Do6KMFEo= X-Received: by 2002:aa7:da45:: with SMTP id w5-v6mr17285879eds.54.1542138931599; Tue, 13 Nov 2018 11:55:31 -0800 (PST) Received: from [192.168.1.18] (dma68.neoplus.adsl.tpnet.pl. [83.24.56.68]) by smtp.gmail.com with ESMTPSA id a4-v6sm3090016eje.16.2018.11.13.11.55.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 11:55:30 -0800 (PST) Subject: Re: [PATCH 02/24] leds: core: Add support for composing LED class device names To: Linus Walleij , Pavel Machek Cc: linux-leds@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , Rob Herring , Baolin Wang , Daniel Mack , dmurphy@ti.com, oleg@kaa.org.ua, Sakari Ailus , simon@lineageos.org, xiaotong.lu@spreadtrum.com References: <1541542052-10081-1-git-send-email-jacek.anaszewski@gmail.com> <1541542052-10081-3-git-send-email-jacek.anaszewski@gmail.com> <20181111120234.GA28794@amd> From: Jacek Anaszewski Message-ID: <90914660-6add-a4d9-0dfe-7b82a7664bd8@gmail.com> Date: Tue, 13 Nov 2018 20:55:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/2018 10:23 PM, Linus Walleij wrote: > On Sun, Nov 11, 2018 at 1:03 PM Pavel Machek wrote: > >>> -"devicename:colour:function" >>> +"colour:function" >> >> I don't think we want to do it in all cases. >> >> So, on my cellphone seeing lp5523:green:led is indeed not useful. >> >> But on notebook with usb keyboard attached, you need to keep the >> devicename to be able to distinguish capslock on internal keyboard and >> capslock on first USB keyboard and capslock on second USB keyboard. > > I agree with Pavel. > > I ran into this when connecting two identical keyboards to the > same machine. The driver worked fine up until it tries > to create two sysfs entries with the same name for capslock. > BOOM! What kernel version did you use? LED core has had a protection against name clash since the commit: commit a96aa64cb5723d941de879a9cd1fea025d6acb1b Author: Ricardo Ribalda Delgado Date: Mon Mar 30 10:45:59 2015 -0700 leds/led-class: Handle LEDs with the same name The current code expected that every LED had an unique name. This is a legit expectation when the device tree can no be modified or extended. But with device tree overlays this requirement can be easily broken. This patch finds out if the name is already in use and adds the suffix _1, _2... if not. Signed-off-by: Ricardo Ribalda Delgado Reported-by: Geert Uytterhoeven Signed-off-by: Bryan Wu > In this case I suggest "serialnumber:color:capslock" and > similar. > > The important point is the string must be unique for each > plugged device. -- Best regards, Jacek Anaszewski