Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751730AbbBRBhL (ORCPT ); Tue, 17 Feb 2015 20:37:11 -0500 Received: from mail-ie0-f178.google.com ([209.85.223.178]:45683 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbbBRBhJ (ORCPT ); Tue, 17 Feb 2015 20:37:09 -0500 MIME-Version: 1.0 In-Reply-To: References: <1423657572-22299-1-git-send-email-ricardo.ribalda@gmail.com> From: Bryan Wu Date: Tue, 17 Feb 2015 17:36:48 -0800 Message-ID: Subject: Re: [PATCH] led/led-class: Handle LEDs with the same name To: Ricardo Ribalda Delgado Cc: Rob Herring , Richard Purdie , Linux LED Subsystem , lkml Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 58 > Thanks! On Tue, Feb 17, 2015 at 5:11 PM, Ricardo Ribalda Delgado wrote: > Hello Bryan > > On Wed, Feb 18, 2015 at 1:52 AM, Bryan Wu wrote: >>> >>> Lets say that we have a type of add-on card. Described by this DT >>> overlay (card.dtb): >>> >> >> I think who write this card.dtb should understand this issue. And >> choose the right name. > > card.dtb just describe the hardware in the card, and it is not be > aware of the rest of the system. > > I dont think it is practical to have card_HOST0_PCI1.dtb, > card_HOST0_PCI2.dtb to HOST0_PCI16.dtb and then HOST1_, HOST2.... > >>> gpio_0: gpio_0 { >>What happen if you just use name 'gpio: gpio {' here.? Any conflicts >>or kernel oops? > > No problem here, one will create the device > > /sys/devices/pci0000:00/0000:00:05.0/0000:01:00.0/30040000.gpio > > and the other: > > /sys/devices/pci0000:00/0000:00:06.0/0000:01:00.0/40040000.gpio > > Name is created with hierarnchy > > /sys/class/gpio/ will also work fine, because the gpiochip id is > created dynamically > > On the other hand all the leds are under, > > /sys/class/leds/NAME > > Do not have any dynamic naming or hierarchical name. > I got it. In this case we need to give the leds device a unique name. Go back to your patch, you're adding 0, 1 at the end of the name of leds. It's better like GPIO I think you can pick up value of leds device node and put it in front of the name of leds. like /sys/class/leds/30040000.red and /sys/class/leds/40040000.red. Thanks, -Bryan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/