title: What is the Linux 3.16 equivalent of SPIN_LOCK_UNLOCKED?
body: <p>Here is a line from a kernel module that I wrote for a 2.x kernel.</p>
  
  <pre><code>static spinlock_t mr_lock = SPIN_LOCK_UNLOCKED;
  </code></pre>
  
  <p>When I try to compile this module for a 3.16 kernel, I get the following build error.</p>
  
  <pre><code>error: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
  </code></pre>
  
  <p>When I look at the 3.16 version of <a href="http://lxr.free-electrons.com/source/include/linux/spinlock_types.h?v=3.16#L76" rel="nofollow"><code>linux/spinlock_types.h</code></a>, which defines the <code>spinlock_t</code> type for this kernel, there is indeed no SPIN_LOCK_UNLOCKED constant anymore.</p>
  
  <p>However, it is not clear how to initialize a spinlock to unlocked for this kernel. </p>
  
  <p>What is the correct way to achieve the same initialization?</p>