public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sony-laptop: use platform_device_unregister in sony_pf_remove
@ 2010-07-01  2:18 Axel Lin
  2010-07-01 13:54 ` Matthew Garrett
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-07-01  2:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mattia Dongili, Matthew Garrett, Len Brown, Andrew Morton,
	Stefani Seibold, Andi Kleen, platform-driver-x86

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>
---
 drivers/platform/x86/sony-laptop.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 1387c5f..6b7ea49 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);
 }
 
-- 
1.5.4.3




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-01 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01  2:18 [PATCH] sony-laptop: use platform_device_unregister in sony_pf_remove Axel Lin
2010-07-01 13:54 ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox