diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2009-09-15 11:05:32 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-09-27 23:20:13 -0400 |
commit | 5e6f9725ace758c11895969d8b8175290b0cbc39 (patch) | |
tree | c2099a8ef9829a426a21a2f02ce3a4bde44fe6c6 /drivers/platform | |
parent | 922553f20b6ff03d2f08229e6e4556843ae874da (diff) |
sony-laptop: Don't unregister the SPIC driver if it wasn't registered
This fixes a warning when the module is unloaded on machines without SPIC.
------------[ cut here ]------------
WARNING: at drivers/base/driver.c:261 driver_unregister+0x6e/0x80()
Hardware name: OEM
Unexpected driver unregister!
Modules linked in: sony_laptop(-) rfkill af_packet i915
drm i2c_algo_bit cfbcopyarea i2c_core cfbimgblt cfbfillrect binfmt_misc
ipv6 kvm_intel kvm acpi_cpufreq cpufreq_userspace cpufreq_powersave
cpufreq_stats acpi_pad ac video output battery pci_slot sbs sbshc
container iptable_filter ip_tables x_tables ext2 fuse
snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss
snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi_event
snd_seq snd_timer snd_seq_device snd fan sg serio_raw sr_mod cdrom
soundcore button thermal processor thermal_sys floppy snd_page_alloc
pcspkr intel_agp evdev [last unloaded: asus_atk0110]
Pid: 8136, comm: modprobe Not tainted 2.6.31-rc8debug #50
Call Trace:
[<ffffffff8121ec7e>] ? driver_unregister+0x6e/0x80
[<ffffffff81047577>] warn_slowpath_common+0x87/0xb0
[<ffffffff81047624>] warn_slowpath_fmt+0x64/0x70
[<ffffffff8119a360>] ? kobject_release+0x0/0x1f0
[<ffffffff8119a267>] ? kobject_put+0x27/0x60
[<ffffffff8121d346>] ? bus_put+0x16/0x20
[<ffffffff8121d406>] ? bus_remove_driver+0xb6/0xf0
[<ffffffff8121ec7e>] driver_unregister+0x6e/0x80
[<ffffffff811cab50>] acpi_bus_unregister_driver+0x10/0x12
[<ffffffffa035e86c>] sony_laptop_exit+0x2c/0x2e [sony_laptop]
[<ffffffff8107ddc6>] sys_delete_module+0x176/0x230
[<ffffffff8107186d>] ? trace_hardirqs_on_caller+0x14d/0x1a0
[<ffffffff81350a04>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff8100bdab>] system_call_fastpath+0x16/0x1b
---[ end trace f638b6a59b19703e ]---
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index f4241ac2a5e3..15c58c54ded3 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -1402,6 +1402,8 @@ static struct sony_pic_dev spic_dev = { | |||
1402 | .ioports = LIST_HEAD_INIT(spic_dev.ioports), | 1402 | .ioports = LIST_HEAD_INIT(spic_dev.ioports), |
1403 | }; | 1403 | }; |
1404 | 1404 | ||
1405 | static int spic_drv_registered; | ||
1406 | |||
1405 | /* Event masks */ | 1407 | /* Event masks */ |
1406 | #define SONYPI_JOGGER_MASK 0x00000001 | 1408 | #define SONYPI_JOGGER_MASK 0x00000001 |
1407 | #define SONYPI_CAPTURE_MASK 0x00000002 | 1409 | #define SONYPI_CAPTURE_MASK 0x00000002 |
@@ -2916,6 +2918,7 @@ static int __init sony_laptop_init(void) | |||
2916 | "Unable to register SPIC driver."); | 2918 | "Unable to register SPIC driver."); |
2917 | goto out; | 2919 | goto out; |
2918 | } | 2920 | } |
2921 | spic_drv_registered = 1; | ||
2919 | } | 2922 | } |
2920 | 2923 | ||
2921 | result = acpi_bus_register_driver(&sony_nc_driver); | 2924 | result = acpi_bus_register_driver(&sony_nc_driver); |
@@ -2927,7 +2930,7 @@ static int __init sony_laptop_init(void) | |||
2927 | return 0; | 2930 | return 0; |
2928 | 2931 | ||
2929 | out_unregister_pic: | 2932 | out_unregister_pic: |
2930 | if (!no_spic) | 2933 | if (spic_drv_registered) |
2931 | acpi_bus_unregister_driver(&sony_pic_driver); | 2934 | acpi_bus_unregister_driver(&sony_pic_driver); |
2932 | out: | 2935 | out: |
2933 | return result; | 2936 | return result; |
@@ -2936,7 +2939,7 @@ out: | |||
2936 | static void __exit sony_laptop_exit(void) | 2939 | static void __exit sony_laptop_exit(void) |
2937 | { | 2940 | { |
2938 | acpi_bus_unregister_driver(&sony_nc_driver); | 2941 | acpi_bus_unregister_driver(&sony_nc_driver); |
2939 | if (!no_spic) | 2942 | if (spic_drv_registered) |
2940 | acpi_bus_unregister_driver(&sony_pic_driver); | 2943 | acpi_bus_unregister_driver(&sony_pic_driver); |
2941 | } | 2944 | } |
2942 | 2945 | ||