From: Brian Norris <computersforpeace@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org,
Brian Norris <computersforpeace@gmail.com>,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 01/14] ahci_platform: enable hotplug unbinding
Date: Fri, 2 Nov 2012 00:46:15 -0700 [thread overview]
Message-ID: <1351842388-27210-2-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1351842388-27210-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 b1ae480..9bc8a78 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -75,7 +75,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);
@@ -326,6 +326,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",
@@ -338,7 +339,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-11-02 7:46 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 7:46 [PATCH 00/14] ahci/libata: clean up platform device removal Brian Norris
2012-11-02 7:46 ` Brian Norris [this message]
2012-11-02 7:46 ` [PATCH 02/14] ahci_platform: convert to module_platform_driver Brian Norris
2012-11-02 7:46 ` [PATCH 03/14] ahci_platform: perform platform exit in host_stop() hook Brian Norris
2012-11-02 7:46 ` [PATCH 04/14] libata: implement ata_platform_remove_one() Brian Norris
2012-11-02 11:07 ` Sergei Shtylyov
2012-11-02 19:05 ` Brian Norris
2012-11-02 19:09 ` [PATCH v2 " Brian Norris
2012-11-02 19:29 ` [PATCH v3 " Brian Norris
2012-11-02 20:12 ` [PATCH v2 " Sergei Shtylyov
2012-11-02 19:29 ` Brian Norris
2012-11-02 7:46 ` [PATCH 05/14] ahci_platform: utilize common ata_platform_remove_one() Brian Norris
2012-11-02 7:46 ` [PATCH 06/14] pata_ixp4xx_cf: " Brian Norris
2012-11-02 7:46 ` [PATCH 07/14] pata_mpc52xx: " Brian Norris
2012-11-02 7:46 ` [PATCH 08/14] pata_of_platform: " Brian Norris
2012-11-02 7:46 ` [PATCH 09/14] pata_platform: " Brian Norris
2012-11-02 7:46 ` [PATCH 10/14] ata_platform: remove unused remove function Brian Norris
2012-11-02 7:46 ` [PATCH 11/14] pata_palmld: utilize common ata_platform_remove_one() Brian Norris
2012-11-02 7:46 ` [PATCH 12/14] sata_highbank: " Brian Norris
2012-11-02 19:12 ` [PATCH v2 " Brian Norris
2012-12-03 10:17 ` Jeff Garzik
2012-12-03 18:12 ` Brian Norris
2012-11-02 7:46 ` [PATCH 13/14] pata_octeon_cf: perform host detach, removal on exit Brian Norris
2012-11-02 7:46 ` [PATCH 14/14] libata: use pci_get_drvdata() helper Brian Norris
2012-11-02 17:01 ` [PATCH 00/14] ahci/libata: clean up platform device removal Tejun Heo
2012-11-02 19:03 ` Brian Norris
2012-11-02 19:04 ` Tejun Heo
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=1351842388-27210-2-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.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).