Re: [PATCH 8/8] samples: move watchdog example code from Documentation

2016-09-19 Thread Jonathan Corbet
On Mon, 19 Sep 2016 08:47:39 -0600
Shuah Khan  wrote:

> 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:

Updates needed to watchdog-api.txt and wdt.txt; probably MAINTAINERS too.

(In all of these cases, please feel free to carry the doc file updates
with the rest, they don't need to come through me).

jon


Re: [PATCH 8/8] samples: move watchdog example code from Documentation

2016-09-19 Thread Jonathan Corbet
On Mon, 19 Sep 2016 08:47:39 -0600
Shuah Khan  wrote:

> 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:

Updates needed to watchdog-api.txt and wdt.txt; probably MAINTAINERS too.

(In all of these cases, please feel free to carry the doc file updates
with the rest, they don't need to come through me).

jon


[PATCH 8/8] samples: move watchdog example code from Documentation

2016-09-19 Thread Shuah Khan
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 
---
 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..000
--- 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..000
--- 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..000
--- 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..000
--- a/Documentation/watchdog/src/watchdog-simple.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include 
-#include 
-#include 
-#include 
-
-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 000..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 000..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 000..ba45803
--- /dev/null
+++ b/samples/watchdog/watchdog-simple.c
@@ -0,0 +1,24 @@
+#include 
+#include 
+#include 
+#include 
+
+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



[PATCH 8/8] samples: move watchdog example code from Documentation

2016-09-19 Thread Shuah Khan
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 
---
 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..000
--- 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..000
--- 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..000
--- 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..000
--- a/Documentation/watchdog/src/watchdog-simple.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include 
-#include 
-#include 
-#include 
-
-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 000..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 000..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 000..ba45803
--- /dev/null
+++ b/samples/watchdog/watchdog-simple.c
@@ -0,0 +1,24 @@
+#include 
+#include 
+#include 
+#include 
+
+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