Skip to content

Commit

Permalink
leds: lm3601x: Convert class registration to device managed
Browse files Browse the repository at this point in the history
Convert LED flash class registration to device managed class
registration API.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Dan Murphy authored and Pavel committed Nov 3, 2019
1 parent 20cdba9 commit e63a744
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/leds/leds-lm3601x.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ static int lm3601x_register_leds(struct lm3601x_led *led,
init_data.devicename = led->client->name;
init_data.default_label = (led->led_mode == LM3601X_LED_TORCH) ?
"torch" : "infrared";

return led_classdev_flash_register_ext(&led->client->dev,
return devm_led_classdev_flash_register_ext(&led->client->dev,
&led->fled_cdev, &init_data);
}

Expand Down Expand Up @@ -445,7 +444,6 @@ static int lm3601x_remove(struct i2c_client *client)
{
struct lm3601x_led *led = i2c_get_clientdata(client);

led_classdev_flash_unregister(&led->fled_cdev);
mutex_destroy(&led->lock);

return regmap_update_bits(led->regmap, LM3601X_ENABLE_REG,
Expand Down

0 comments on commit e63a744

Please sign in to comment.