linux-mips
[Top] [All Lists]

Re: [PATCH] PNX8550 NAND flash driver

To: "Vladimir A. Barinov" <vbarinov@ru.mvista.com>
Subject: Re: [PATCH] PNX8550 NAND flash driver
From: Todd Poynor <tpoynor@mvista.com>
Date: Tue, 21 Feb 2006 16:57:35 -0800
Cc: linux-mtd@lists.infradead.org, linux-mips@linux-mips.org
In-reply-to: <43F1D439.60205@ru.mvista.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <43A2F819.1040106@ru.mvista.com> <43C69EC2.2070601@mvista.com> <43F1D439.60205@ru.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5 (X11/20051201)
Hi Vladimir -- a couple comments.

+       PNX8550_XIO_FLASH_CTRL = reg_nand;
+       barrier();
+}

barrier() at the end of a function shouldn't be needed, function exit is an implicit optimizer flush?


+       pnx8550_nand_alloc_transfer_buffer();
+
+       memcpy(transferBuffer, buf, len);

Something should check for NULL return from kmalloc in both places this is called.

+       /* Scan to find existence of the device */
+       if (nand_scan(&pnx8550_mtd, 1)) {
+               printk(KERN_ERR "No NAND devices\n");
+               return -ENXIO;
+       }
+
+       if (!transferBuffer) {
+               printk(KERN_ERR
+                   "Unable to allocate NAND data buffer for PNX8550\n");
+               return -ENOMEM;
+       }

Not sure why transferBuffer was expected to be allocated at this point (only when first read/write_buf called, scan does read_byte)?


--
Todd

<Prev in Thread] Current Thread [Next in Thread>