]> git.baikalelectronics.ru Git - kernel.git/commit
leds: leds-gpio: Fix multiple instances registration without 'label' property
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 4 Dec 2014 01:28:19 +0000 (02:28 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 4 Dec 2014 01:28:19 +0000 (02:28 +0100)
commit485d386d2892c9e74dbdc633fb71d003430cfeba
treeff84d6c5c98e4317dc340e81557d7217b0d10203
parent2856600ff019bfbe840310e5af13c72dab24241d
leds: leds-gpio: Fix multiple instances registration without 'label' property

Since commit f18f3ee53e9a7db ("leds: leds-gpio: Make use of device property
API") it is no longer possible to register multiple gpio leds without passing
the 'label' property.

According to Documentation/devicetree/bindings/leds/common.txt:

"Optional properties for child nodes:
- label : The label for this LED.  If omitted, the label is
  taken from the node name (excluding the unit address)."

So retrieve the node name when the 'label' property is absent to keep the old
behaviour and fix this regression.

Fixes: f18f3ee53e9a (leds: leds-gpio: Make use of device property API)
Reported-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/leds/leds-gpio.c