[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200716163846.174790-8-paul@crapouillou.net>
Date: Thu, 16 Jul 2020 18:38:42 +0200
From: Paul Cercueil <paul@...pouillou.net>
To: David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>
Cc: Sam Ravnborg <sam@...nborg.org>, od@...c.me,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Paul Cercueil <paul@...pouillou.net>
Subject: [PATCH v3 08/12] 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@...pouillou.net>
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index d9cd74d70a61..9cc785776594 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -459,14 +459,6 @@ static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-static void ingenic_drm_free_dma_hwdesc(void *d)
-{
- struct ingenic_drm *priv = d;
-
- dma_free_coherent(priv->dev, sizeof(*priv->dma_hwdesc),
- priv->dma_hwdesc, priv->dma_hwdesc_phys);
-}
-
static int ingenic_drm_probe(struct platform_device *pdev)
{
const struct jz_soc_info *soc_info;
@@ -549,16 +541,12 @@ static int ingenic_drm_probe(struct platform_device *pdev)
bridge = devm_drm_panel_bridge_add_typed(dev, panel,
DRM_MODE_CONNECTOR_DPI);
- priv->dma_hwdesc = dma_alloc_coherent(dev, sizeof(*priv->dma_hwdesc),
- &priv->dma_hwdesc_phys,
- GFP_KERNEL);
+ priv->dma_hwdesc = dmam_alloc_coherent(dev, sizeof(*priv->dma_hwdesc),
+ &priv->dma_hwdesc_phys,
+ GFP_KERNEL);
if (!priv->dma_hwdesc)
return -ENOMEM;
- ret = devm_add_action_or_reset(dev, ingenic_drm_free_dma_hwdesc, priv);
- if (ret)
- return ret;
-
priv->dma_hwdesc->next = priv->dma_hwdesc_phys;
priv->dma_hwdesc->id = 0xdeafbead;
--
2.27.0
Powered by blists - more mailing lists