diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-23 06:41:21 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-05-23 21:26:13 -0400 |
commit | d89995db5f238e618389604b848b431da240eb69 (patch) | |
tree | b9d7d30ea21b911705f061b10ac3bc2460380c91 /drivers/ata/pata_bf54x.c | |
parent | b29900e62598cecd519c9ab2b8e4d03f8ebf702d (diff) |
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/pata_bf54x.c')
-rw-r--r-- | drivers/ata/pata_bf54x.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c index 8d43510c6bec..ba0d8a29dc23 100644 --- a/drivers/ata/pata_bf54x.c +++ b/drivers/ata/pata_bf54x.c | |||
@@ -1596,7 +1596,7 @@ static int bfin_atapi_probe(struct platform_device *pdev) | |||
1596 | return -ENODEV; | 1596 | return -ENODEV; |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | dev_set_drvdata(&pdev->dev, host); | 1599 | platform_set_drvdata(pdev, host); |
1600 | 1600 | ||
1601 | return 0; | 1601 | return 0; |
1602 | } | 1602 | } |
@@ -1610,11 +1610,9 @@ static int bfin_atapi_probe(struct platform_device *pdev) | |||
1610 | */ | 1610 | */ |
1611 | static int bfin_atapi_remove(struct platform_device *pdev) | 1611 | static int bfin_atapi_remove(struct platform_device *pdev) |
1612 | { | 1612 | { |
1613 | struct device *dev = &pdev->dev; | 1613 | struct ata_host *host = platform_get_drvdata(pdev); |
1614 | struct ata_host *host = dev_get_drvdata(dev); | ||
1615 | 1614 | ||
1616 | ata_host_detach(host); | 1615 | ata_host_detach(host); |
1617 | dev_set_drvdata(&pdev->dev, NULL); | ||
1618 | 1616 | ||
1619 | peripheral_free_list(atapi_io_port); | 1617 | peripheral_free_list(atapi_io_port); |
1620 | 1618 | ||
@@ -1624,7 +1622,7 @@ static int bfin_atapi_remove(struct platform_device *pdev) | |||
1624 | #ifdef CONFIG_PM | 1622 | #ifdef CONFIG_PM |
1625 | static int bfin_atapi_suspend(struct platform_device *pdev, pm_message_t state) | 1623 | static int bfin_atapi_suspend(struct platform_device *pdev, pm_message_t state) |
1626 | { | 1624 | { |
1627 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 1625 | struct ata_host *host = platform_get_drvdata(pdev); |
1628 | if (host) | 1626 | if (host) |
1629 | return ata_host_suspend(host, state); | 1627 | return ata_host_suspend(host, state); |
1630 | else | 1628 | else |
@@ -1633,7 +1631,7 @@ static int bfin_atapi_suspend(struct platform_device *pdev, pm_message_t state) | |||
1633 | 1631 | ||
1634 | static int bfin_atapi_resume(struct platform_device *pdev) | 1632 | static int bfin_atapi_resume(struct platform_device *pdev) |
1635 | { | 1633 | { |
1636 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | 1634 | struct ata_host *host = platform_get_drvdata(pdev); |
1637 | int ret; | 1635 | int ret; |
1638 | 1636 | ||
1639 | if (host) { | 1637 | if (host) { |