From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from h1446028.stratoserver.net ([85.214.92.142] helo=mail.ahsoftware.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wp3CQ-00043n-Lv for linux-mtd@lists.infradead.org; Mon, 26 May 2014 22:16:55 +0000 Received: from eiche.ahsoftware (p57B20CCF.dip0.t-ipconnect.de [87.178.12.207]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id 0F848423C315 for ; Tue, 27 May 2014 00:16:36 +0200 (CEST) From: Alexander Holler To: linux-kernel@vger.kernel.org Subject: [PATCH 21/27] mtd: nand: fsl_upm: show device structure in sysfs Date: Tue, 27 May 2014 00:12:46 +0200 Message-Id: <1401142372-14148-22-git-send-email-holler@ahsoftware.de> In-Reply-To: <1401142372-14148-1-git-send-email-holler@ahsoftware.de> References: <1401142372-14148-1-git-send-email-holler@ahsoftware.de> Cc: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Alexander Holler List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Fix a common error in nand-drivers which do not set up a parent device for the mtd-device by using a new inline function. Signed-off-by: Alexander Holler --- drivers/mtd/nand/fsl_upm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index 4d203e8..bc2a188 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -175,9 +175,6 @@ static int fun_chip_init(struct fsl_upm_nand *fun, if (fun->rnb_gpio[0] >= 0) fun->chip.dev_ready = fun_chip_ready; - fun->mtd.priv = &fun->chip; - fun->mtd.owner = THIS_MODULE; - flash_np = of_get_next_child(upm_np, NULL); if (!flash_np) return -ENODEV; @@ -300,6 +297,7 @@ static int fun_probe(struct platform_device *ofdev) fun->dev = &ofdev->dev; fun->last_ctrl = NAND_CLE; + mtd_setup_common_members(&fun->mtd, &fun->chip, ofdev); ret = fun_chip_init(fun, ofdev->dev.of_node, &io_res); if (ret) goto err2; -- 1.8.3.2