From 20cba9738a86eeab95b7e9c32d2b3f92a9c9c3d9 Mon Sep 17 00:00:00 2001
From: Rahix <rahix@rahix.de>
Date: Thu, 26 Dec 2019 11:34:30 +0100
Subject: [PATCH] chore(buttons): Port to new hwlock API

Port the buttons module to the new hardware lock API which can no longer
fail.

Signed-off-by: Rahix <rahix@rahix.de>
---
 epicardium/modules/buttons.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/epicardium/modules/buttons.c b/epicardium/modules/buttons.c
index 6afbdf9c..fd86bbad 100644
--- a/epicardium/modules/buttons.c
+++ b/epicardium/modules/buttons.c
@@ -17,13 +17,10 @@ uint8_t epic_buttons_read(uint8_t mask)
 {
 	uint8_t ret = 0;
 	if (portexpander_detected() && (mask & 0x7)) {
-		if (hwlock_acquire_timeout(HWLOCK_I2C, portMAX_DELAY) < 0) {
-			LOG_ERR("buttons", "Can't acquire I2C bus");
-			return 0;
-		}
+		hwlock_acquire(HWLOCK_I2C);
 
 		/*
-		 * Not using PB_Get() here as that performs one I2C transcation
+		 * Not using PB_Get() here as that performs one I2C transaction
 		 * per button.
 		 */
 		uint8_t pin_status = ~portexpander_in_get(0xFF);
-- 
GitLab