[PATCH 3/5] cris: nand: Delete a jump target in crisv32_nand_flash_probe()

From: SF Markus Elfring
Date: Wed Oct 04 2017 - 14:47:42 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Oct 2017 18:55:01 +0200

* Move a bit of exception handling code into an if branch
because the code was used only for one case before.

* Delete the jump target "out_mtd" which became unnecessary
with this refactoring.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
arch/cris/arch-v32/drivers/mach-a3/nandflash.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
index 3b5be9b984b4..f30579ec8ad7 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
@@ -163,13 +163,10 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
/* Scan to find existence of the device */
if (nand_scan(crisv32_mtd, 1)) {
err = -ENXIO;
- goto out_mtd;
+ kfree(wrapper);
+ return NULL;
}

return crisv32_mtd;
-
-out_mtd:
- kfree(wrapper);
- return NULL;
}

--
2.14.2