[PATCH 2/3] add SPI bus fake enumeration stub

alison at she-devel.com alison at she-devel.com
Wed Jan 15 08:00:43 UTC 2014


From: Alison Chaiken <alison_chaiken at mentor.com>

Signed-off-by: Alison Chaiken <alison_chaiken at mentor.com>
---
 util-linux/lsspi.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 util-linux/lsspi.c

diff --git a/util-linux/lsspi.c b/util-linux/lsspi.c
new file mode 100644
index 0000000..ff8db91
--- /dev/null
+++ b/util-linux/lsspi.c
@@ -0,0 +1,36 @@
+/*
+ * lsi2c implementation for busybox
+ *
+ * Copyright (C) 2013 Alison Chaiken alison at she-devel.com
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+//usage:#define lsspi_trivial_usage NOUSAGE_STR
+//usage:#define lsspi_full_usage ""
+
+#include "libbb.h"
+
+static int FAST_FUNC fileAction(
+		const char *fileName,
+		struct stat *statbuf UNUSED_PARAM,
+		void *userData UNUSED_PARAM,
+		int depth UNUSED_PARAM)
+{
+	return TRUE;
+}
+
+int lsspi_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int lsspi_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
+{
+	/* no options, no getopt */
+
+	recursive_action("/sys/bus/spi/devices",
+			ACTION_RECURSE,
+			fileAction,
+			NULL, /* dirAction */
+			NULL, /* userData */
+			0 /* depth */);
+
+	return EXIT_SUCCESS;
+}
-- 
1.8.5.2



More information about the busybox mailing list