diff options
author | Dan Murphy <dmurphy@ti.com> | 2020-07-16 13:20:01 -0500 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-07-22 14:42:06 +0200 |
commit | 92a81562e695628086acb92f95090ab09d9b9ec0 (patch) | |
tree | 7d41c63208ac3429720c7ad844827eb944ffbb0a /drivers/leds/leds-lp5562.c | |
parent | c732eaf01f9c213d34b2d224bcda830089bbcf8a (diff) | |
download | linux-92a81562e695628086acb92f95090ab09d9b9ec0.tar.gz linux-92a81562e695628086acb92f95090ab09d9b9ec0.tar.bz2 linux-92a81562e695628086acb92f95090ab09d9b9ec0.zip |
leds: lp55xx: Add multicolor framework support to lp55xx
Add multicolor framework support for the lp55xx family.
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-lp5562.c')
-rw-r--r-- | drivers/leds/leds-lp5562.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp5562.c b/drivers/leds/leds-lp5562.c index 1c94422408b0..7ecdd199d7ef 100644 --- a/drivers/leds/leds-lp5562.c +++ b/drivers/leds/leds-lp5562.c @@ -520,9 +520,16 @@ static int lp5562_probe(struct i2c_client *client, struct lp55xx_platform_data *pdata = dev_get_platdata(&client->dev); struct device_node *np = client->dev.of_node; + chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + + chip->cfg = &lp5562_cfg; + if (!pdata) { if (np) { - pdata = lp55xx_of_populate_pdata(&client->dev, np); + pdata = lp55xx_of_populate_pdata(&client->dev, np, + chip); if (IS_ERR(pdata)) return PTR_ERR(pdata); } else { @@ -531,9 +538,6 @@ static int lp5562_probe(struct i2c_client *client, } } - chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); - if (!chip) - return -ENOMEM; led = devm_kcalloc(&client->dev, pdata->num_channels, sizeof(*led), GFP_KERNEL); @@ -542,7 +546,6 @@ static int lp5562_probe(struct i2c_client *client, chip->cl = client; chip->pdata = pdata; - chip->cfg = &lp5562_cfg; mutex_init(&chip->lock); |