Skip to contentSkip to conversation

ARM: OMAP: STI netlink sem2mutex conversion.

PATCH In review Paul Mundt 2 participants 2 messages May 4, 2006

Subsystems (2)
lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 ARM: OMAP: STI netlink sem2mutex conversion.

Simple update of the STI netlink interface for the mutex API.

---

 arch/arm/plat-omap/sti/sti-netlink.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/plat-omap/sti/sti-netlink.c +5 -4
index 45b8085..5593aee 100644
@@ -1,7 +1,7 @@
 /*
  * OMAP STI/XTI communications interface via netlink socket.
  *
- * Copyright (C) 2004, 2005 Nokia Corporation
+ * Copyright (C) 2004, 2005, 2006 Nokia Corporation
  * Written by: Paul Mundt <[email protected]>
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -13,11 +13,12 @@ #include <linux/kernel.h>
 #include <linux/netlink.h>
 #include <linux/socket.h>
 #include <linux/skbuff.h>
+#include <linux/mutex.h>
 #include <net/sock.h>
 #include <asm/arch/sti.h>
 
 static struct sock *sti_sock;
-static DECLARE_MUTEX(sti_netlink_sem);
+static DEFINE_MUTEX(sti_netlink_mutex);
 
 enum {
 	STI_READ,
@@ -126,7 +127,7 @@ static void sti_netlink_receive(struct s
 {
 	struct sk_buff *skb;
 
-	if (down_trylock(&sti_netlink_sem))
+	if (!mutex_trylock(&sti_netlink_mutex))
 		return;
 
 	while ((skb = skb_dequeue(&sk->sk_receive_queue)))
@@ -135,7 +136,7 @@ static void sti_netlink_receive(struct s
 		else
 			kfree_skb(skb);
 
-	up(&sti_netlink_sem);
+	mutex_unlock(&sti_netlink_mutex);
 }
 
 static int __init sti_netlink_init(void)
#1 lore raw
Quoted 1 line · Paul Mundt

Simple update of the STI netlink interface for the mutex API.

Pushed.

Tony