Skip to content

Commit

Permalink
Merge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/jgarzik/libata-dev

Pull libata updates from Jeff Garzik:

 - More ACPI fixes

 - ata_piix: cosmetic code movement, re-enable MS Virtual PC support

 - generic platform driver improvements; use common code

 - pata_cs5536: add quirk for broken udma

 - printk prettiness (dev_printk becomes dev_info, etc.)

 - sata_promise: fix hardreset lockdep error

 - minor cleanups from Sergei Shtylyov

 - minor, automated cleanups from Wei Yongjun

 - fix null ptr deref bug, in sysfs API

* tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (37 commits)
  sata_dwc_460ex: remove file exec bit (chmod 0755 -> 0644)
  [libata] fix Null pointer dereference on disk error
  ahci: convert ata_link_printk() to ata_link_warn()
  pata_imx: convert ata_dev_printk() to ata_dev_info()
  ARM: ep93xx: convert ata_<foo>_printk() to ata_<foo>_<level>()
  ahci_platform: make structs static
  Revert "pata_octeon_cf: perform host detach, removal on exit"
  Revert "libata: check SATA_SETTINGS log with HW Feature Ctrl"
  pata_of_platform: fix compile error
  libata: use pci_get_drvdata() helper
  pata_octeon_cf: perform host detach, removal on exit
  sata_highbank: utilize common ata_platform_remove_one()
  pata_palmld: utilize common ata_platform_remove_one()
  pata_platform: remove unused remove function
  pata_platform: utilize common ata_platform_remove_one()
  pata_of_platform: utilize common ata_platform_remove_one()
  pata_mpc52xx: utilize common ata_platform_remove_one()
  pata_ixp4xx_cf: utilize common ata_platform_remove_one()
  ahci_platform: utilize common ata_platform_remove_one()
  libata: implement ata_platform_remove_one()
  ...
  • Loading branch information
torvalds committed Dec 15, 2012
2 parents c525819 + 72d5f2d commit c13e69b
Showing 26 changed files with 355 additions and 356 deletions.
46 changes: 21 additions & 25 deletions drivers/ata/ahci_platform.c
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@
#include <linux/ahci_platform.h>
#include "ahci.h"

static void ahci_host_stop(struct ata_host *host);

enum ahci_type {
AHCI, /* standard platform ahci */
IMX53_AHCI, /* ahci on i.mx53 */
@@ -47,35 +49,44 @@ static struct platform_device_id ahci_devtype[] = {
};
MODULE_DEVICE_TABLE(platform, ahci_devtype);

static struct ata_port_operations ahci_platform_ops = {
.inherits = &ahci_ops,
.host_stop = ahci_host_stop,
};

static struct ata_port_operations ahci_platform_retry_srst_ops = {
.inherits = &ahci_pmp_retry_srst_ops,
.host_stop = ahci_host_stop,
};

static const struct ata_port_info ahci_port_info[] = {
/* by features */
[AHCI] = {
.flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
.port_ops = &ahci_platform_ops,
},
[IMX53_AHCI] = {
.flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_pmp_retry_srst_ops,
.port_ops = &ahci_platform_retry_srst_ops,
},
[STRICT_AHCI] = {
AHCI_HFLAGS (AHCI_HFLAG_DELAY_ENGINE),
.flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
.port_ops = &ahci_platform_ops,
},
};

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);
@@ -218,24 +229,19 @@ static int __init ahci_probe(struct platform_device *pdev)
return rc;
}

static int __devexit ahci_remove(struct platform_device *pdev)
static void ahci_host_stop(struct ata_host *host)
{
struct device *dev = &pdev->dev;
struct device *dev = host->dev;
struct ahci_platform_data *pdata = dev_get_platdata(dev);
struct ata_host *host = dev_get_drvdata(dev);
struct ahci_host_priv *hpriv = host->private_data;

ata_host_detach(host);

if (pdata && pdata->exit)
pdata->exit(dev);

if (!IS_ERR(hpriv->clk)) {
clk_disable_unprepare(hpriv->clk);
clk_put(hpriv->clk);
}

return 0;
}

#ifdef CONFIG_PM_SLEEP
@@ -317,7 +323,7 @@ static int ahci_resume(struct device *dev)
}
#endif

SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume);
static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_suspend, ahci_resume);

static const struct of_device_id ahci_of_match[] = {
{ .compatible = "snps,spear-ahci", },
@@ -326,7 +332,8 @@ static const struct of_device_id ahci_of_match[] = {
MODULE_DEVICE_TABLE(of, ahci_of_match);

static struct platform_driver ahci_driver = {
.remove = __devexit_p(ahci_remove),
.probe = ahci_probe,
.remove = ata_platform_remove_one,
.driver = {
.name = "ahci",
.owner = THIS_MODULE,
@@ -335,18 +342,7 @@ static struct platform_driver ahci_driver = {
},
.id_table = ahci_devtype,
};

static int __init ahci_init(void)
{
return platform_driver_probe(&ahci_driver, ahci_probe);
}
module_init(ahci_init);

static void __exit ahci_exit(void)
{
platform_driver_unregister(&ahci_driver);
}
module_exit(ahci_exit);
module_platform_driver(ahci_driver);

MODULE_DESCRIPTION("AHCI SATA platform driver");
MODULE_AUTHOR("Anton Vorontsov <[email protected]>");
Loading

0 comments on commit c13e69b

Please sign in to comment.