Received: by 10.223.176.5 with SMTP id f5csp1198855wra; Fri, 9 Feb 2018 14:30:51 -0800 (PST) X-Google-Smtp-Source: AH8x2260KK6GTyhhto89m94LbwCyyGI0xzDwYjw+01ax+NXoYTWXuFjXhxyRbyuiJNZXa/SkH0iA X-Received: by 10.98.211.72 with SMTP id q69mr4280415pfg.158.1518215451392; Fri, 09 Feb 2018 14:30:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518215451; cv=none; d=google.com; s=arc-20160816; b=CbCmRKjUyKy+fq48StP/2Lvb6nbV8u/Q9mwWl2X8KVDBOHJc3reZ1WIxlmEkX7rby/ NcYCiob/jgCqrxCkOysnmrp4Xw7Sl7zpvYqdZAw6k4Lb4qt+e/rt9RAVQ1Qb9cLWPxJA aPdB0h9C1SxVrd7nRTaTjtHx5PSJj8qS9/OYr3DxB2xVtcKGEXkEm2xMkXanvp9MBaba vN/nevhH5ek2EgmkN13qBvM173CorroT/x7daJmtK7uUVd28ux+CfDhVSg+qOL/VNwGy QVPqAKRrvPjfSmJkaKwLNXDgnmKUtPzZYZZDEJ8/cu7VO1q559XeLmiUaymzAjUI++tc 4WAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YPqoVjNqGLiPZZiP+07pKyLXuk91BwwbpnZpNsDwqj8=; b=LU+PvClVexgJH1c0VFacBsXq8uFUuXpqAEVKwBiQgL5p+Uf/G9wuV8WGlPJQGRVvKC wW6t7kGljlYdX6CujGIZ+esrwzvI1A53AgFhQMhZk6oWFaWgpNrX2EzjYgS2b9u7PcEs wokGPEk0/u1ybVI2QUW3CJTS+zj8ILm+HUHV8uW0vqiXk0UzHAA5wA0EvOIr7PUWbftj GeMyE8/Wxs03SZLx1jtvTZ6nU0N5D8r+oKrMCkXI7D/zZVZ3wUA9g2K3+8SYiKgKTeTj xMk8PynO+vpJPp3bK/Z0+fTkRbKxrggOy/gh4Hmd6pCmr4E9iZuor3nJN+6dVFTQJoOP SEDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7-v6si247498plk.553.2018.02.09.14.30.37; Fri, 09 Feb 2018 14:30:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192AbeBIW33 (ORCPT + 99 others); Fri, 9 Feb 2018 17:29:29 -0500 Received: from mail.ispras.ru ([83.149.199.45]:44508 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123AbeBIW3O (ORCPT ); Fri, 9 Feb 2018 17:29:14 -0500 Received: from localhost.localdomain (ppp85-140-182-254.pppoe.mtu-net.ru [85.140.182.254]) by mail.ispras.ru (Postfix) with ESMTPSA id 2D47354006B; Sat, 10 Feb 2018 01:29:13 +0300 (MSK) From: Alexey Khoroshilov To: Boris Brezillon Cc: Alexey Khoroshilov , Stefan Agner , Richard Weinberger , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH v4 2/3] mtd: nand: vf610: improve readability of error label Date: Sat, 10 Feb 2018 01:28:35 +0300 Message-Id: <1518215316-21504-3-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518215316-21504-1-git-send-email-khoroshilov@ispras.ru> References: <1518215316-21504-1-git-send-email-khoroshilov@ispras.ru> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use clearer error labels as Boris Brezillon suggested. Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index c4568372c3e3..9cc5992e88c8 100644 --- a/drivers/mtd/nand/vf610_nfc.c +++ b/drivers/mtd/nand/vf610_nfc.c @@ -682,7 +682,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) dev_err(nfc->dev, "Only one NAND chip supported!\n"); err = -EINVAL; - goto err_clk; + goto err_disable_clk; } nand_set_flash_node(chip, child); @@ -692,7 +692,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) if (!nand_get_flash_node(chip)) { dev_err(nfc->dev, "NAND chip sub-node missing!\n"); err = -ENODEV; - goto err_clk; + goto err_disable_clk; } chip->dev_ready = vf610_nfc_dev_ready; @@ -712,7 +712,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd); if (err) { dev_err(nfc->dev, "Error requesting IRQ!\n"); - goto err_clk; + goto err_disable_clk; } vf610_nfc_preinit_controller(nfc); @@ -720,7 +720,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) /* first scan to find the device and get the page size */ err = nand_scan_ident(mtd, 1, NULL); if (err) - goto err_clk; + goto err_disable_clk; vf610_nfc_init_controller(nfc); @@ -732,20 +732,20 @@ static int vf610_nfc_probe(struct platform_device *pdev) if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) { dev_err(nfc->dev, "Unsupported flash page size\n"); err = -ENXIO; - goto err_clk; + goto err_disable_clk; } if (chip->ecc.mode == NAND_ECC_HW) { if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) { dev_err(nfc->dev, "Unsupported flash with hwecc\n"); err = -ENXIO; - goto err_clk; + goto err_disable_clk; } if (chip->ecc.size != mtd->writesize) { dev_err(nfc->dev, "Step size needs to be page size\n"); err = -ENXIO; - goto err_clk; + goto err_disable_clk; } /* Only 64 byte ECC layouts known */ @@ -765,7 +765,7 @@ static int vf610_nfc_probe(struct platform_device *pdev) } else { dev_err(nfc->dev, "Unsupported ECC strength\n"); err = -ENXIO; - goto err_clk; + goto err_disable_clk; } chip->ecc.read_page = vf610_nfc_read_page; @@ -777,14 +777,14 @@ static int vf610_nfc_probe(struct platform_device *pdev) /* second phase scan */ err = nand_scan_tail(mtd); if (err) - goto err_clk; + goto err_disable_clk; platform_set_drvdata(pdev, mtd); /* Register device in MTD */ return mtd_device_register(mtd, NULL, 0); -err_clk: +err_disable_clk: clk_disable_unprepare(nfc->clk); return err; } -- 2.7.4