Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/267aba6eab12be67c297fcd52fcf45a0856338bb.1757240150.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Christophe JAILLET and committed by
Lee Jones
96e048fa d6058316

+1 -7
+1 -7
drivers/leds/leds-is31fl319x.c
··· 483 483 return dezibel / IS31FL3196_AUDIO_GAIN_DB_STEP; 484 484 } 485 485 486 - static void is31f1319x_mutex_destroy(void *lock) 487 - { 488 - mutex_destroy(lock); 489 - } 490 - 491 486 static int is31fl319x_probe(struct i2c_client *client) 492 487 { 493 488 struct is31fl319x_chip *is31; ··· 498 503 if (!is31) 499 504 return -ENOMEM; 500 505 501 - mutex_init(&is31->lock); 502 - err = devm_add_action_or_reset(dev, is31f1319x_mutex_destroy, &is31->lock); 506 + err = devm_mutex_init(dev, &is31->lock); 503 507 if (err) 504 508 return err; 505 509