lkml.org 
[lkml]   [2014]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 21/27] mtd: nand: fsl_upm: show device structure in sysfs
Date
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 <holler@ahsoftware.de>
---
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


\
 
 \ /
  Last update: 2014-05-27 01:41    [W:0.247 / U:3.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site