lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Staging: greybus: Fix spinlock_t definition without comment
On Fri, Apr 05, 2019 at 03:00:46PM -0500, Madhumitha Prabakaran wrote:
> Fix spinlock_t definition without comment.
>
> Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
> ---
> drivers/staging/greybus/connection.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h
> index 5ca3befc0636..0aedd246e94a 100644
> --- a/drivers/staging/greybus/connection.h
> +++ b/drivers/staging/greybus/connection.h
> @@ -47,7 +47,7 @@ struct gb_connection {
> unsigned long flags;
>
> struct mutex mutex;
> - spinlock_t lock;
> + spinlock_t lock; /* Protect structure fields */
> enum gb_connection_state state;

What does the mutex do then? Why can't we just use the spinlock for
everything?

I did glance at the code and it wasn't immediately obvious to me.

regards,
dan carpenter

\
 
 \ /
  Last update: 2019-04-05 22:53    [W:0.044 / U:33.520 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site