aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ixp4xx_cf.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-01-20 02:00:28 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:37 -0500
commit24dc5f33ea4b504cfbd23fa159a4cacba8e4d800 (patch)
treed76de456157f555c9a65b83f426fd805fee1e846 /drivers/ata/pata_ixp4xx_cf.c
parentf0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (diff)
libata: update libata LLDs to use devres
Update libata LLDs to use devres. Core layer is already converted to support managed LLDs. This patch simplifies initialization and fixes many resource related bugs in init failure and detach path. For example, all converted drivers now handle ata_device_add() failure gracefully without excessive resource rollback code. As most resources are released automatically on driver detach, many drivers don't need or can do with much simpler ->{port|host}_stop(). In general, stop callbacks are need iff port or host needs to be given commands to shut it down. Note that freezing is enough in many cases and ports are automatically frozen before being detached. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 23b8aab3ebd8..230067d281e3 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -95,14 +95,6 @@ static void ixp4xx_irq_clear(struct ata_port *ap)
95{ 95{
96} 96}
97 97
98static void ixp4xx_host_stop (struct ata_host *host)
99{
100 struct ixp4xx_pata_data *data = host->dev->platform_data;
101
102 iounmap(data->cs0);
103 iounmap(data->cs1);
104}
105
106static struct scsi_host_template ixp4xx_sht = { 98static struct scsi_host_template ixp4xx_sht = {
107 .module = THIS_MODULE, 99 .module = THIS_MODULE,
108 .name = DRV_NAME, 100 .name = DRV_NAME,
@@ -141,8 +133,6 @@ static struct ata_port_operations ixp4xx_port_ops = {
141 .irq_clear = ixp4xx_irq_clear, 133 .irq_clear = ixp4xx_irq_clear,
142 134
143 .port_start = ata_port_start, 135 .port_start = ata_port_start,
144 .port_stop = ata_port_stop,
145 .host_stop = ixp4xx_host_stop,
146 136
147 .phy_reset = ixp4xx_phy_reset, 137 .phy_reset = ixp4xx_phy_reset,
148}; 138};
@@ -195,8 +185,8 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
195 185
196 pdev->dev.coherent_dma_mask = DMA_32BIT_MASK; 186 pdev->dev.coherent_dma_mask = DMA_32BIT_MASK;
197 187
198 data->cs0 = ioremap(cs0->start, 0x1000); 188 data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
199 data->cs1 = ioremap(cs1->start, 0x1000); 189 data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
200 190
201 irq = platform_get_irq(pdev, 0); 191 irq = platform_get_irq(pdev, 0);
202 if (irq) 192 if (irq)
@@ -238,7 +228,7 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev)
238{ 228{
239 struct ata_host *host = platform_get_drvdata(dev); 229 struct ata_host *host = platform_get_drvdata(dev);
240 230
241 ata_host_remove(host); 231 ata_host_detach(host);
242 platform_set_drvdata(dev, NULL); 232 platform_set_drvdata(dev, NULL);
243 233
244 return 0; 234 return 0;