Thread (36 messages) 36 messages, 6 authors, 2023-12-07

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

From: Andy Shevchenko <hidden>
Date: 2023-12-07 12:03:11
Also in: linux-leds, lkml

On Thu, Dec 7, 2023 at 1:23 AM George Stark [off-list ref] wrote:
On 12/7/23 01:37, Christophe Leroy wrote:
quoted
Le 06/12/2023 à 23:14, Christophe Leroy a écrit :
...
quoted
Looking at it closer, I have the feeling that you want to do similar to
devm_gpio_request() in linux/gpio.h :

In linux/mutex.h, add a prototype for devm_mutex_init() when
CONFIG_DEBUG_MUTEXES is defined and an empty static inline otherwise.
Then define devm_mutex_init() in kernel/locking/mutex-debug.c
Yes, this would be almost perfect decision. BTW just as in linux/gpio.h
we wouldn't have to include whole "linux/device.h" into mutex.h, only
add forward declaration of struct device;
In case you place it into a C-file. Otherwise you need a header for
the API and that is not acceptable for mutex.h.

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help