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

From: Arnd Bergmann
Date: Mon Jun 13 2016 - 11:47:14 EST


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