summaryrefslogtreecommitdiffstats
path: root/scullc/scullc_unload
diff options
context:
space:
mode:
authorJavier Martinez Canillas <martinez.javier@gmail.com>2010-11-27 07:49:17 +0100
committerJavier Martinez Canillas <martinez.javier@gmail.com>2010-11-27 07:49:17 +0100
commitab121f379a3cff458c90e6f480ba4bb68c8733dd (patch)
treea9851af109ee83646d108bc247d03b131461b764 /scullc/scullc_unload
downloadldd3-ab121f379a3cff458c90e6f480ba4bb68c8733dd.tar.gz
Linux Device Drivers 3 examples
Diffstat (limited to 'scullc/scullc_unload')
-rw-r--r--scullc/scullc_unload11
1 files changed, 11 insertions, 0 deletions
diff --git a/scullc/scullc_unload b/scullc/scullc_unload
new file mode 100644
index 0000000..bb91f71
--- /dev/null
+++ b/scullc/scullc_unload
@@ -0,0 +1,11 @@
+#!/bin/sh
+module="scullc"
+device="scullc"
+
+# invoke rmmod with all arguments we got
+/sbin/rmmod $module $* || exit 1
+
+# remove nodes
+rm -f /dev/${device}[0-3] /dev/${device}
+
+exit 0