From: Arnd Bergmann <arnd@arndb.de>
To: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Magnus Damm <magnus.damm@gmail.com>,
linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Ai Kyuse <ai.kyuse.uw@renesas.com>
Subject: Re: [PATCH/RFC v2 5/5] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC
Date: Thu, 30 Jun 2016 13:50:24 +0200 [thread overview]
Message-ID: <4198735.C1rpRVa8xf@wuerfel> (raw)
In-Reply-To: <1467237940-24388-6-git-send-email-horms+renesas@verge.net.au>
On Thursday, June 30, 2016 12:05:40 AM CEST Simon Horman wrote:
> @@ -120,6 +127,26 @@ static int sdhi_sysc_dmac_init_dma(void)
> }
> #endif
>
> +#if IS_ENABLED(CONFIG_MMC_SDHI_INTERNAL_DMA)
> +int sdhi_internal_dmac_init_dma(void);
> +#else
> +static int sdhi_internal_dmac_init_dma(void)
> +{
> + return -EINVAL;
> +}
> +#endif
> +
> +static int sh_mobile_sdhi_init_dma(enum tmio_mmc_dmac_type dmac_type)
> +{
> + switch (dmac_type) {
> + case TMIO_MMC_INTERNAL_DMAC:
> + return sdhi_internal_dmac_init_dma();
> +
> + case TMIO_MMC_SYSC_DMAC:
> + return sdhi_sysc_dmac_init_dma();
> + }
> +}
> +
I think it would be nicer to turn the logic around and handle the
different kinds of TMIO hardware like we do it for the sdhci types:
Make the common portion of the driver a module that just exports
functions but doesn't register a driver, and then put each variant
(PIO, internal DMA, SYSC-DMA) into a separate module that registers
its own driver.
Do you think that makes sense in this case?
Arnd
next prev parent reply other threads:[~2016-06-30 11:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 22:05 [PATCH/RFC v2 0/5] mmc: renesas_sdhi: add R-Car Gen-3 DMA support Simon Horman
2016-06-29 22:05 ` [PATCH/RFC v2 1/5] mmc: sh_mobile_sdhi, tmio: make dma more modular Simon Horman
2016-07-05 17:05 ` Geert Uytterhoeven
2016-07-06 19:57 ` Simon Horman
2016-06-29 22:05 ` [PATCH/RFC v2 2/5] mmc: sh_mobile_sdhi: rename DMA source file as renesas_sdhi_sysc_dmac.c Simon Horman
2016-06-29 22:05 ` [PATCH/RFC v2 3/5] mmc: tmio: add max_segs and max_blk_count in tmio_mmc_data Simon Horman
2016-06-29 22:05 ` [PATCH/RFC v2 4/5] mmc: sh_mobile_sdhi: add some SoC specific data for R-Car Gen3 Simon Horman
2016-06-29 22:05 ` [PATCH/RFC v2 5/5] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC Simon Horman
2016-06-30 11:50 ` Arnd Bergmann [this message]
2016-07-05 11:06 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4198735.C1rpRVa8xf@wuerfel \
--to=arnd@arndb.de \
--cc=ai.kyuse.uw@renesas.com \
--cc=horms+renesas@verge.net.au \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox