From 24dc5f33ea4b504cfbd23fa159a4cacba8e4d800 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sat, 20 Jan 2007 16:00:28 +0900 Subject: 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 Signed-off-by: Jeff Garzik --- drivers/ata/pata_ixp4xx_cf.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'drivers/ata/pata_ixp4xx_cf.c') diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 23b8aab3ebd..230067d281e 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) { } -static void ixp4xx_host_stop (struct ata_host *host) -{ - struct ixp4xx_pata_data *data = host->dev->platform_data; - - iounmap(data->cs0); - iounmap(data->cs1); -} - static struct scsi_host_template ixp4xx_sht = { .module = THIS_MODULE, .name = DRV_NAME, @@ -141,8 +133,6 @@ static struct ata_port_operations ixp4xx_port_ops = { .irq_clear = ixp4xx_irq_clear, .port_start = ata_port_start, - .port_stop = ata_port_stop, - .host_stop = ixp4xx_host_stop, .phy_reset = ixp4xx_phy_reset, }; @@ -195,8 +185,8 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) pdev->dev.coherent_dma_mask = DMA_32BIT_MASK; - data->cs0 = ioremap(cs0->start, 0x1000); - data->cs1 = ioremap(cs1->start, 0x1000); + data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); + data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000); irq = platform_get_irq(pdev, 0); if (irq) @@ -238,7 +228,7 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev) { struct ata_host *host = platform_get_drvdata(dev); - ata_host_remove(host); + ata_host_detach(host); platform_set_drvdata(dev, NULL); return 0; -- cgit v1.2.3