Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13815484pxu; Mon, 4 Jan 2021 05:22:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPT5ba/4Xb3+KKBnD/g+HhKmNEFXXWCL8bbyof/fI4M9/mSLIBYGzvcM4wGTS2aSpvTT49 X-Received: by 2002:a17:906:2e82:: with SMTP id o2mr67277394eji.106.1609766560975; Mon, 04 Jan 2021 05:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609766560; cv=none; d=google.com; s=arc-20160816; b=FLoC+cEe+Yq6TQXV161sr+cuOsZOPqtBfEUwiPfnJYeFpWQsrCondrDpLqnjsVjZgk ezLPSFgkLczP3z3OiACOriB0I8EHFEgPVcmC6JbreDYju5M1UC95coH3Sx5LHtQUbOOu kgorfgjB3pUr7izisnBVgQaOBnqYM5Hiux7qQMF1AnxG8Zjo+l4GL+RNCHPYI1/ZJNn5 bvMbCoyeBm1IgTyUg66wu3jndZ1cXJg2myAu2TiyhZjRhrarMBDY6V1CeRg/iAQzBS7z lzJ0jKBWviOPeJerv4DnBG8bv/3YyJbiEi6VTH4vLroKrtp2rvzmpxe0zgkz/tUtO2dI xyHQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=35pqa16b4ofmz9Bl61+3r2augBZ/eQfChrl+59yu+WU=; b=DziejdpvsK/z3z/hguAC7tjhvMcb7Jz++CnZy7y0MC+LsenvseDANepToiExJ3E8NP Ifu2EvOOtuXV+ymIN2RySaGZg3BD+zZhrF42xDUyHwPIVFLdH/JqgipGaGW3GRuaUM0w T16mMScM+9XPqLT4eFw4D81lcbjjFaV4d9z3r7GnV5+iuj7vMdalxdfIpNivhlZg7Rp9 KW0GWpKCtPfTIshVG8LApkDdtD1xQihaOeiFFYIxdRWqZPFGtra3dhwMyUuYe8d43NCb E+Oz6gE9wWgmewXWaNH/F/SfOkqF8BJ8kZKBlVdnn8RSqxciXoIwrMZrD783G5i2WjXI +PoA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si34600611edq.123.2021.01.04.05.22.17; Mon, 04 Jan 2021 05:22:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbhADNUU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Jan 2021 08:20:20 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:51687 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbhADNUT (ORCPT ); Mon, 4 Jan 2021 08:20:19 -0500 Received: from xps13 (lfbn-tou-1-1535-bdcst.w90-89.abo.wanadoo.fr [90.89.98.255]) (Authenticated sender: miquel.raynal@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id D0640240003; Mon, 4 Jan 2021 13:19:33 +0000 (UTC) Date: Mon, 4 Jan 2021 14:19:32 +0100 From: Miquel Raynal To: Martin Blumenstingl Cc: vadivel.muruganx.ramuthevar@linux.intel.com, linux-mtd@lists.infradead.org, richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: intel: remove broken code Message-ID: <20210104141932.1037f8e3@xps13> In-Reply-To: References: <20201217221148.2877318-1-martin.blumenstingl@googlemail.com> <20210104094849.1850c993@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, Martin Blumenstingl wrote on Mon, 4 Jan 2021 14:13:04 +0100: > Hi Miquel, > > thank you for looking into this > > On Mon, Jan 4, 2021 at 9:48 AM Miquel Raynal wrote: > [...] > > > 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; > > > - } > > > > This is valid code, it's best to use a label = "my-storage"; property > > in your NAND DT node. Then mtd->name will be updated by > > nand_set_flash_node(). > so you suggest moving the check instead? > the original code flow was: > mtd = NULL; > if (!mtd->name) > return -EINVAL; > mtd = nand_to_mtd(&ebu_host->chip); > ... > > by saying that the code itself is valid you're asking me to update the > flow to the following: > mtd = nand_to_mtd(&ebu_host->chip); > if (!mtd->name) > return -EINVAL; I actually missed the fact that mtd was used initialized, but yes that is exactly what I meant! Thanks, Miquèl