diff options
-rw-r--r-- | drivers/leds/leds-pca955x.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index f062d1e7640f..09303fd1fdc6 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c | |||
@@ -473,10 +473,14 @@ static int pca955x_probe(struct i2c_client *client, | |||
473 | * Platform data can specify LED names and | 473 | * Platform data can specify LED names and |
474 | * default triggers | 474 | * default triggers |
475 | */ | 475 | */ |
476 | if (pdata->leds[i].name) | 476 | if (pdata->leds[i].name[0] == '\0') |
477 | snprintf(pca955x_led->name, | 477 | snprintf(pdata->leds[i].name, |
478 | sizeof(pca955x_led->name), "pca955x:%s", | 478 | sizeof(pdata->leds[i].name), "%d", i); |
479 | pdata->leds[i].name); | 479 | |
480 | snprintf(pca955x_led->name, | ||
481 | sizeof(pca955x_led->name), "pca955x:%s", | ||
482 | pdata->leds[i].name); | ||
483 | |||
480 | if (pdata->leds[i].default_trigger) | 484 | if (pdata->leds[i].default_trigger) |
481 | pca955x_led->led_cdev.default_trigger = | 485 | pca955x_led->led_cdev.default_trigger = |
482 | pdata->leds[i].default_trigger; | 486 | pdata->leds[i].default_trigger; |