> -----Original Message----- > From: Marek Behun <marek.behun@xxxxxx> > Sent: Wednesday, October 07, 2020 3:21 PM > To: Pavel Machek <pavel@xxxxxx> > Cc: Vadim Pasternak <vadimp@xxxxxxxxxx>; jacek.anaszewski@xxxxxxxxx; > linux-leds@xxxxxxxxxxxxxxx > Subject: Re: [PATCH led-next 1/1] leds: mlxreg: Allow multi-instantiation of > same name LED for modular systems > > On Wed, 7 Oct 2020 13:31:05 +0200 > Pavel Machek <pavel@xxxxxx> wrote: > > > On Tue 2020-10-06 19:58:50, Vadim Pasternak wrote: > > > It could be more than one instance of LED with the same name in the > > > modular systems. For example, "status" or "uid" LED can be located > > > on chassis and on each line card of modular system. > > > In order to avoid conflicts with duplicated names, append platform > > > device Id, which is unquie, to LED name after driver name. > > > Thus, for example, "status" LED on chassis is to be called, like it > > > is called now on non modular systems, on which platform device Id is > > > not > > > specified: "mlxreg:status:green". While for the line cards LEDs it > > > will be called like: "mlxreg48:status:green", > > > "mlxreg66:status:green", etcetera. > > > > No. > > > > You really should not have mlxreg: in the LED label. It is useless. 'mlxreg' is device name, which could be CPLD or FPGA. It should be in label. There also few other reasons for that. This name is used in thousands system in the field and customers use it in their application. We used to provide our ASIC and CPLD or FPGA logic (Verilog) to ODM vendors, which build their own switch on top of it and use our drivers. So, the can implement additional LED on their switches, not controlled by our drivers and device name 'mlxreg' allows to distinct between LED objects. Actually name like 'mlxreg48', 'mlxreg56' are yet another 'mlxreg' devices with appended physical bus Id. This is not actually 'functionenumerator'. > > > > Make it so that LEDs on main body are ":foo:bar", and LEDs on the > > expansion card has something reasonable as the device part. > > > > Best regards, > > Pavel > > Moreover the LED core, if there are more LEDs with same color and function, > constructs labels in the form > [device:]color:function-functionenumerator > so if we want your driver to align with other LED drivers, you should put the > enumerator at the end of the label > green:status-48 > green:status-66 > ... > > Pavel, the LED core does not put the ':' symbol at the beginning if there is no > devicename. The LED name is only "color:function". Should this change? > > Marek