summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lm36274.c
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2020-09-19 20:02:59 +0200
committerPavel Machek <pavel@ucw.cz>2020-09-26 21:56:43 +0200
commit484456712de44c516b016b23027ad500acac4d29 (patch)
tree59b4a784dd0fcbcceef2933036052d371f461484 /drivers/leds/leds-lm36274.c
parent1aeef38c6a4a87d04bf5fc596dbf91a15525c987 (diff)
leds: lm36274: do not set chip settings in DT parsing function
These settings are not parsed from DT and therefore semantically should not be set in function with a name lm36274_parse_dt. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Tested-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-lm36274.c')
-rw-r--r--drivers/leds/leds-lm36274.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/leds/leds-lm36274.c b/drivers/leds/leds-lm36274.c
index ee4f90f04f19..85a58a5cbdf9 100644
--- a/drivers/leds/leds-lm36274.c
+++ b/drivers/leds/leds-lm36274.c
@@ -100,14 +100,6 @@ static int lm36274_parse_dt(struct lm36274 *chip,
fwnode_property_read_string(child, "linux,default-trigger",
&chip->led_dev.default_trigger);
- chip->lmu_data.regmap = chip->regmap;
- chip->lmu_data.max_brightness = MAX_BRIGHTNESS_11BIT;
- chip->lmu_data.msb_brightness_reg = LM36274_REG_BRT_MSB;
- chip->lmu_data.lsb_brightness_reg = LM36274_REG_BRT_LSB;
-
- chip->led_dev.max_brightness = MAX_BRIGHTNESS_11BIT;
- chip->led_dev.brightness_set_blocking = lm36274_brightness_set;
-
return 0;
err:
fwnode_handle_put(child);
@@ -142,6 +134,14 @@ static int lm36274_probe(struct platform_device *pdev)
return ret;
}
+ chip->lmu_data.regmap = chip->regmap;
+ chip->lmu_data.max_brightness = MAX_BRIGHTNESS_11BIT;
+ chip->lmu_data.msb_brightness_reg = LM36274_REG_BRT_MSB;
+ chip->lmu_data.lsb_brightness_reg = LM36274_REG_BRT_LSB;
+
+ chip->led_dev.max_brightness = MAX_BRIGHTNESS_11BIT;
+ chip->led_dev.brightness_set_blocking = lm36274_brightness_set;
+
ret = led_classdev_register_ext(chip->dev, &chip->led_dev, &init_data);
if (ret)
dev_err(chip->dev, "Failed to register LED for node %pfw\n",