Commit 196644fd authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Boris Brezillon

mtd: nand: vf610: improve readability of error label

Use clearer error labels as Boris Brezillon suggested.
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarStefan Agner <stefan@agner.ch>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent f5a666bd
...@@ -667,7 +667,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -667,7 +667,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
dev_err(nfc->dev, dev_err(nfc->dev,
"Only one NAND chip supported!\n"); "Only one NAND chip supported!\n");
err = -EINVAL; err = -EINVAL;
goto err_clk; goto err_disable_clk;
} }
nand_set_flash_node(chip, child); nand_set_flash_node(chip, child);
...@@ -677,7 +677,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -677,7 +677,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
if (!nand_get_flash_node(chip)) { if (!nand_get_flash_node(chip)) {
dev_err(nfc->dev, "NAND chip sub-node missing!\n"); dev_err(nfc->dev, "NAND chip sub-node missing!\n");
err = -ENODEV; err = -ENODEV;
goto err_clk; goto err_disable_clk;
} }
chip->dev_ready = vf610_nfc_dev_ready; chip->dev_ready = vf610_nfc_dev_ready;
...@@ -697,7 +697,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -697,7 +697,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd); err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd);
if (err) { if (err) {
dev_err(nfc->dev, "Error requesting IRQ!\n"); dev_err(nfc->dev, "Error requesting IRQ!\n");
goto err_clk; goto err_disable_clk;
} }
vf610_nfc_preinit_controller(nfc); vf610_nfc_preinit_controller(nfc);
...@@ -705,7 +705,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -705,7 +705,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
/* first scan to find the device and get the page size */ /* first scan to find the device and get the page size */
err = nand_scan_ident(mtd, 1, NULL); err = nand_scan_ident(mtd, 1, NULL);
if (err) if (err)
goto err_clk; goto err_disable_clk;
vf610_nfc_init_controller(nfc); vf610_nfc_init_controller(nfc);
...@@ -717,20 +717,20 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -717,20 +717,20 @@ static int vf610_nfc_probe(struct platform_device *pdev)
if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) { if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) {
dev_err(nfc->dev, "Unsupported flash page size\n"); dev_err(nfc->dev, "Unsupported flash page size\n");
err = -ENXIO; err = -ENXIO;
goto err_clk; goto err_disable_clk;
} }
if (chip->ecc.mode == NAND_ECC_HW) { if (chip->ecc.mode == NAND_ECC_HW) {
if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) { if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) {
dev_err(nfc->dev, "Unsupported flash with hwecc\n"); dev_err(nfc->dev, "Unsupported flash with hwecc\n");
err = -ENXIO; err = -ENXIO;
goto err_clk; goto err_disable_clk;
} }
if (chip->ecc.size != mtd->writesize) { if (chip->ecc.size != mtd->writesize) {
dev_err(nfc->dev, "Step size needs to be page size\n"); dev_err(nfc->dev, "Step size needs to be page size\n");
err = -ENXIO; err = -ENXIO;
goto err_clk; goto err_disable_clk;
} }
/* Only 64 byte ECC layouts known */ /* Only 64 byte ECC layouts known */
...@@ -750,7 +750,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -750,7 +750,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
} else { } else {
dev_err(nfc->dev, "Unsupported ECC strength\n"); dev_err(nfc->dev, "Unsupported ECC strength\n");
err = -ENXIO; err = -ENXIO;
goto err_clk; goto err_disable_clk;
} }
chip->ecc.read_page = vf610_nfc_read_page; chip->ecc.read_page = vf610_nfc_read_page;
...@@ -762,14 +762,14 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -762,14 +762,14 @@ static int vf610_nfc_probe(struct platform_device *pdev)
/* second phase scan */ /* second phase scan */
err = nand_scan_tail(mtd); err = nand_scan_tail(mtd);
if (err) if (err)
goto err_clk; goto err_disable_clk;
platform_set_drvdata(pdev, mtd); platform_set_drvdata(pdev, mtd);
/* Register device in MTD */ /* Register device in MTD */
return mtd_device_register(mtd, NULL, 0); return mtd_device_register(mtd, NULL, 0);
err_clk: err_disable_clk:
clk_disable_unprepare(nfc->clk); clk_disable_unprepare(nfc->clk);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment