summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2023-03-29 12:14:42 +0200
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-18 11:15:24 -0700
commit48380368dec14859723b9e3fbd43e042638d9a76 (patch)
tree9101bd4621e4516b4f84e9c7dda87cb71487ba7a /drivers/staging
parent430bb0d1c3376c988982f14bcbe71f917c89e1ab (diff)
Change DEFINE_SEMAPHORE() to take a number argument
Fundamentally semaphores are a counted primitive, but DEFINE_SEMAPHORE() does not expose this and explicitly creates a binary semaphore. Change DEFINE_SEMAPHORE() to take a number argument and use that in the few places that open-coded it using __SEMAPHORE_INITIALIZER(). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> [mcgrof: add some tribal knowledge about why some folks prefer binary sempahores over mutexes] Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index cddcd3c596c9..1a656fdc9445 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -149,7 +149,7 @@ static char *g_fragments_base;
static char *g_free_fragments;
static struct semaphore g_free_fragments_sema;
-static DEFINE_SEMAPHORE(g_free_fragments_mutex);
+static DEFINE_SEMAPHORE(g_free_fragments_mutex, 1);
static int
vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handle, void *data,