Received: by 10.223.176.5 with SMTP id f5csp1198458wra; Fri, 9 Feb 2018 14:30:17 -0800 (PST) X-Google-Smtp-Source: AH8x224OnXPiAbxASi9SmrgQb6WCz+CaM81QwPxiS68xz9BmqUK93P8YM5F4bh8zJecTJuv7jWBk X-Received: by 10.99.104.194 with SMTP id d185mr3502263pgc.404.1518215417010; Fri, 09 Feb 2018 14:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518215416; cv=none; d=google.com; s=arc-20160816; b=G5+lqOiDVZxq3GpW3GQEm6dgmrF8mKwoVaOPEBu3uokUArLG27+D7YEc6/sm46XKbf A1ZbhrgYC0u6V2DH4yJTZeHDDyfqdKw8MltZ9k9s4jj5Uz1i7IoYyEKMU3iQNoXy73+P BHHwUGOzC9Vrov5urjBUd4zlCTa6VqwpT2WYAHS9HKTCR4uiSFTjngzav958TmAd9Exo TEh7YrAFtYlBiPXz10aWT0omuzLi99jkekKVVvIfzTrNTCdtdD6ovaubvheYx1iA+/PT u66YIFlnGPJb/jZvE+z7BPxNAhtuiODmCgpayOiUsBpii6NVGGEKHHPR4TpzessZ5omR +6aw== 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=/r2bYDogKR4/WlqYmecJHFT2aXm411p6QQ2kle2/pJE=; b=OEhCgFRUf9qrTYRXFyM3rFZuMr3EVQPf2+SVN/IGmeIMtAxe3k2xmX7CVq5UkvR2LA wjRjMj8zA9orC0+MOtd9aVxdY0nzCdTJnntdB8NoVV4J7S/yM16nyzcELO6dYXVlxlA1 pGY1JJiyRMjnt8Yy7X1qV59ligX2uXJEt4neKFl6UiTIdaCphUvWMVkmd5mm8c/ijGXe I5hlDtWvRGdOWgYCFaY7y9CF3bC/eXSse5tzRP3V5YQG726MuTtPiFYiEvgTogeHgYOm iKzTGTUaOyEI59+V9BnGAYgJJXx3JhIm7AYwDqzKE3psVSq99il5f2QTvcbvPs/cJzQG 1Cng== 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 e3si1897738pgt.217.2018.02.09.14.30.03; Fri, 09 Feb 2018 14:30:16 -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 S1753146AbeBIW3P (ORCPT + 99 others); Fri, 9 Feb 2018 17:29:15 -0500 Received: from mail.ispras.ru ([83.149.199.45]:44482 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753118AbeBIW3O (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 CA8D854006A; Sat, 10 Feb 2018 01:29:12 +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 1/3] mtd: nand: vf610: remove the unnecessary of_node_put() Date: Sat, 10 Feb 2018 01:28:34 +0300 Message-Id: <1518215316-21504-2-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 Calling of_node_put() in vf610_nfc_probe() is wrong because nothing in this code retains a reference to the DT node. Signed-off-by: Alexey Khoroshilov --- drivers/mtd/nand/vf610_nfc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index 80d31a58e558..c4568372c3e3 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 error; + goto err_clk; } nand_set_flash_node(chip, child); @@ -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 error; + goto err_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 error; + goto err_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 error; + goto err_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 error; + goto err_clk; } if (chip->ecc.size != mtd->writesize) { dev_err(nfc->dev, "Step size needs to be page size\n"); err = -ENXIO; - goto error; + goto err_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 error; + goto err_clk; } chip->ecc.read_page = vf610_nfc_read_page; @@ -777,15 +777,13 @@ static int vf610_nfc_probe(struct platform_device *pdev) /* second phase scan */ err = nand_scan_tail(mtd); if (err) - goto error; + goto err_clk; platform_set_drvdata(pdev, mtd); /* Register device in MTD */ return mtd_device_register(mtd, NULL, 0); -error: - of_node_put(nand_get_flash_node(chip)); err_clk: clk_disable_unprepare(nfc->clk); return err; -- 2.7.4