diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-23 19:41:21 +0900 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-05-24 10:26:13 +0900 |
commit | d89995db5f238e618389604b848b431da240eb69 (patch) | |
tree | b9d7d30ea21b911705f061b10ac3bc2460380c91 /drivers/ata/sata_fsl.c | |
parent | b29900e62598cecd519c9ab2b8e4d03f8ebf702d (diff) | |
download | linux-d89995db5f238e618389604b848b431da240eb69.tar.gz linux-d89995db5f238e618389604b848b431da240eb69.tar.bz2 linux-d89995db5f238e618389604b848b431da240eb69.zip |
ata: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
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; |