Re: [PATCH v2 08/12] dmaengine: dw-edma-pcie: Add platform ops to match data
From: Frank Li
Date: Thu Jun 04 2026 - 16:42:56 EST
On Mon, May 25, 2026 at 03:24:16PM +0900, Koichiro Den wrote:
> Move the platform ops pointer into match data. Existing EDDA/MDB matches
> keep using dw_edma_pcie_plat_ops.
>
> No functional changes intended.
>
> Suggested-by: Frank Li <Frank.Li@xxxxxxx>
> Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> Changes in v2:
> - New patch. The original commit
> "dmaengine: dw-edma-pcie: Add raw slave address ops" is dropped
> per Frank's suggestion. DW_EDMA_PCIE_F_RAW_SLAVE_ADDR is no
> longer needed.
>
> drivers/dma/dw-edma/dw-edma-pcie.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index 9aed1005854d..1d63b07723f9 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
> @@ -77,6 +77,7 @@ struct dw_edma_pcie_data {
>
> struct dw_edma_pcie_match_data {
> const struct dw_edma_pcie_data *data;
> + const struct dw_edma_plat_ops *plat_ops;
> /*
> * Mandatory callback. It may leave @pdata unchanged when the static
> * template already describes the device.
> @@ -383,7 +384,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
> return -ENOMEM;
>
> /* Let device-specific discovery override the static template data. */
> - if (!match->parse_caps)
> + if (!match->parse_caps || !match->plat_ops)
> return -EINVAL;
>
> err = match->parse_caps(pdev, dma_data);
> @@ -435,7 +436,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
> chip->mf = dma_data->mf;
> chip->default_irq_mode = match->default_irq_mode;
> chip->nr_irqs = nr_irqs;
> - chip->ops = &dw_edma_pcie_plat_ops;
> + chip->ops = match->plat_ops;
> chip->cfg_non_ll = dma_data->cfg_non_ll;
>
> chip->ll_wr_cnt = dma_data->wr_ch_cnt;
> @@ -577,11 +578,13 @@ static void dw_edma_pcie_remove(struct pci_dev *pdev)
>
> static const struct dw_edma_pcie_match_data snps_edda_match_data = {
> .data = &snps_edda_data,
> + .plat_ops = &dw_edma_pcie_plat_ops,
> .parse_caps = dw_edma_pcie_parse_synopsys_caps,
> };
>
> static const struct dw_edma_pcie_match_data xilinx_mdb_match_data = {
> .data = &xilinx_mdb_data,
> + .plat_ops = &dw_edma_pcie_plat_ops,
> .parse_caps = dw_edma_pcie_parse_xilinx_caps,
> .flags = DW_EDMA_PCIE_F_DEVMEM_PHYS_OFF,
> };
> --
> 2.51.0
>