Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1486567
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 8/8] samples: move watchdog example code from Documentation |
| Date | 2016-09-19 16:50 +0200 |
| Message-ID | <sj83p-6ES-51@gated-at.bofh.it> (permalink) |
| References | <sj83n-6ES-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Move watchdog examples to samples and remove it from Documentation
Makefile. Create a new Makefile to build watchdog. It can be built
from top level directory or from watchdog directory:
Run make -C samples/watchdog or cd samples/watchdog; make
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
Documentation/Makefile | 2 +-
Documentation/watchdog/Makefile | 1 -
Documentation/watchdog/src/.gitignore | 1 -
Documentation/watchdog/src/Makefile | 5 -----
Documentation/watchdog/src/watchdog-simple.c | 24 ------------------------
samples/watchdog/.gitignore | 1 +
samples/watchdog/Makefile | 8 ++++++++
samples/watchdog/watchdog-simple.c | 24 ++++++++++++++++++++++++
8 files changed, 34 insertions(+), 32 deletions(-)
delete mode 100644 Documentation/watchdog/Makefile
delete mode 100644 Documentation/watchdog/src/.gitignore
delete mode 100644 Documentation/watchdog/src/Makefile
delete mode 100644 Documentation/watchdog/src/watchdog-simple.c
create mode 100644 samples/watchdog/.gitignore
create mode 100644 samples/watchdog/Makefile
create mode 100644 samples/watchdog/watchdog-simple.c
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9c3fe11..8435965 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1 +1 @@
-subdir-y := blackfin watchdog
+subdir-y := blackfin
diff --git a/Documentation/watchdog/Makefile b/Documentation/watchdog/Makefile
deleted file mode 100644
index 6018f45..0000000
--- a/Documentation/watchdog/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-subdir-y := src
diff --git a/Documentation/watchdog/src/.gitignore b/Documentation/watchdog/src/.gitignore
deleted file mode 100644
index ff0ebb5..0000000
--- a/Documentation/watchdog/src/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-watchdog-simple
diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile
deleted file mode 100644
index 47be791..0000000
--- a/Documentation/watchdog/src/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# List of programs to build
-hostprogs-y := watchdog-simple
-
-# Tell kbuild to always build the programs
-always := $(hostprogs-y)
diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c
deleted file mode 100644
index ba45803..0000000
--- a/Documentation/watchdog/src/watchdog-simple.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-int main(void)
-{
- int fd = open("/dev/watchdog", O_WRONLY);
- int ret = 0;
- if (fd == -1) {
- perror("watchdog");
- exit(EXIT_FAILURE);
- }
- while (1) {
- ret = write(fd, "\0", 1);
- if (ret != 1) {
- ret = -1;
- break;
- }
- sleep(10);
- }
- close(fd);
- return ret;
-}
diff --git a/samples/watchdog/.gitignore b/samples/watchdog/.gitignore
new file mode 100644
index 0000000..ff0ebb5
--- /dev/null
+++ b/samples/watchdog/.gitignore
@@ -0,0 +1 @@
+watchdog-simple
diff --git a/samples/watchdog/Makefile b/samples/watchdog/Makefile
new file mode 100644
index 0000000..9b53d89
--- /dev/null
+++ b/samples/watchdog/Makefile
@@ -0,0 +1,8 @@
+CC := $(CROSS_COMPILE)gcc
+PROGS := watchdog-simple
+
+all: $(PROGS)
+
+clean:
+ rm -fr $(PROGS)
+
diff --git a/samples/watchdog/watchdog-simple.c b/samples/watchdog/watchdog-simple.c
new file mode 100644
index 0000000..ba45803
--- /dev/null
+++ b/samples/watchdog/watchdog-simple.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int main(void)
+{
+ int fd = open("/dev/watchdog", O_WRONLY);
+ int ret = 0;
+ if (fd == -1) {
+ perror("watchdog");
+ exit(EXIT_FAILURE);
+ }
+ while (1) {
+ ret = write(fd, "\0", 1);
+ if (ret != 1) {
+ ret = -1;
+ break;
+ }
+ sleep(10);
+ }
+ close(fd);
+ return ret;
+}
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/8] Move runnable examples code from Documentation to samples Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 16:50 +0200
[PATCH 3/8] samples: move laptops example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 16:50 +0200
Re: [PATCH 3/8] samples: move laptops example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:20 +0200
Re: [PATCH 3/8] samples: move laptops example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-20 18:20 +0200
[PATCH 2/8] samples: move auxdisplay example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 16:50 +0200
Re: [PATCH 2/8] samples: move auxdisplay example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:10 +0200
Re: samples: move auxdisplay example code from Documentation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-19 22:00 +0200
Re: [PATCH 2/8] samples: move auxdisplay example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-20 18:20 +0200
[PATCH 8/8] samples: move watchdog example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 16:50 +0200
Re: [PATCH 8/8] samples: move watchdog example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:30 +0200
[PATCH 5/8] samples: move misc-devices/mei example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 16:50 +0200
Re: [PATCH 5/8] samples: move misc-devices/mei example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:20 +0200
RE: [PATCH 5/8] samples: move misc-devices/mei example code from Documentation "Winkler, Tomas" <tomas.winkler@intel.com> - 2016-09-20 08:20 +0200
Re: [PATCH 5/8] samples: move misc-devices/mei example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-20 19:30 +0200
[PATCH 1/8] samples: move accounting example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-19 17:00 +0200
Re: [PATCH 1/8] samples: move accounting example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:10 +0200
Re: [PATCH 1/8] samples: move accounting example code from Documentation Shuah Khan <shuahkh@osg.samsung.com> - 2016-09-20 18:10 +0200
Re: [PATCH 0/8] Move runnable examples code from Documentation to samples Jani Nikula <jani.nikula@linux.intel.com> - 2016-09-19 17:50 +0200
Re: [PATCH 4/8] samples: move mic/mpssd example code from Documentation Jonathan Corbet <corbet@lwn.net> - 2016-09-19 18:20 +0200
csiph-web