Skip to contentSkip to conversation

sony-laptop: use platform_device_unregister in sony_pf_remove

PATCH Applied Axel Lin 2 participants 2 messages Jul 1, 2010

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/platform/x86/sony-laptop.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/platform/x86/sony-laptop.c +1 -2
index 1387c5f..6b7ea49 100644
@@ -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);
 }
 
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 8 lines · Axel Lin

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.

Applied, thanks.

Signature · 1 line
Matthew Garrett | [email protected]