Where did init_MUTEX go to linux kernel version 3.2?
I am following Linux Device Drivers (3rd Edition). When I try to emulate the skull example in chapter 6, an error is reported. It says that:
error: implicit declaration of function βinit_MUTEXβ [-Werror=implicit-function-declaration]
Can anyone tell me where init_MUTEX went? By the way, is there a list where I can check all the kernel API changes?
+3
Douglas Su
source
to share
2 answers
init_MUTEX{_LOCKED}()
was originally implemented as a semaphore . Semaphores were only in older 2.6.16 kernels, now replaces the mutex using earlier semaphores, check the bottom api header andlinux/mutex.h
struct mutex { ...
};
mutex_{init,lock,trylock,unlock,lock_interruptible}()
+6
askb
source
to share
Use mutex_init () instead:
struct scull_pipe {
...
struct mutex mutex;
...
};
mutex_init(&(lptr->device.mutex));
+2
CL.
source
to share