aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-01-09 03:39:43 -0500
committerLen Brown <len.brown@intel.com>2009-01-09 03:39:43 -0500
commitb2576e1d4408e134e2188c967b1f28af39cd79d4 (patch)
tree004f3c82faab760f304ce031d6d2f572e7746a50 /samples
parent3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff)
parent2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff)
Merge branch 'linus' into release
Diffstat (limited to 'samples')
-rw-r--r--samples/firmware_class/firmware_sample_driver.c2
-rw-r--r--samples/kobject/kobject-example.c4
-rw-r--r--samples/kobject/kset-example.c4
-rw-r--r--samples/markers/marker-example.c4
-rw-r--r--samples/tracepoints/tp-samples-trace.h4
-rw-r--r--samples/tracepoints/tracepoint-probe-sample.c5
-rw-r--r--samples/tracepoints/tracepoint-probe-sample2.c5
-rw-r--r--samples/tracepoints/tracepoint-sample.c7
8 files changed, 20 insertions, 15 deletions
diff --git a/samples/firmware_class/firmware_sample_driver.c b/samples/firmware_class/firmware_sample_driver.c
index 11114f389c49..219a29896603 100644
--- a/samples/firmware_class/firmware_sample_driver.c
+++ b/samples/firmware_class/firmware_sample_driver.c
@@ -100,7 +100,7 @@ static void sample_probe_async(void)
100 " request_firmware_nowait failed\n"); 100 " request_firmware_nowait failed\n");
101} 101}
102 102
103static int sample_init(void) 103static int __init sample_init(void)
104{ 104{
105 device_initialize(&ghost_device); 105 device_initialize(&ghost_device);
106 /* since there is no real hardware insertion I just call the 106 /* since there is no real hardware insertion I just call the
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index 08d0d3ff3263..8d9b55a12023 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -101,7 +101,7 @@ static struct attribute_group attr_group = {
101 101
102static struct kobject *example_kobj; 102static struct kobject *example_kobj;
103 103
104static int example_init(void) 104static int __init example_init(void)
105{ 105{
106 int retval; 106 int retval;
107 107
@@ -126,7 +126,7 @@ static int example_init(void)
126 return retval; 126 return retval;
127} 127}
128 128
129static void example_exit(void) 129static void __exit example_exit(void)
130{ 130{
131 kobject_put(example_kobj); 131 kobject_put(example_kobj);
132} 132}
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 7395c0bbae18..45b7d56fb541 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -229,7 +229,7 @@ static void destroy_foo_obj(struct foo_obj *foo)
229 kobject_put(&foo->kobj); 229 kobject_put(&foo->kobj);
230} 230}
231 231
232static int example_init(void) 232static int __init example_init(void)
233{ 233{
234 /* 234 /*
235 * Create a kset with the name of "kset_example", 235 * Create a kset with the name of "kset_example",
@@ -264,7 +264,7 @@ foo_error:
264 return -EINVAL; 264 return -EINVAL;
265} 265}
266 266
267static void example_exit(void) 267static void __exit example_exit(void)
268{ 268{
269 destroy_foo_obj(baz_obj); 269 destroy_foo_obj(baz_obj);
270 destroy_foo_obj(bar_obj); 270 destroy_foo_obj(bar_obj);
diff --git a/samples/markers/marker-example.c b/samples/markers/marker-example.c
index e90dc5d04392..e9cd9c0bc84f 100644
--- a/samples/markers/marker-example.c
+++ b/samples/markers/marker-example.c
@@ -30,7 +30,7 @@ static struct file_operations mark_ops = {
30 .open = my_open, 30 .open = my_open,
31}; 31};
32 32
33static int example_init(void) 33static int __init example_init(void)
34{ 34{
35 printk(KERN_ALERT "example init\n"); 35 printk(KERN_ALERT "example init\n");
36 pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops); 36 pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops);
@@ -39,7 +39,7 @@ static int example_init(void)
39 return 0; 39 return 0;
40} 40}
41 41
42static void example_exit(void) 42static void __exit example_exit(void)
43{ 43{
44 printk(KERN_ALERT "example exit\n"); 44 printk(KERN_ALERT "example exit\n");
45 remove_proc_entry("marker-example", NULL); 45 remove_proc_entry("marker-example", NULL);
diff --git a/samples/tracepoints/tp-samples-trace.h b/samples/tracepoints/tp-samples-trace.h
index 0216b55bd640..01724e04c556 100644
--- a/samples/tracepoints/tp-samples-trace.h
+++ b/samples/tracepoints/tp-samples-trace.h
@@ -4,10 +4,10 @@
4#include <linux/proc_fs.h> /* for struct inode and struct file */ 4#include <linux/proc_fs.h> /* for struct inode and struct file */
5#include <linux/tracepoint.h> 5#include <linux/tracepoint.h>
6 6
7DEFINE_TRACE(subsys_event, 7DECLARE_TRACE(subsys_event,
8 TPPROTO(struct inode *inode, struct file *file), 8 TPPROTO(struct inode *inode, struct file *file),
9 TPARGS(inode, file)); 9 TPARGS(inode, file));
10DEFINE_TRACE(subsys_eventb, 10DECLARE_TRACE(subsys_eventb,
11 TPPROTO(void), 11 TPPROTO(void),
12 TPARGS()); 12 TPARGS());
13#endif 13#endif
diff --git a/samples/tracepoints/tracepoint-probe-sample.c b/samples/tracepoints/tracepoint-probe-sample.c
index 55abfdda4bd4..9e60eb6ca2d8 100644
--- a/samples/tracepoints/tracepoint-probe-sample.c
+++ b/samples/tracepoints/tracepoint-probe-sample.c
@@ -28,7 +28,7 @@ static void probe_subsys_eventb(void)
28 printk(KERN_INFO "Event B is encountered\n"); 28 printk(KERN_INFO "Event B is encountered\n");
29} 29}
30 30
31int __init tp_sample_trace_init(void) 31static int __init tp_sample_trace_init(void)
32{ 32{
33 int ret; 33 int ret;
34 34
@@ -42,10 +42,11 @@ int __init tp_sample_trace_init(void)
42 42
43module_init(tp_sample_trace_init); 43module_init(tp_sample_trace_init);
44 44
45void __exit tp_sample_trace_exit(void) 45static void __exit tp_sample_trace_exit(void)
46{ 46{
47 unregister_trace_subsys_eventb(probe_subsys_eventb); 47 unregister_trace_subsys_eventb(probe_subsys_eventb);
48 unregister_trace_subsys_event(probe_subsys_event); 48 unregister_trace_subsys_event(probe_subsys_event);
49 tracepoint_synchronize_unregister();
49} 50}
50 51
51module_exit(tp_sample_trace_exit); 52module_exit(tp_sample_trace_exit);
diff --git a/samples/tracepoints/tracepoint-probe-sample2.c b/samples/tracepoints/tracepoint-probe-sample2.c
index 5e9fcf4afffe..be2a960573f1 100644
--- a/samples/tracepoints/tracepoint-probe-sample2.c
+++ b/samples/tracepoints/tracepoint-probe-sample2.c
@@ -18,7 +18,7 @@ static void probe_subsys_event(struct inode *inode, struct file *file)
18 inode->i_ino); 18 inode->i_ino);
19} 19}
20 20
21int __init tp_sample_trace_init(void) 21static int __init tp_sample_trace_init(void)
22{ 22{
23 int ret; 23 int ret;
24 24
@@ -30,9 +30,10 @@ int __init tp_sample_trace_init(void)
30 30
31module_init(tp_sample_trace_init); 31module_init(tp_sample_trace_init);
32 32
33void __exit tp_sample_trace_exit(void) 33static void __exit tp_sample_trace_exit(void)
34{ 34{
35 unregister_trace_subsys_event(probe_subsys_event); 35 unregister_trace_subsys_event(probe_subsys_event);
36 tracepoint_synchronize_unregister();
36} 37}
37 38
38module_exit(tp_sample_trace_exit); 39module_exit(tp_sample_trace_exit);
diff --git a/samples/tracepoints/tracepoint-sample.c b/samples/tracepoints/tracepoint-sample.c
index 4ae4b7fcc043..68d5dc0310e4 100644
--- a/samples/tracepoints/tracepoint-sample.c
+++ b/samples/tracepoints/tracepoint-sample.c
@@ -13,6 +13,9 @@
13#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
14#include "tp-samples-trace.h" 14#include "tp-samples-trace.h"
15 15
16DEFINE_TRACE(subsys_event);
17DEFINE_TRACE(subsys_eventb);
18
16struct proc_dir_entry *pentry_example; 19struct proc_dir_entry *pentry_example;
17 20
18static int my_open(struct inode *inode, struct file *file) 21static int my_open(struct inode *inode, struct file *file)
@@ -29,7 +32,7 @@ static struct file_operations mark_ops = {
29 .open = my_open, 32 .open = my_open,
30}; 33};
31 34
32static int example_init(void) 35static int __init example_init(void)
33{ 36{
34 printk(KERN_ALERT "example init\n"); 37 printk(KERN_ALERT "example init\n");
35 pentry_example = proc_create("tracepoint-example", 0444, NULL, 38 pentry_example = proc_create("tracepoint-example", 0444, NULL,
@@ -39,7 +42,7 @@ static int example_init(void)
39 return 0; 42 return 0;
40} 43}
41 44
42static void example_exit(void) 45static void __exit example_exit(void)
43{ 46{
44 printk(KERN_ALERT "example exit\n"); 47 printk(KERN_ALERT "example exit\n");
45 remove_proc_entry("tracepoint-example", NULL); 48 remove_proc_entry("tracepoint-example", NULL);