linux: remove sysfs files during balloon module exit
PATCH 1/1 linux: remove sysfs files during balloon module exit
Relevant when building pv drivers.
Also adjust some section attributes of the sysfs code.
As usual, written and tested on 2.6.27.6 and made apply to the 2.6.18 tree without further testing.
Signed-off-by Jan Beulich <[email protected]>
drivers/xen/balloon/balloon.c +2 -2
@@ -580,8 +580,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);
drivers/xen/balloon/sysfs.c +4 -4
@@ -118,7 +118,7 @@ static struct sysdev_class balloon_sysdestatic 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;
@@ -155,7 +155,7 @@ static int register_balloon(struct sys_dreturn error; } -static void unregister_balloon (struct sys_device *sysdev) +static __exit void unregister_balloon(struct sys_device *sysdev) {int i;
@@ -166,12 +166,12 @@ static void unregister_balloon(struct sysysdev_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); }