From 77a2d51450119623cf762655386f8e2de71dc1ea Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Tue, 28 Apr 2020 20:31:24 +0200
Subject: [PATCH] chore(hw-locks): Remove legacy interface

---
 epicardium/modules/hw-lock.c | 34 ----------------------------------
 epicardium/modules/modules.h |  1 -
 2 files changed, 35 deletions(-)

diff --git a/epicardium/modules/hw-lock.c b/epicardium/modules/hw-lock.c
index 47929fe06..529963e35 100644
--- a/epicardium/modules/hw-lock.c
+++ b/epicardium/modules/hw-lock.c
@@ -37,40 +37,6 @@ int hwlock_acquire_nonblock(enum hwlock_periph p)
 	}
 }
 
-int hwlock_acquire_timeout(enum hwlock_periph p, TickType_t wait)
-{
-	assert(p < _HWLOCK_MAX);
-
-	/*
-	 * Check for code still defining a timeout.  It will be ignored in the
-	 * new implementation but a warning is emitted so someone hopefully
-	 * eventually fixes the offending code ...
-	 *
-	 * At some point, the signature of this function should be changed.
-	 * Alternatively it could be split into two, similar to the mutex API.
-	 */
-	if (wait != 0 && wait != portMAX_DELAY) {
-		LOG_WARN(
-			"hwlock",
-			"Attempting to lock %d with a timeout (from %p).",
-			p,
-			__builtin_return_address(0)
-		);
-	}
-
-	/* Non-blocking lock attempt */
-	if (wait == 0) {
-		if (mutex_trylock(&hwlock_mutex[p]) == true) {
-			return 0;
-		} else {
-			return -EBUSY;
-		}
-	}
-
-	mutex_lock(&hwlock_mutex[p]);
-	return 0;
-}
-
 void hwlock_release(enum hwlock_periph p)
 {
 	assert(p < _HWLOCK_MAX);
diff --git a/epicardium/modules/modules.h b/epicardium/modules/modules.h
index 0444b688f..67557ad4f 100644
--- a/epicardium/modules/modules.h
+++ b/epicardium/modules/modules.h
@@ -97,7 +97,6 @@ enum hwlock_periph {
 	_HWLOCK_MAX,
 };
 
-int hwlock_acquire_timeout(enum hwlock_periph p, TickType_t wait);
 void hwlock_acquire(enum hwlock_periph p);
 int hwlock_acquire_nonblock(enum hwlock_periph p);
 void hwlock_release(enum hwlock_periph p);
-- 
GitLab