RE: [PATCH led-next 1/1] leds: mlxreg: Allow multi-instantiation of same name LED for modular systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Pavel Machek <pavel@xxxxxx>
> Sent: Thursday, October 08, 2020 10:56 AM
> To: Vadim Pasternak <vadimp@xxxxxxxxxx>
> Cc: Marek Behun <marek.behun@xxxxxx>; 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
> 
> Hi!
> 
> > > > > 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.
> 
> No.
> 
> You can try to explain what "mlxreg" means, but...
> 
> You can get away with "eth0" as a device name. We should talk about
> "switch0" I guess.
> 
> > There also few other reasons for that.
> >
> > This name is used in thousands system in the field and customers use
> > it in their application.
> 
> That may be reason not to change existing names.
> 
> > 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.
> 
> But noone is currently using mlxreg123 in their applications, so that part is not
> going in.

Yes, this is true.
I could modify it as:

		if (priv->pdev->id > 0)
			sprintf(led_data->led_cdev_name, "%s%d:%s", "card",
				priv->pdev->id, data->label);
		else
			sprintf(led_data->led_cdev_name, "%s:%s", "mlxreg",
				data->label);

> 
> Best regards,
> 
> 									Pavel
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures)
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux