mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
This commit is contained in:
parent
7208b997b7
commit
2d3743944a
1 changed files with 4 additions and 8 deletions
|
|
@ -1353,14 +1353,10 @@ static int __init probe_docg4(struct platform_device *pdev)
|
|||
doc->mtd = mtd;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (nand) {
|
||||
/* re-declarations avoid compiler warning */
|
||||
struct docg4_priv *doc = nand->priv;
|
||||
nand_release(mtd); /* deletes partitions and mtd devices */
|
||||
free_bch(doc->bch);
|
||||
kfree(nand);
|
||||
}
|
||||
fail:
|
||||
nand_release(mtd); /* deletes partitions and mtd devices */
|
||||
free_bch(doc->bch);
|
||||
kfree(nand);
|
||||
|
||||
fail_unmap:
|
||||
iounmap(virtadr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue