From: Brian Norris <computersforpeace@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Tejun Heo <tj@kernel.org>,
linux-ide@vger.kernel.org, linux-pm@lists.linux-foundation.org,
Kevin Cernekee <cernekee@gmail.com>,
Brian Norris <computersforpeace@gmail.com>
Subject: [RFC v2 1/3] ahci_platform: enable hotplug unbinding
Date: Sat, 27 Oct 2012 13:09:34 -0700 [thread overview]
Message-ID: <1351368576-5264-2-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1351368576-5264-1-git-send-email-computersforpeace@gmail.com>
platform_driver_probe() should be used for registering this driver only
if we want to
"...remove its run-once probe() infrastructure from memory after the
driver has bound to the device."
However, we may want to leave the probe infrastructure in place in order
to support binding/unbinding a device dynamically. This is useful, for
instance, as a power management mechanism, where a device can be totally
powered down when unbound (whereas with runtime power management,
powering down the SATA core would incur unacceptable loss of
functionality).
Thus, convert this driver to use platform_driver_register().
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/ata/ahci_platform.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 9e419e1..f467ba8 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -73,7 +73,7 @@ static struct scsi_host_template ahci_platform_sht = {
AHCI_SHT("ahci_platform"),
};
-static int __init ahci_probe(struct platform_device *pdev)
+static int __devinit ahci_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_platform_data *pdata = dev_get_platdata(dev);
@@ -286,6 +286,7 @@ static const struct of_device_id ahci_of_match[] = {
MODULE_DEVICE_TABLE(of, ahci_of_match);
static struct platform_driver ahci_driver = {
+ .probe = ahci_probe,
.remove = __devexit_p(ahci_remove),
.driver = {
.name = "ahci",
@@ -300,7 +301,7 @@ static struct platform_driver ahci_driver = {
static int __init ahci_init(void)
{
- return platform_driver_probe(&ahci_driver, ahci_probe);
+ return platform_driver_register(&ahci_driver);
}
module_init(ahci_init);
--
1.7.11.3
next prev parent reply other threads:[~2012-10-27 20:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-27 20:09 [RFC v2 0/3] ahci_platform: unbind/rmmod power down sequence Brian Norris
2012-10-27 20:09 ` Brian Norris [this message]
2012-10-27 20:09 ` [RFC v2 2/3] ahci_platform: convert to module_platform_driver Brian Norris
2012-10-27 20:09 ` [RFC v2 3/3] ahci_platform: perform platform exit in host_stop() hook Brian Norris
2012-10-29 1:37 ` Tejun Heo
2012-11-01 6:41 ` Brian Norris
2012-11-01 16:17 ` Tejun Heo
2012-10-28 0:11 ` [linux-pm] [RFC v2 0/3] ahci_platform: unbind/rmmod power down sequence Rafael J. Wysocki
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=1351368576-5264-2-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=cernekee@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).