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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: PAC1934: 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
50985 23992 192 75169 125a1 drivers/iio/adc/pac1934.o

After:
=====
text data bss dec hex filename
50654 23920 192 74766 1240e drivers/iio/adc/pac1934.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/f92033415f43aa02fe862cb952e62b6ded949056.1757239464.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Christophe JAILLET and committed by
Jonathan Cameron
f29b08cd 106511d2

+1 -10
+1 -10
drivers/iio/adc/pac1934.c
··· 1455 1455 return 0; 1456 1456 } 1457 1457 1458 - static void pac1934_mutex_destroy(void *data) 1459 - { 1460 - struct mutex *lock = data; 1461 - 1462 - mutex_destroy(lock); 1463 - } 1464 - 1465 1458 static const struct iio_info pac1934_info = { 1466 1459 .read_raw = pac1934_read_raw, 1467 1460 .write_raw = pac1934_write_raw, ··· 1513 1520 return dev_err_probe(dev, ret, 1514 1521 "parameter parsing returned an error\n"); 1515 1522 1516 - mutex_init(&info->lock); 1517 - ret = devm_add_action_or_reset(dev, pac1934_mutex_destroy, 1518 - &info->lock); 1523 + ret = devm_mutex_init(dev, &info->lock); 1519 1524 if (ret < 0) 1520 1525 return ret; 1521 1526