diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-05 08:33:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-05 08:33:37 +0200 |
commit | 261fdae6dbce5ff8507270d0cfa40340ee109660 (patch) | |
tree | fedc096e9b6a7bdbbe58aa31bb362c13458c805a /drivers | |
parent | a03a8de4619ff601c8b6f55087690df1fbce5d48 (diff) | |
download | barebox-261fdae6dbce5ff8507270d0cfa40340ee109660.tar.gz barebox-261fdae6dbce5ff8507270d0cfa40340ee109660.tar.xz |
nand_imx_v2: use xzalloc for data buffers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nand/nand_imx_v2.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/drivers/nand/nand_imx_v2.c b/drivers/nand/nand_imx_v2.c index 809b577fb1..bcf353d3a0 100644 --- a/drivers/nand/nand_imx_v2.c +++ b/drivers/nand/nand_imx_v2.c @@ -849,35 +849,6 @@ static void mxc_nfc_init(struct imx_nand_host *host) raw_write(NFC_WPC_UNLOCK, NFC_WRPROT); } -static int mxc_alloc_buf(void) -{ - int err = 0; - - data_buf = kzalloc(NAND_MAX_PAGESIZE, GFP_KERNEL); - if (!data_buf) { - printk(KERN_ERR "%s: failed to allocate data_buf\n", __func__); - err = -ENOMEM; - goto out; - } - oob_buf = kzalloc(NAND_MAX_OOBSIZE, GFP_KERNEL); - if (!oob_buf) { - printk(KERN_ERR "%s: failed to allocate oob_buf\n", __func__); - err = -ENOMEM; - goto out; - } - - out: - return err; -} - -#if 0 -static void mxc_free_buf(void) -{ - kfree(data_buf); - kfree(oob_buf); -} -#endif - static int __init imxnd_probe(struct device_d *dev) { struct nand_chip *this; @@ -888,8 +859,8 @@ static int __init imxnd_probe(struct device_d *dev) int err = 0; /* init data buf */ - if (mxc_alloc_buf()) - goto err_out; + data_buf = xzalloc(NAND_MAX_PAGESIZE); + oob_buf = xzalloc(NAND_MAX_OOBSIZE); /* Allocate memory for MTD device structure and private data */ host = kzalloc(sizeof(struct imx_nand_host), GFP_KERNEL); |