Skip to contentSkip to conversation

hwmon: Semaphore to mutex conversions

PATCH Arjan van de Ven 1 participant 1 message Apr 2, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines
(quoted diff) +1 -1
@@ -325,7 +326,7 @@ static void hdaps_mousedev_poll(unsigned
 	int x, y;
 
 	/* Cannot sleep.  Try nonblockingly.  If we fail, try again later. */
-	if (down_trylock(&hdaps_sem)) {
+	if (!mutex_trylock(&hdaps_mutex)) {
 		mod_timer(&hdaps_timer,jiffies + HDAPS_POLL_PERIOD);
 		return;
 	}

Review static void hdaps_mousedev_poll(unsigned · line 346

Quoted 7 lines
(quoted diff) +1 -1
@@ -340,7 +341,7 @@ static void hdaps_mousedev_poll(unsigned
 	mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD);
 
 out:
-	up(&hdaps_sem);
+	mutex_unlock(&hdaps_mutex);
 }
 

this isn't right; this is run in irq context!