From: Jean-Christophe PLAGNIOL-VILLARD Subject: Re: [PATCH 2/5 v2] ARM: AT91SAM9G45: same platform data structure for all crypto peripherals Date: Wed, 7 Nov 2012 17:45:23 +0100 Message-ID: <20121107164523.GG4576@game.jcrosoft.org> References: <20121107152615.GD4576@game.jcrosoft.org> <1352305675-21961-1-git-send-email-nicolas@eukrea.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: herbert@gondor.apana.org.au, nicolas.ferre@atmel.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, eric@eukrea.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org To: Nicolas Royer Return-path: Content-Disposition: inline In-Reply-To: <1352305675-21961-1-git-send-email-nicolas@eukrea.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-crypto.vger.kernel.org On 17:27 Wed 07 Nov , Nicolas Royer wrote: > Only AES use DMA in AT91SAM9G45 (TDES and SHA use PDC). > = > However latest Atmel TDES and SHA IP releases use DMA instead of PDC. > --> Atmel TDES and SHA drivers need DMA platform data for those IP rele= ases. > = > Goal of this patch is to use the same platform data structure for all Atm= el > crypto peripherals. This structure contains information about DMA interfa= ce. > = > Signed-off-by: Nicolas Royer > Acked-by: Nicolas Ferre > Acked-by: Eric B=E9nard > Tested-by: Eric B=E9nard > --- > v2 : check kzalloc return value. > = > arch/arm/mach-at91/at91sam9g45_devices.c | 10 ++++++---- > include/linux/platform_data/atmel-aes.h | 22 ---------------------- > include/linux/platform_data/crypto-atmel.h | 22 ++++++++++++++++++++++ > 3 files changed, 28 insertions(+), 26 deletions(-) > delete mode 100644 include/linux/platform_data/atmel-aes.h > create mode 100644 include/linux/platform_data/crypto-atmel.h > = > diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at9= 1/at91sam9g45_devices.c > index fcd233c..c1631d1 100644 > --- a/arch/arm/mach-at91/at91sam9g45_devices.c > +++ b/arch/arm/mach-at91/at91sam9g45_devices.c > @@ -18,7 +18,7 @@ > #include > #include > #include > -#include > +#include > = > #include > = > @@ -1900,7 +1900,7 @@ static void __init at91_add_device_tdes(void) {} > * -------------------------------------------------------------------- = */ > = > #if defined(CONFIG_CRYPTO_DEV_ATMEL_AES) || defined(CONFIG_CRYPTO_DEV_AT= MEL_AES_MODULE) > -static struct aes_platform_data aes_data; > +static struct crypto_platform_data aes_data; > static u64 aes_dmamask =3D DMA_BIT_MASK(32); > = > static struct resource aes_resources[] =3D { > @@ -1931,9 +1931,11 @@ static struct platform_device at91sam9g45_aes_devi= ce =3D { > static void __init at91_add_device_aes(void) > { > struct at_dma_slave *atslave; > - struct aes_dma_data *alt_atslave; > + struct crypto_dma_data *alt_atslave; > = > - alt_atslave =3D kzalloc(sizeof(struct aes_dma_data), GFP_KERNEL); > + alt_atslave =3D kzalloc(sizeof(struct crypto_dma_data), GFP_KERNEL); I still not understand why we need to allocate it just declare it as static Best Regards, J.