summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorKevin Smith <kevin.smith@elecsyscorp.com>2016-01-14 16:01:38 +0000
committerScott Wood <scottwood@freescale.com>2016-02-12 17:13:47 -0600
commit84caff35df0a399051171e4a05c6cbcadd919b64 (patch)
tree906416eda7ad1b17ef94710baeb902e80426e248 /drivers/mtd
parentb7d3e4a63580198237bdce989d5514476056ee16 (diff)
downloadu-boot-imx-84caff35df0a399051171e4a05c6cbcadd919b64.zip
u-boot-imx-84caff35df0a399051171e4a05c6cbcadd919b64.tar.gz
u-boot-imx-84caff35df0a399051171e4a05c6cbcadd919b64.tar.bz2
mtd: pxa3xx_nand: Correct offset calculation
Correct some pointer math in initialization. An offset was added to a struct-typed pointer instead of one casted to a byte-size, resulting in a much larger offset than intended. Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com> Cc: Stefan Roese <sr@denx.de> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 9202459..a83f6c2 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1486,8 +1486,8 @@ static int alloc_nand_resource(struct pxa3xx_nand_info *info)
info->variant = pxa3xx_nand_get_variant();
for (cs = 0; cs < pdata->num_cs; cs++) {
mtd = &nand_info[cs];
- chip = (struct nand_chip *)info +
- sizeof(struct pxa3xx_nand_host);
+ chip = (struct nand_chip *)
+ ((u8 *)&info[1] + sizeof(*host) * cs);
host = (struct pxa3xx_nand_host *)chip;
info->host[cs] = host;
host->mtd = mtd;