diff options
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r-- | drivers/ata/sata_fsl.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index d40e403e82dd..19720a0a4a65 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -1532,7 +1532,7 @@ static int sata_fsl_probe(struct platform_device *ofdev) ata_host_activate(host, irq, sata_fsl_interrupt, SATA_FSL_IRQ_FLAG, &sata_fsl_sht); - dev_set_drvdata(&ofdev->dev, host); + platform_set_drvdata(ofdev, host); host_priv->intr_coalescing.show = fsl_sata_intr_coalescing_show; host_priv->intr_coalescing.store = fsl_sata_intr_coalescing_store; @@ -1558,10 +1558,8 @@ static int sata_fsl_probe(struct platform_device *ofdev) error_exit_with_cleanup: - if (host) { - dev_set_drvdata(&ofdev->dev, NULL); + if (host) ata_host_detach(host); - } if (hcr_base) iounmap(hcr_base); @@ -1572,7 +1570,7 @@ error_exit_with_cleanup: static int sata_fsl_remove(struct platform_device *ofdev) { - struct ata_host *host = dev_get_drvdata(&ofdev->dev); + struct ata_host *host = platform_get_drvdata(ofdev); struct sata_fsl_host_priv *host_priv = host->private_data; device_remove_file(&ofdev->dev, &host_priv->intr_coalescing); @@ -1580,8 +1578,6 @@ static int sata_fsl_remove(struct platform_device *ofdev) ata_host_detach(host); - dev_set_drvdata(&ofdev->dev, NULL); - irq_dispose_mapping(host_priv->irq); iounmap(host_priv->hcr_base); kfree(host_priv); @@ -1592,13 +1588,13 @@ static int sata_fsl_remove(struct platform_device *ofdev) #ifdef CONFIG_PM static int sata_fsl_suspend(struct platform_device *op, pm_message_t state) { - struct ata_host *host = dev_get_drvdata(&op->dev); + struct ata_host *host = platform_get_drvdata(op); return ata_host_suspend(host, state); } static int sata_fsl_resume(struct platform_device *op) { - struct ata_host *host = dev_get_drvdata(&op->dev); + struct ata_host *host = platform_get_drvdata(op); struct sata_fsl_host_priv *host_priv = host->private_data; int ret; void __iomem *hcr_base = host_priv->hcr_base; |