From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Mattia Dongili <malattia@linux.it>,
Matthew Garrett <mjg@redhat.com>, Len Brown <len.brown@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Stefani Seibold <stefani@seibold.net>,
Andi Kleen <ak@linux.intel.com>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH] sony-laptop: use platform_device_unregister in sony_pf_remove
Date: Thu, 01 Jul 2010 10:18:01 +0800 [thread overview]
Message-ID: <1277950681.30073.1.camel@mola> (raw)
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
next reply other threads:[~2010-07-01 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 2:18 Axel Lin [this message]
2010-07-01 13:54 ` [PATCH] sony-laptop: use platform_device_unregister in sony_pf_remove Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1277950681.30073.1.camel@mola \
--to=axel.lin@gmail.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=malattia@linux.it \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stefani@seibold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox