[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190527090553.lek7tm3lyst3bhrd@pengutronix.de>
Date: Mon, 27 May 2019 11:05:53 +0200
From: Sascha Hauer <s.hauer@...gutronix.de>
To: yibin.gong@....com
Cc: robh@...nel.org, shawnguo@...nel.org, festevam@...il.com,
mark.rutland@....com, vkoul@...nel.org, dan.j.williams@...el.com,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-imx@....com, kernel@...gutronix.de,
dmaengine@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 6/7] dmaengine: fsl-edma: add i.mx7ulp edma2 version
support
On Mon, May 27, 2019 at 04:51:17PM +0800, yibin.gong@....com wrote:
> From: Robin Gong <yibin.gong@....com>
>
> +static const struct of_device_id fsl_edma_dt_ids[] = {
> + { .compatible = "fsl,vf610-edma", .data = (void *)v1 },
> + { .compatible = "fsl,imx7ulp-edma", .data = (void *)v3 },
> + { /* sentinel */ }
Please put a struct type behind the .data pointer so that you can
configure...
> +};
> +MODULE_DEVICE_TABLE(of, fsl_edma_dt_ids);
> +
> @@ -218,6 +272,22 @@ static int fsl_edma_probe(struct platform_device *pdev)
> fsl_edma_setup_regs(fsl_edma);
> regs = &fsl_edma->regs;
>
> + if (fsl_edma->version == v3) {
> + fsl_edma->dmamux_nr = 1;
...things like this...
> @@ -264,7 +334,11 @@ static int fsl_edma_probe(struct platform_device *pdev)
> }
>
> edma_writel(fsl_edma, ~0, regs->intl);
> - ret = fsl_edma_irq_init(pdev, fsl_edma);
> +
> + if (fsl_edma->version == v3)
> + ret = fsl_edma2_irq_init(pdev, fsl_edma);
> + else
> + ret = fsl_edma_irq_init(pdev, fsl_edma);
...and this one in that struct rather than littering the code more and
more with such version tests.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists