提交 941c77fd 编写于 作者: B Brian Norris 提交者: Jeff Garzik

ahci_platform: enable hotplug unbinding

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: NBrian Norris <computersforpeace@gmail.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 5416912a
...@@ -75,7 +75,7 @@ static struct scsi_host_template ahci_platform_sht = { ...@@ -75,7 +75,7 @@ static struct scsi_host_template ahci_platform_sht = {
AHCI_SHT("ahci_platform"), 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 device *dev = &pdev->dev;
struct ahci_platform_data *pdata = dev_get_platdata(dev); struct ahci_platform_data *pdata = dev_get_platdata(dev);
...@@ -326,6 +326,7 @@ static const struct of_device_id ahci_of_match[] = { ...@@ -326,6 +326,7 @@ static const struct of_device_id ahci_of_match[] = {
MODULE_DEVICE_TABLE(of, ahci_of_match); MODULE_DEVICE_TABLE(of, ahci_of_match);
static struct platform_driver ahci_driver = { static struct platform_driver ahci_driver = {
.probe = ahci_probe,
.remove = __devexit_p(ahci_remove), .remove = __devexit_p(ahci_remove),
.driver = { .driver = {
.name = "ahci", .name = "ahci",
...@@ -338,7 +339,7 @@ static struct platform_driver ahci_driver = { ...@@ -338,7 +339,7 @@ static struct platform_driver ahci_driver = {
static int __init ahci_init(void) static int __init ahci_init(void)
{ {
return platform_driver_probe(&ahci_driver, ahci_probe); return platform_driver_register(&ahci_driver);
} }
module_init(ahci_init); module_init(ahci_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册