提交 2d374394 编写于 作者: B Brian Norris

mtd: nand: docg4: simplify error case

Other refactorings have left the 'fail' label much simpler, so it
shouldn't have to handle the failed allocation case.

This also fixes a -Wshadow warning.
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
上级 7208b997
...@@ -1353,14 +1353,10 @@ static int __init probe_docg4(struct platform_device *pdev) ...@@ -1353,14 +1353,10 @@ static int __init probe_docg4(struct platform_device *pdev)
doc->mtd = mtd; doc->mtd = mtd;
return 0; return 0;
fail: fail:
if (nand) { nand_release(mtd); /* deletes partitions and mtd devices */
/* re-declarations avoid compiler warning */ free_bch(doc->bch);
struct docg4_priv *doc = nand->priv; kfree(nand);
nand_release(mtd); /* deletes partitions and mtd devices */
free_bch(doc->bch);
kfree(nand);
}
fail_unmap: fail_unmap:
iounmap(virtadr); iounmap(virtadr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册