summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libgpiod/libgpiod-2.x/0001-bindings-cxx-tests-disable-GPIO-simulator-before-rel.patch
blob: 9747613aa6c60d0c139d17905828fd4a12f96f3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 7df2bb4f51281166633d4acbcff5763150add3fa Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Date: Mon, 3 Feb 2025 13:20:41 +0100
Subject: [PATCH] bindings: cxx: tests: disable GPIO simulator before releasing it

Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") uncovered an issue in C++ bindings
tests where the GPIO simulator device is not disabled before removing its
configfs entries. Add a call to gpiosim_dev_disable() to the
gpiosim::chip's destructor.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Upstream-Status: Submitted [https://lore.kernel.org/all/20250203-fix-gpiosim-in-bindings-v1-1-d2c9e0f3a29d@linaro.org/]
---
 bindings/cxx/tests/gpiosim.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/cxx/tests/gpiosim.cpp b/bindings/cxx/tests/gpiosim.cpp
index 4bda5a2..cdecd8d 100644
--- a/bindings/cxx/tests/gpiosim.cpp
+++ b/bindings/cxx/tests/gpiosim.cpp
@@ -115,7 +115,7 @@ chip::chip(chip&& other)
 
 chip::~chip()
 {
-
+	::gpiosim_dev_disable(this->_m_priv->dev.get());
 }
 
 chip& chip::operator=(chip&& other)
-- 
2.45.2