mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
leds: pwm: Remove a warning on non-DT platforms
This removes a warning on non-DT-enabled platforms: drivers/leds/leds-pwm.c: In function 'led_pwm_create_of': drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node' Really caused by the local variable that is assigned to and then never used. Just do away with the local var, it's not needed. Technically this code path can never be entered without DT enabled, since there's an earlier check about number of children in the calling function, but the compiler can't see that. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
parent
fc1aee038b
commit
33fc94506b
@ -87,11 +87,10 @@ static inline size_t sizeof_pwm_leds_priv(int num_leds)
|
|||||||
static int led_pwm_create_of(struct platform_device *pdev,
|
static int led_pwm_create_of(struct platform_device *pdev,
|
||||||
struct led_pwm_priv *priv)
|
struct led_pwm_priv *priv)
|
||||||
{
|
{
|
||||||
struct device_node *node = pdev->dev.of_node;
|
|
||||||
struct device_node *child;
|
struct device_node *child;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
for_each_child_of_node(node, child) {
|
for_each_child_of_node(pdev->dev.of_node, child) {
|
||||||
struct led_pwm_data *led_dat = &priv->leds[priv->num_leds];
|
struct led_pwm_data *led_dat = &priv->leds[priv->num_leds];
|
||||||
|
|
||||||
led_dat->cdev.name = of_get_property(child, "label",
|
led_dat->cdev.name = of_get_property(child, "label",
|
||||||
|
Loading…
Reference in New Issue
Block a user