1 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/163a3807cb1f
2 # HG changeset 735+738 patch
3 # User Keir Fraser <keir.fraser@citrix.com>
5 # Node ID 163a3807cb1fb4f35304a99c63f4deac322df2da
6 # Parent 412b24a36929b7cbedc793b4aad06b334bea021b
7 Subject: linux: remove sysfs files during balloon module exit
8 Patch-mainline: obsolete
10 Relevant when building pv drivers.
12 Also adjust some section attributes of the sysfs code.
14 Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/bf8b1ee634e2
17 balloon: Fix the build by including <linux/init.h>
19 Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
21 Index: head-2008-11-25/drivers/xen/balloon/balloon.c
22 ===================================================================
23 --- head-2008-11-25.orig/drivers/xen/balloon/balloon.c 2008-07-21 11:00:33.000000000 +0200
24 +++ head-2008-11-25/drivers/xen/balloon/balloon.c 2008-11-25 13:31:07.000000000 +0100
25 @@ -577,8 +577,8 @@ subsys_initcall(balloon_init);
27 static void __exit balloon_exit(void)
29 - /* XXX - release balloon here */
31 + balloon_sysfs_exit();
32 + /* XXX - release balloon here */
35 module_exit(balloon_exit);
36 Index: head-2008-11-25/drivers/xen/balloon/sysfs.c
37 ===================================================================
38 --- head-2008-11-25.orig/drivers/xen/balloon/sysfs.c 2008-04-02 12:34:02.000000000 +0200
39 +++ head-2008-11-25/drivers/xen/balloon/sysfs.c 2008-11-25 13:31:07.000000000 +0100
42 #include <linux/capability.h>
43 #include <linux/errno.h>
44 +#include <linux/init.h>
45 #include <linux/stat.h>
46 #include <linux/string.h>
47 #include <linux/sysdev.h>
48 @@ -111,7 +112,7 @@ static struct sysdev_class balloon_sysde
50 static struct sys_device balloon_sysdev;
52 -static int register_balloon(struct sys_device *sysdev)
53 +static int __init register_balloon(struct sys_device *sysdev)
57 @@ -148,7 +149,7 @@ static int register_balloon(struct sys_d
61 -static void unregister_balloon(struct sys_device *sysdev)
62 +static __exit void unregister_balloon(struct sys_device *sysdev)
66 @@ -159,12 +160,12 @@ static void unregister_balloon(struct sy
67 sysdev_class_unregister(&balloon_sysdev_class);
70 -int balloon_sysfs_init(void)
71 +int __init balloon_sysfs_init(void)
73 return register_balloon(&balloon_sysdev);
76 -void balloon_sysfs_exit(void)
77 +void __exit balloon_sysfs_exit(void)
79 unregister_balloon(&balloon_sysdev);