Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756663AbcK3HSB (ORCPT ); Wed, 30 Nov 2016 02:18:01 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:45764 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755878AbcK3HRs (ORCPT ); Wed, 30 Nov 2016 02:17:48 -0500 Date: Wed, 30 Nov 2016 08:17:42 +0100 From: Boris Brezillon To: Masahiro Yamada Cc: linux-mtd@lists.infradead.org, Linux Kernel Mailing List , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Subject: Re: [PATCH 21/39] mtd: nand: denali: support 64bit capable DMA engine Message-ID: <20161130081742.5ccad72b@bbrezillon> In-Reply-To: References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> <1480183585-592-22-git-send-email-yamada.masahiro@socionext.com> <20161127171606.3acd2c54@bbrezillon> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 975 Lines: 28 On Wed, 30 Nov 2016 16:11:53 +0900 Masahiro Yamada wrote: > Hi Boris, > > 2016-11-28 1:16 GMT+09:00 Boris Brezillon : > > > > If you follow my suggestions of definition function pointers, you'll > > just have to add a function pointer to the denali_caps struct: > > > > void (*setup_dma)(struct denali_nand_info *denali, int op); > > > > > This is possible because both 32B and 64B variants have > the same function prototype. > > > However, I am not keen on doing so for ecc_handle(), > so, at this moment, I am not keen on doing so only for setup_dma() either. > > If I see more cases that fit in callback handler approach, > I will think about switching to it with consistency. > Pretty much all the flags you define in this series could be turned into function pointers. I still think the function pointers approach is more future-proof, but I won't fight on that, so do as you wish.