Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1609411pxu; Thu, 17 Dec 2020 14:14:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaa7Jphv/+oKsDIQaNiGwMUWfAehKimO7V2rg4Hbrq9+KMaN56QeICoXU059jI964w9GtD X-Received: by 2002:a50:a692:: with SMTP id e18mr1498082edc.233.1608243284184; Thu, 17 Dec 2020 14:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608243284; cv=none; d=google.com; s=arc-20160816; b=jPnLyeaHB7JISI3sDWtD6pfur1G+jF4M/oh2jcN7DjEQ4TTPldH/FHFQ1n6/9NBlLr D6JglZ2x3VzNJcsjuBSltCZq+erZDHPwcYUVJe9I8tGKfV5qc7ksyNLmRIQy1dKtnQ+z 86NA7a0kW/97LlzvgNgaY3jkzerfu3cBp3MRHWKzWCEOeOCIVnIOxbndrZhIbknfHz7V DyrR3LmnYaayDYdQ4EvaGBDe6TOmGIEK1/43Izfkrd9mIBIA5JaGczfyxGDlAbYmitZC UItJg1fU1BwLawhZ5oIVHTAAQM2CF7wUTh6/pV/+cutcoW3YeGFDWQ8W5HfkUDcmKRtY q6ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0ctiK0mA4JK6QvRekJWEWOG1zeHLhg/gasLcxbxoVjc=; b=OMyR0H1S6g8ShSlyrse5dCsk0CijjIMGYdxNGchq2AYqh6vFzUDfyo6R/XxOoDcmEq iQsEPtfixSO7Pxpn0y2rBlVOHaHCIFuynDF23AXGRfE992oylb7svBpReT1qG4OgBVvY 5L+p37CRz7j9dBNnlJoa70uys9aFCl6H/z9Brt781udKu3Pf95+XdMC5I7FdlcZJP1l1 P0OnYzwnCn6nbsKNMsoSk2wMQ0b6SYwsfs0za7iKTWlv+4THOBShYsGY+7dsLS81eWeh gnd9VS6nZJ27QkQpdOHsgMX8N2KOye7j3S3D3btR0ay+Lz6FyrHe6AZRs1S5OtFAL8Sg uybw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=A8GA8Oku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si3402783ejb.710.2020.12.17.14.14.21; Thu, 17 Dec 2020 14:14:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=A8GA8Oku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732039AbgLQWMk (ORCPT + 99 others); Thu, 17 Dec 2020 17:12:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbgLQWMk (ORCPT ); Thu, 17 Dec 2020 17:12:40 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C457C061794 for ; Thu, 17 Dec 2020 14:11:58 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id g24so293392edw.9 for ; Thu, 17 Dec 2020 14:11:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0ctiK0mA4JK6QvRekJWEWOG1zeHLhg/gasLcxbxoVjc=; b=A8GA8OkuDewd4OZzGXgLg2SB0z//t9YORRY5DZf9LWIYIFt5Om0aDUsaVXYu5IsuP3 ffkDcYVvWIAEo36FDAAo38dBcrXKKN2X2oQuVzJlRmujVIYEMhnusSK/sTNmM7GlPY20 Uw8mCuwCXC/n9I95XjQx3E8wSpdrCmPD1PE1sWsCGxCXwhhwanoCqrX4poiocnlvtBzQ TPE/3wRqJhefWP6C9VAnAHZbTQtD/3cKE0RQUNzlMAVm//HNDnPvS/WO7k+dIDHmgaDo lA2IplvyRFUdSWoV2zIj+wysQd0TrUGEBH0VnFgEEinw5fZUD7L1FuqR8n09xw8Wlqce 6JNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0ctiK0mA4JK6QvRekJWEWOG1zeHLhg/gasLcxbxoVjc=; b=lTUvti/wa9VCJx5Y+iv7sJJeNRfIJ6F2M1OXDZPLPQi5w++vnbXTJABZyPMG2kwxvb AUujXrBlqJJ49YQ1k3k+If8MEEfz/TLGHPPqV2yB9MeTu2XpBKrNjl+96BzOKdcJ7wJQ 1iuqWpTLmFsvOo8SUNCf4APUNa/YqhQzwjtWODhCyUdPYNDieLhlVcX6+u7VykgZGazb kogjGXMxQAflRrq16LQLjsUdzc68Sj4oXKf3dHM7zf00MYytmj7l1+D3DHatmGyuK3sS gCBQfIa1AREIqQRH/EjzuPnCKpNotHs6wazaWhAaC6OgCkqmlTEnjt3CX+3CNunvyRIh +JAg== X-Gm-Message-State: AOAM530cFtOnOjT8PcAoAsQR4DQy/FgKXUWUN9iOJzHZ/2Ykzkb/+27Y UnPA95oHK7al8QKC5+ATLmQ= X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr1535936edv.100.1608243117145; Thu, 17 Dec 2020 14:11:57 -0800 (PST) Received: from localhost.localdomain (p200300f137008a00428d5cfffeb99db8.dip0.t-ipconnect.de. [2003:f1:3700:8a00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id m7sm4627091ejr.119.2020.12.17.14.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 14:11:56 -0800 (PST) From: Martin Blumenstingl To: vadivel.muruganx.ramuthevar@linux.intel.com, linux-mtd@lists.infradead.org Cc: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH] mtd: rawnand: intel: remove broken code Date: Thu, 17 Dec 2020 23:11:48 +0100 Message-Id: <20201217221148.2877318-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the check for mtd->name as it's executed while the mtd variable is always NULL. If some MTD name is needed then it should be validated by the MTD core. While here, also drop the NULL assignment to the mtd variable as it's overwritten later on anyways and the NULL value is never read. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl --- I found this by looking at the new driver. This patch is compile-tested only. drivers/mtd/nand/raw/intel-nand-controller.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index fdb112e8a90d..398de6ec68d7 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -579,7 +579,7 @@ static int ebu_nand_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct ebu_nand_controller *ebu_host; struct nand_chip *nand; - struct mtd_info *mtd = NULL; + struct mtd_info *mtd; struct resource *res; char *resname; int ret; @@ -647,10 +647,6 @@ static int ebu_nand_probe(struct platform_device *pdev) ebu_host->ebu + EBU_ADDR_SEL(cs)); nand_set_flash_node(&ebu_host->chip, dev->of_node); - if (!mtd->name) { - dev_err(ebu_host->dev, "NAND label property is mandatory\n"); - return -EINVAL; - } mtd = nand_to_mtd(&ebu_host->chip); mtd->dev.parent = dev; -- 2.29.2