Message ID | 566BA661.9000407@denx.de |
---|---|
State | RFC |
Headers | show |
On Sat, Dec 12, 2015 at 05:45:21AM +0100, Heiko Schocher wrote: > Am 12.12.2015 um 00:58 schrieb Brian Norris: > >Commit 807f16d4db95 ("mtd: core: set some defaults when dev.parent is > >set") attempted to provide some default settings for MTDs that > > (a) assign the parent device and > > (b) don't provide their own name or owner > > > >However, this isn't a perfect drop-in replacement for the boilerplate > >found in some drivers, because the MTD name is used by partition > >parsers like cmdlinepart, but the name isn't set until add_mtd_device(), > >after the parsing is completed. This means cmdlinepart sees a NULL name > >and therefore will not work properly. > > > >Fix this by moving the default name and owner assignment to be first in > >the MTD registration process. > > > >Fixes: 807f16d4db95 ("mtd: core: set some defaults when dev.parent is set") > >Reported-by: Heiko Schocher <hs@denx.de> > >Signed-off-by: Brian Norris <computersforpeace@gmail.com> > >Cc: Heiko Schocher <hs@denx.de> > >Cc: Frans Klaver <fransklaver@gmail.com> > >--- > >Heiko, can you provide testing feedback (e.g., 'Tested-by: ...')? > > Sorry, does not work for me: > > Based on: > pollux:linux hs [20151212] $ git describe master > v4.4-rc4-135-gb9d8545 > > and this patch, shows the same problem, [...] Ugh, I see the problem. In nand_base.c, nand_get_flash_type(): if (!mtd->name) mtd->name = type->name; Brian
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 93f664c..28dcf66 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1685,6 +1685,7 @@ static int omap_nand_probe(struct platform_device *pdev) info->ecc_opt = pdata->ecc_opt; mtd = &info->mtd; mtd->priv = &info->nand; + mtd->name = dev_name(&pdev->dev); mtd->dev.parent = &pdev->dev; nand_chip = &info->nand; nand_chip->ecc.priv = NULL;