Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ingenic: Use dmam_alloc_coherent()

Use dmam_alloc_coherent() instead of dma_alloc_coherent(). Then we don't
need to register a custom cleanup handler.

v3: New patch

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200716163846.174790-8-paul@crapouillou.net

+3 -15
+3 -15
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
··· 459 459 .atomic_commit = drm_atomic_helper_commit, 460 460 }; 461 461 462 - static void ingenic_drm_free_dma_hwdesc(void *d) 463 - { 464 - struct ingenic_drm *priv = d; 465 - 466 - dma_free_coherent(priv->dev, sizeof(*priv->dma_hwdesc), 467 - priv->dma_hwdesc, priv->dma_hwdesc_phys); 468 - } 469 - 470 462 static int ingenic_drm_probe(struct platform_device *pdev) 471 463 { 472 464 const struct jz_soc_info *soc_info; ··· 541 549 bridge = devm_drm_panel_bridge_add_typed(dev, panel, 542 550 DRM_MODE_CONNECTOR_DPI); 543 551 544 - priv->dma_hwdesc = dma_alloc_coherent(dev, sizeof(*priv->dma_hwdesc), 545 - &priv->dma_hwdesc_phys, 546 - GFP_KERNEL); 552 + priv->dma_hwdesc = dmam_alloc_coherent(dev, sizeof(*priv->dma_hwdesc), 553 + &priv->dma_hwdesc_phys, 554 + GFP_KERNEL); 547 555 if (!priv->dma_hwdesc) 548 556 return -ENOMEM; 549 - 550 - ret = devm_add_action_or_reset(dev, ingenic_drm_free_dma_hwdesc, priv); 551 - if (ret) 552 - return ret; 553 557 554 558 priv->dma_hwdesc->next = priv->dma_hwdesc_phys; 555 559 priv->dma_hwdesc->id = 0xdeafbead;