Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332636
b: refs/heads/master
c: 71885b6
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer authored and David Woodhouse committed Jul 6, 2012
1 parent b3b3047 commit 9d14008
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4a09cbf2dc7ba6c7fd7e07a3ab3d3f499a575e2
refs/heads/master: 71885b650ab0fd9d2d35cd922bf949c07c171b04
11 changes: 5 additions & 6 deletions trunk/arch/arm/plat-mxc/devices/platform-mxc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,20 @@ struct platform_device *__init imx_add_mxc_nand(
/* AXI has to come first, that's how the mxc_nand driver expect it */
struct resource res[] = {
{
.start = data->axibase,
.end = data->axibase + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = data->iobase,
.end = data->iobase + data->iosize - 1,
.flags = IORESOURCE_MEM,
}, {
.start = data->irq,
.end = data->irq,
.flags = IORESOURCE_IRQ,
}, {
.start = data->axibase,
.end = data->axibase + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
};
return imx_add_platform_device("mxc_nand", data->id,
res + !data->axibase,
ARRAY_SIZE(res) - !data->axibase,
res, ARRAY_SIZE(res) - !data->axibase,
pdata, sizeof(*pdata));
}
35 changes: 19 additions & 16 deletions trunk/drivers/mtd/nand/mxc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,25 @@ static int __init mxcnd_probe(struct platform_device *pdev)
if (IS_ERR(host->clk))
return PTR_ERR(host->clk);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
err = mxcnd_probe_dt(host);
if (err > 0)
err = mxcnd_probe_pdata(host);
if (err < 0)
return err;

if (host->devtype_data->needs_ip) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
host->regs_ip = devm_request_and_ioremap(&pdev->dev, res);
if (!host->regs_ip)
return -ENOMEM;

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
} else {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
}

if (!res)
return -ENODEV;

Expand All @@ -1386,12 +1404,6 @@ static int __init mxcnd_probe(struct platform_device *pdev)

host->main_area0 = host->base;

err = mxcnd_probe_dt(host);
if (err > 0)
err = mxcnd_probe_pdata(host);
if (err < 0)
return err;

if (host->devtype_data->regs_offset)
host->regs = host->base + host->devtype_data->regs_offset;
host->spare0 = host->base + host->devtype_data->spare0_offset;
Expand All @@ -1405,15 +1417,6 @@ static int __init mxcnd_probe(struct platform_device *pdev)
this->ecc.size = 512;
this->ecc.layout = host->devtype_data->ecclayout_512;

if (host->devtype_data->needs_ip) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res)
return -ENODEV;
host->regs_ip = devm_request_and_ioremap(&pdev->dev, res);
if (!host->regs_ip)
return -ENOMEM;
}

if (host->pdata.hw_ecc) {
this->ecc.calculate = mxc_nand_calculate_ecc;
this->ecc.hwctl = mxc_nand_enable_hwecc;
Expand Down

0 comments on commit 9d14008

Please sign in to comment.