Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754766AbdDKLjN (ORCPT ); Tue, 11 Apr 2017 07:39:13 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:56196 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754630AbdDKLjL (ORCPT ); Tue, 11 Apr 2017 07:39:11 -0400 Date: Tue, 11 Apr 2017 13:39:09 +0200 From: Boris Brezillon To: Roger Quadros Cc: , , , , , , "# 4 . 7+" Subject: Re: [PATCH] mtd: nand: omap2: Fix partition creation via cmdline mtdparts Message-ID: <20170411133909.3b25a054@bbrezillon> In-Reply-To: <1490859470-7973-1-git-send-email-rogerq@ti.com> References: <1490859470-7973-1-git-send-email-rogerq@ti.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1832 Lines: 52 On Thu, 30 Mar 2017 10:37:50 +0300 Roger Quadros wrote: > 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. > Applied. Thanks, Boris > 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(+) > > 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))