From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/163a3807cb1f # HG changeset 735+738 patch # User Keir Fraser # Date 1227525200 0 # Node ID 163a3807cb1fb4f35304a99c63f4deac322df2da # Parent 412b24a36929b7cbedc793b4aad06b334bea021b Subject: linux: remove sysfs files during balloon module exit Patch-mainline: obsolete Relevant when building pv drivers. Also adjust some section attributes of the sysfs code. Signed-off-by: Jan Beulich From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/bf8b1ee634e2 balloon: Fix the build by including Signed-off-by: Keir Fraser Index: head-2008-11-25/drivers/xen/balloon/balloon.c =================================================================== --- head-2008-11-25.orig/drivers/xen/balloon/balloon.c 2008-07-21 11:00:33.000000000 +0200 +++ head-2008-11-25/drivers/xen/balloon/balloon.c 2008-11-25 13:31:07.000000000 +0100 @@ -577,8 +577,8 @@ subsys_initcall(balloon_init); static void __exit balloon_exit(void) { - /* XXX - release balloon here */ - return; + balloon_sysfs_exit(); + /* XXX - release balloon here */ } module_exit(balloon_exit); Index: head-2008-11-25/drivers/xen/balloon/sysfs.c =================================================================== --- head-2008-11-25.orig/drivers/xen/balloon/sysfs.c 2008-04-02 12:34:02.000000000 +0200 +++ head-2008-11-25/drivers/xen/balloon/sysfs.c 2008-11-25 13:31:07.000000000 +0100 @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -111,7 +112,7 @@ static struct sysdev_class balloon_sysde static struct sys_device balloon_sysdev; -static int register_balloon(struct sys_device *sysdev) +static int __init register_balloon(struct sys_device *sysdev) { int i, error; @@ -148,7 +149,7 @@ static int register_balloon(struct sys_d return error; } -static void unregister_balloon(struct sys_device *sysdev) +static __exit void unregister_balloon(struct sys_device *sysdev) { int i; @@ -159,12 +160,12 @@ static void unregister_balloon(struct sy sysdev_class_unregister(&balloon_sysdev_class); } -int balloon_sysfs_init(void) +int __init balloon_sysfs_init(void) { return register_balloon(&balloon_sysdev); } -void balloon_sysfs_exit(void) +void __exit balloon_sysfs_exit(void) { unregister_balloon(&balloon_sysdev); }