From: Alison Chaiken <[email protected]>

Signed-off-by: Alison Chaiken <[email protected]>
---
 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 [email protected]
+ *
+ * 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

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to