Skip to content

Commit 96e048f

Browse files
tititiou36lag-linaro
authored andcommitted
leds: is31fl319x: Use devm_mutex_init()
Use devm_mutex_init() instead of hand-writing it. This saves some LoC, improves readability and saves some space in the generated .o file. Before: ====== text data bss dec hex filename 20011 6752 128 26891 690b drivers/leds/leds-is31fl319x.o After: ===== text data bss dec hex filename 19715 6680 128 26523 679b drivers/leds/leds-is31fl319x.o Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/267aba6eab12be67c297fcd52fcf45a0856338bb.1757240150.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <[email protected]>
1 parent d605831 commit 96e048f

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

drivers/leds/leds-is31fl319x.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,6 @@ static inline int is31fl3196_db_to_gain(u32 dezibel)
483483
return dezibel / IS31FL3196_AUDIO_GAIN_DB_STEP;
484484
}
485485

486-
static void is31f1319x_mutex_destroy(void *lock)
487-
{
488-
mutex_destroy(lock);
489-
}
490-
491486
static int is31fl319x_probe(struct i2c_client *client)
492487
{
493488
struct is31fl319x_chip *is31;
@@ -503,8 +498,7 @@ static int is31fl319x_probe(struct i2c_client *client)
503498
if (!is31)
504499
return -ENOMEM;
505500

506-
mutex_init(&is31->lock);
507-
err = devm_add_action_or_reset(dev, is31f1319x_mutex_destroy, &is31->lock);
501+
err = devm_mutex_init(dev, &is31->lock);
508502
if (err)
509503
return err;
510504

0 commit comments

Comments
 (0)