From patchwork Thu Mar 30 07:37:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 96254 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp117045qgd; Thu, 30 Mar 2017 00:38:43 -0700 (PDT) X-Received: by 10.99.124.26 with SMTP id x26mr4494826pgc.81.1490859523878; Thu, 30 Mar 2017 00:38:43 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id g17si1360614pgj.222.2017.03.30.00.38.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 00:38:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@ti.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ti.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XIv7vforeN6vQry2lphxsCWcQAgSpoYOHcdTOJblR/A=; b=jtSPXVdE8koSr+ Zn4kH3JvoDG/uB/WIeMjGoqJt3cRMP2d75IthOrWvzLZeJgegYcuoZgzMR92u2TKscqoRVAfkuuOl 5c7xz2YSgUVuhMSPIY4NkmkTrYQJInFcAoFKT6b/0uERol1DLPFzqMXZpsCjWEA/IrgA+UMxiKt2q mMowoHFYQCnXWStBzb0DVhP9BRthFsiTGaheVmdXAPd7Kvx4p3uRuXcVs6+ttFyX37lrQk7HHKVrE oXIyxebpm5D02W53F6XF5/NPHAi0XNuze4r2Zot7QBxmicNXv/FAZb3K13K1BUP98zdMV6C7MQeA4 i1MFnYyQd8yCTNa7gv/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ctUfI-00015U-Fs; Thu, 30 Mar 2017 07:38:40 +0000 Received: from lelnx193.ext.ti.com ([198.47.27.77]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctUfF-0000z6-7l for linux-mtd@lists.infradead.org; Thu, 30 Mar 2017 07:38:39 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2U7cEJl014621; Thu, 30 Mar 2017 02:38:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490859494; bh=dVmlxwN0KzdywuPg7ew6gPOXmQDWJSNW4LDdm9UKcfo=; h=From:To:CC:Subject:Date; b=Esyv5B0RIvHMrtFaaWEhguKwLooFodDdxyVGKHDzEMRpNCWHdRZhGjv/DbFKvCM2X 0IsJTYo9VdOz+Wh4wpFMEq1MSJJ2bnFSNzrSoli6Ow8ifTYsZSmul/a7X20dKYIa1S gXp3eExq6lR8ZEAhgzp74DCYvNE0s5c5rmtr4k3I= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2U7cDIx017725; Thu, 30 Mar 2017 02:38:13 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Thu, 30 Mar 2017 02:38:13 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2U7cAvn010782; Thu, 30 Mar 2017 02:38:11 -0500 From: Roger Quadros To: Subject: [PATCH] mtd: nand: omap2: Fix partition creation via cmdline mtdparts Date: Thu, 30 Mar 2017 10:37:50 +0300 Message-ID: <1490859470-7973-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170330_003837_410271_21F3FE5E X-CRM114-Status: UNSURE ( 7.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: enrico.leto@siemens.com, richard@nod.at, linux-kernel@vger.kernel.org, "# 4 . 7+" , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, aford173@gmail.com, Roger Quadros Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org commit c9711ec5250b ("mtd: nand: omap: Clean up device tree support") caused the parent device name to be changed from "omap2-nand.0" to ".nand" (e.g. 30000000.nand on omap3 platforms). This caused mtd->name to be changed as well. This breaks partition creation via mtdparts passed by u-boot as it uses "omap2-nand.0" for the mtd-id. Fix this by explicitly setting the mtd->name to "omap2-nand." if it isn't already set by nand_set_flash_node(). CS number is the NAND controller instance ID. Fixes: c9711ec5250b ("mtd: nand: omap: Clean up device tree support") Cc: # 4.7+ Reported-by: Leto Enrico Reported-by: Adam Ford Suggested-by: Boris Brezillon Tested-by: Adam Ford Signed-off-by: Roger Quadros --- drivers/mtd/nand/omap2.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 2a52101..084934a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1856,6 +1856,15 @@ static int omap_nand_probe(struct platform_device *pdev) nand_chip->ecc.priv = NULL; nand_set_flash_node(nand_chip, dev->of_node); + if (!mtd->name) { + mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "omap2-nand.%d", info->gpmc_cs); + if (!mtd->name) { + dev_err(&pdev->dev, "Failed to set MTD name\n"); + return -ENOMEM; + } + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); nand_chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(nand_chip->IO_ADDR_R))