Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360379
b: refs/heads/master
c: ef4e0c2
h: refs/heads/master
i:
  360377: c05a861
  360375: ad51e21
v: v3
  • Loading branch information
Mrugesh Katepallewar authored and Artem Bityutskiy committed Feb 13, 2013
1 parent b5fd170 commit 70518d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 221b1bd3d409b14e8764d8f40994b71ae6887d18
refs/heads/master: ef4e0c2145e928b1c165ac88a9aa20038a981488
24 changes: 5 additions & 19 deletions trunk/drivers/mtd/nand/davinci_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
if (pdev->id < 0 || pdev->id > 3)
return -ENODEV;

info = kzalloc(sizeof(*info), GFP_KERNEL);
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
if (!info) {
dev_err(&pdev->dev, "unable to allocate memory\n");
ret = -ENOMEM;
Expand All @@ -623,11 +623,11 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
goto err_nomem;
}

vaddr = ioremap(res1->start, resource_size(res1));
base = ioremap(res2->start, resource_size(res2));
vaddr = devm_request_and_ioremap(&pdev->dev, res1);
base = devm_request_and_ioremap(&pdev->dev, res2);
if (!vaddr || !base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -EINVAL;
ret = -EADDRNOTAVAIL;
goto err_ioremap;
}

Expand Down Expand Up @@ -717,7 +717,7 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
}
info->chip.ecc.mode = ecc_mode;

info->clk = clk_get(&pdev->dev, "aemif");
info->clk = devm_clk_get(&pdev->dev, "aemif");
if (IS_ERR(info->clk)) {
ret = PTR_ERR(info->clk);
dev_dbg(&pdev->dev, "unable to get AEMIF clock, err %d\n", ret);
Expand Down Expand Up @@ -845,8 +845,6 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
clk_disable_unprepare(info->clk);

err_clk_enable:
clk_put(info->clk);

spin_lock_irq(&davinci_nand_lock);
if (ecc_mode == NAND_ECC_HW_SYNDROME)
ecc4_busy = false;
Expand All @@ -855,13 +853,7 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
err_ecc:
err_clk:
err_ioremap:
if (base)
iounmap(base);
if (vaddr)
iounmap(vaddr);

err_nomem:
kfree(info);
return ret;
}

Expand All @@ -874,15 +866,9 @@ static int __exit nand_davinci_remove(struct platform_device *pdev)
ecc4_busy = false;
spin_unlock_irq(&davinci_nand_lock);

iounmap(info->base);
iounmap(info->vaddr);

nand_release(&info->mtd);

clk_disable_unprepare(info->clk);
clk_put(info->clk);

kfree(info);

return 0;
}
Expand Down

0 comments on commit 70518d4

Please sign in to comment.