diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-08-15 12:43:13 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-08-15 12:43:13 +0100 |
commit | 824df399a31fe92d88eb8caf86768cc8c7c72a06 (patch) | |
tree | f966f72be04d1eb53e17b7866c6f49bf2b7d3b93 /drivers/ata/pata_at91.c | |
parent | 8b6120789598d55f6aa2b4e9ac7e70a205d857da (diff) | |
parent | 48ec45e725aa385d72bced73b267dfaf13351876 (diff) |
Merge branch 's3c-fixes' of git://aeryn.fluff.org.uk/bjdooks/linux
Diffstat (limited to 'drivers/ata/pata_at91.c')
-rw-r--r-- | drivers/ata/pata_at91.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c index 5702affcb32..41c94b1ae49 100644 --- a/drivers/ata/pata_at91.c +++ b/drivers/ata/pata_at91.c @@ -250,7 +250,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) ata_port_desc(ap, "no IRQ, using PIO polling"); } - info = kzalloc(sizeof(*info), GFP_KERNEL); + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); if (!info) { dev_err(dev, "failed to allocate memory for private data\n"); @@ -275,7 +275,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) if (!info->ide_addr) { dev_err(dev, "failed to map IO base\n"); ret = -ENOMEM; - goto err_ide_ioremap; + goto err_put; } info->alt_addr = devm_ioremap(dev, @@ -284,7 +284,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) if (!info->alt_addr) { dev_err(dev, "failed to map CTL base\n"); ret = -ENOMEM; - goto err_alt_ioremap; + goto err_put; } ap->ioaddr.cmd_addr = info->ide_addr; @@ -303,13 +303,8 @@ static int __devinit pata_at91_probe(struct platform_device *pdev) irq ? ata_sff_interrupt : NULL, irq_flags, &pata_at91_sht); -err_alt_ioremap: - devm_iounmap(dev, info->ide_addr); - -err_ide_ioremap: +err_put: clk_put(info->mck); - kfree(info); - return ret; } @@ -317,7 +312,6 @@ static int __devexit pata_at91_remove(struct platform_device *pdev) { struct ata_host *host = dev_get_drvdata(&pdev->dev); struct at91_ide_info *info; - struct device *dev = &pdev->dev; if (!host) return 0; @@ -328,11 +322,8 @@ static int __devexit pata_at91_remove(struct platform_device *pdev) if (!info) return 0; - devm_iounmap(dev, info->ide_addr); - devm_iounmap(dev, info->alt_addr); clk_put(info->mck); - kfree(info); return 0; } |