Re: [PATCH/RFC v2 5/5] mmc: renesas_sdhi: add support for R-Car Gen3 SDHI DMAC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux