# Re: WARNING: mutexes are preferred for single holder semaphores

- From: Sean MacLennan \<hidden\>
- Date: 2008-05-05 04:40:26 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2008/05/9439687
- Thread: https://ratatoskr.run/linuxppc-dev/2008/05/9439680/t.md

```text
On Mon, 05 May 2008 13:38:39 +1000
"Benjamin Herrenschmidt" [ref] wrote:

> Show us the code... It could be a bug in checkpatch or you using 
> the wrong functions somewhere ...

The change to DEFINE_MUTEX and changing up/down to
mutex_lock/mutex_unlock solved the problem.

The code is GPLed but not currently available on the net. It is
basically a little driver that registers a character device and
then passes out the minor numbers to the PIKA board drivers.

It was written to isolate all the character/sysfs code to one place
since we have five drivers, and many debug drivers, that use it.

If anybody is really interested, I can post it here. I doubt it will
ever be submitted to the mainline kernel however.

Cheers,
   Sean
```
