mtd: mtd_blk: get mtd through dev_get_priv() when the storage is nand
In the nand mtd, we will use chip info to operate nand, and get the chip through mtd_to_nand(). So we should get mtd through dev_get_priv() but not dev_get_uclass_platdata. Change-Id: I1bacbec49158d04dc947a880dbe3a8043fe3123d Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
parent
1d2de2a99a
commit
8cf6fca4b8
|
|
@ -114,6 +114,10 @@ ulong mtd_dread(struct udevice *udev, lbaint_t start,
|
||||||
#ifdef CONFIG_NAND
|
#ifdef CONFIG_NAND
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
mtd = dev_get_priv(udev->parent);
|
||||||
|
if (!mtd)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ret = nand_read_skip_bad(mtd, off, &rwsize,
|
ret = nand_read_skip_bad(mtd, off, &rwsize,
|
||||||
NULL, mtd->size,
|
NULL, mtd->size,
|
||||||
(u_char *)(dst));
|
(u_char *)(dst));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue