From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Fri, 9 Oct 2015 16:48:31 +0800 Subject: [U-Boot] [PATCH v2] nios2: convert dma_alloc_coherent to use memalign In-Reply-To: <201510082343.02636.marex@denx.de> References: <1444013823-11909-1-git-send-email-thomas@wytron.com.tw> <1444114189-1220-1-git-send-email-thomas@wytron.com.tw> <201510082343.02636.marex@denx.de> Message-ID: <56177F5F.7060009@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On 10/09/2015 05:43 AM, Marek Vasut wrote: > I'd suggest that you do this: > > void *reg; > unsigned long *h = memalign(...); > flush_dcache_range(); > > reg = ioremap(); > if (!reg) > fail here > > *handle = h; // modify handle after we know ioremap succeeded. > > return reg; > Thanks a lot for your suggestion. It is much clear with this. Best regards, Thomas