[Pdbg] [PATCH] main: Set I2C backend device specified in arguments

Artem Senichev artemsen at gmail.com
Tue Jan 22 00:49:35 AEDT 2019


Restores the functionality that allows to set I2C backend
device through command line arguments, it was broken by commit
dacc9b57e4615f125eb1f56d842a64c40abb1408

Signed-off-by: Artem Senichev <artemsen at gmail.com>
---
 src/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/main.c b/src/main.c
index 22e74a5..6ae6863 100644
--- a/src/main.c
+++ b/src/main.c
@@ -594,6 +594,15 @@ static bool target_selection(void)
 		return false;
 	}
 
+	/* Set device for I2C backend */
+	if (backend == I2C && device_node) {
+		struct pdbg_target *pib;
+		const size_t len = strlen(device_node) + 1 /* include last null */;
+		pdbg_for_each_class_target("pib", pib) {
+			pdbg_target_set_property(pib, "bus", device_node, len);
+		}
+	}
+
 	if (pathsel_count) {
 		if (!path_target_parse(pathsel, pathsel_count))
 			return false;
-- 
2.20.1



More information about the Pdbg mailing list