summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-07-01 10:18:01 +0800
committerMatthew Garrett <mjg@redhat.com>2010-07-01 09:52:50 -0400
commitb14c85c2a87abbc56be93909c68abbea4ab6ee04 (patch)
treeaf0ff5f06b2a559f75204bd2c0c2c5d2378acdcd
parent4f6bc4aa83a1765dc9bf5c1ae79efad4d1d992f6 (diff)
sony-laptop: use platform_device_unregister in sony_pf_remove
platform_device_unregister calls platform_device_del and platform_device_put, thus this change is logically equivalent to original code. I made this change because the documents in platform.c shows that: platform_device_del and platform_device_put must _only_ be externally called in error cases. All other usage is a bug. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
-rw-r--r--drivers/platform/x86/sony-laptop.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index a47fd4eef8a3..e3154ff7a39f 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -561,8 +561,7 @@ static void sony_pf_remove(void)
if (!atomic_dec_and_test(&sony_pf_users))
return;
- platform_device_del(sony_pf_device);
- platform_device_put(sony_pf_device);
+ platform_device_unregister(sony_pf_device);
platform_driver_unregister(&sony_pf_driver);
}