lkml.org 
[lkml]   [2014]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/2] drivers/base: add managed token devres interfaces
On Thu, Apr 17, 2014 at 02:01:32PM -0600, Shuah Khan wrote:
> Operating on the lock should be atomic, which is what devres_update()
> is doing. It can be simplified as follows by holding devres_lock
> in devm_token_lock().
>
> spin_lock_irqsave(&dev->devres_lock, flags);
> if (tkn_ptr->status == TOKEN_DEVRES_FREE)
> tkn_ptr->status = TOKEN_DEVRES_BUSY;
> spin_unlock_irqrestore(&dev->devres_lock, flags);
>
> Is this in-line with what you have in mind?

How is that different from tkn_ptr->status = TOKEN_DEVRES_BUSY?

--
tejun


\
 
 \ /
  Last update: 2014-04-17 22:41    [W:0.071 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site