[PATCH] staging: gdm724x: Replace semaphore netlink with mutex

Arnd Bergmann arnd at arndb.de
Mon Jun 13 15:48:34 UTC 2016


On Monday, June 13, 2016 7:59:20 PM CEST Binoy Jayan wrote:
> 
> -#if defined(DEFINE_MUTEX)
> -static DEFINE_MUTEX(netlink_mutex);
> -#else
> -static struct semaphore netlink_mutex;
> -#define mutex_lock(x)          down(x)
> -#define mutex_unlock(x)                up(x)
> -#endif
> +static struct mutex netlink_mutex;
> 

Good catch! I think the patch is correct, but the DEFINE_MUTEX
here seems preferable over the runtime mutex_init() call.

	Arnd


More information about the devel mailing list