* [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 10:28 ` Vaishali Thakkar
0 siblings, 0 replies; 22+ messages in thread
From: Vaishali Thakkar @ 2018-04-26 10:28 UTC (permalink / raw)
To: alexander.deucher
Cc: christian.koenig, David1.Zhou, airlied, brodkin, linux,
boris.brezillon, nicolas.ferre, alexandre.belloni, gustavo,
maarten.lankhorst, seanpaul, l.stach, christian.gmeiner,
inki.dae, jy0922.shim, sw0312.kim, kyungmin.park, kgene, krzk,
stefan, alison.wang, z.liuxinliang, zourongrong, kong.kongxinwei,
puck.chen, jani.nikula, joonas.lahtinen, rodrigo.vivi, p.zabel,
ck.hu, matthias.bgg, robdclark, marex, bskeggs, tomi.valkeinen,
eric, airlied, kraxel, laurent.pinchart, hjc, heiko,
benjamin.gaignard, vincent.abriou, yannick.fertre,
philippe.cornu, maxime.ripard, wens, thierry.reding, jonathanh,
noralf, linus.walleij, shawnguo, amd-gfx, dri-devel,
linux-kernel, linux-arm-kernel, etnaviv, linux-samsung-soc,
intel-gfx, linux-mediatek, linux-arm-msm, freedreno, nouveau,
virtualization, linux-renesas-soc, linux-rockchip, linux-tegra,
Vaishali Thakkar
It's been a while since we introduced drm_dev{get/put} functions
to replace reference/unreference in drm subsystem for the
consistency purpose. So, with this patch, let's just replace
all current use cases of drm_dev_unref() with drm_dev_put and remove
the function itself.
Coccinelle was used for mass-patching.
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
drivers/gpu/drm/armada/armada_drv.c | 6 +++---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
drivers/gpu/drm/drm_drv.c | 13 -------------
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
drivers/gpu/drm/stm/drv.c | 4 ++--
drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
drivers/gpu/drm/tegra/drm.c | 4 ++--
drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
drivers/gpu/drm/udl/udl_drv.c | 2 +-
drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
include/drm/drm_drv.h | 1 -
41 files changed, 73 insertions(+), 87 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0b19482b36b8..5fb455febeba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
err_pci:
pci_disable_device(pdev);
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return ret;
}
@@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
drm_dev_unregister(dev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..dcb06d4e9135 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
arcpgu_unload(drm);
err_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
arcpgu_unload(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 4b11b6b52f1d..d1705d298a39 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev)
/*
* The drm_device structure must be at the start of
- * armada_private for drm_dev_unref() to work correctly.
+ * armada_private for drm_dev_put() to work correctly.
*/
BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
@@ -180,7 +180,7 @@ static int armada_drm_bind(struct device *dev)
drm_mode_config_cleanup(&priv->drm);
drm_mm_takedown(&priv->linear);
flush_work(&priv->fb_unref_work);
- drm_dev_unref(&priv->drm);
+ drm_dev_put(&priv->drm);
return ret;
}
@@ -200,7 +200,7 @@ static void armada_drm_unbind(struct device *dev)
drm_mm_takedown(&priv->linear);
flush_work(&priv->fb_unref_work);
- drm_dev_unref(&priv->drm);
+ drm_dev_put(&priv->drm);
}
static int compare_of(struct device *dev, void *data)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index c1ea5c36b006..1c8487803a70 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -774,7 +774,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
atmel_hlcdc_dc_unload(ddev);
err_unref:
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return ret;
}
@@ -785,7 +785,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
drm_dev_unregister(ddev);
atmel_hlcdc_dc_unload(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return 0;
}
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a1b9338736e3..3dc507b13cf2 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -656,19 +656,6 @@ void drm_dev_put(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_dev_put);
-/**
- * drm_dev_unref - Drop reference of a DRM device
- * @dev: device to drop reference of or NULL
- *
- * This is a compatibility alias for drm_dev_put() and should not be used by new
- * code.
- */
-void drm_dev_unref(struct drm_device *dev)
-{
- drm_dev_put(dev);
-}
-EXPORT_SYMBOL(drm_dev_unref);
-
static int create_compat_control_link(struct drm_device *dev)
{
struct drm_minor *minor;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index ab50090d066c..716187a07227 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -613,7 +613,7 @@ static int etnaviv_bind(struct device *dev)
out_bind:
kfree(priv);
out_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -630,7 +630,7 @@ static void etnaviv_unbind(struct device *dev)
drm->dev_private = NULL;
kfree(priv);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops etnaviv_master_ops = {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index a518e9c6d6cc..3629e5c93e3a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -411,7 +411,7 @@ static int exynos_drm_bind(struct device *dev)
err_free_private:
kfree(private);
err_free_drm:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -435,7 +435,7 @@ static void exynos_drm_unbind(struct device *dev)
drm->dev_private = NULL;
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops exynos_drm_ops = {
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 80232321a244..664ac9dc1f65 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -358,7 +358,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
return 0;
unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
unregister_pix_clk:
clk_unregister(fsl_dev->pix_clk);
disable_clk:
@@ -371,7 +371,7 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);
drm_dev_unregister(fsl_dev->drm);
- drm_dev_unref(fsl_dev->drm);
+ drm_dev_put(fsl_dev->drm);
clk_disable_unprepare(fsl_dev->clk);
clk_unregister(fsl_dev->pix_clk);
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index d4f6f1f9df5b..ec878c7e3f75 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -387,7 +387,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
err_disable:
pci_disable_device(pdev);
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return ret;
}
@@ -398,7 +398,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
drm_dev_unregister(dev);
hibmc_unload(dev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
}
static struct pci_device_id hibmc_pci_table[] = {
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index ddb0403f1975..e6a62d5a00a3 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -193,7 +193,7 @@ static int kirin_drm_bind(struct device *dev)
ret = kirin_drm_kms_init(drm_dev);
if (ret)
- goto err_drm_dev_unref;
+ goto err_drm_dev_put;
ret = drm_dev_register(drm_dev, 0);
if (ret)
@@ -203,8 +203,8 @@ static int kirin_drm_bind(struct device *dev)
err_kms_cleanup:
kirin_drm_kms_cleanup(drm_dev);
-err_drm_dev_unref:
- drm_dev_unref(drm_dev);
+err_drm_dev_put:
+ drm_dev_put(drm_dev);
return ret;
}
@@ -215,7 +215,7 @@ static void kirin_drm_unbind(struct device *dev)
drm_dev_unregister(drm_dev);
kirin_drm_kms_cleanup(drm_dev);
- drm_dev_unref(drm_dev);
+ drm_dev_put(drm_dev);
}
static const struct component_master_ops kirin_drm_ops = {
diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
index 05bbef363fff..22de60920b1a 100644
--- a/drivers/gpu/drm/i915/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
@@ -1720,7 +1720,7 @@ int i915_gem_huge_page_mock_selftests(void)
i915_modparams.enable_ppgtt = saved_ppgtt;
- drm_dev_unref(&dev_priv->drm);
+ drm_dev_put(&dev_priv->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
index 89dc25a5a53b..a7055b12e53c 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
@@ -389,7 +389,7 @@ int i915_gem_dmabuf_mock_selftests(void)
err = i915_subtests(tests, i915);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index ab9d7bee0aae..7b21e4135aa5 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -490,7 +490,7 @@ int i915_gem_evict_mock_selftests(void)
err = i915_subtests(tests, i915);
mutex_unlock(&i915->drm.struct_mutex);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index f7dc926f4ef1..1cf4e9af0b65 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -1646,7 +1646,7 @@ int i915_gem_gtt_mock_selftests(void)
err = i915_subtests(tests, i915);
mutex_unlock(&i915->drm.struct_mutex);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
index fbdb2419d418..7066f22ef8f1 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
@@ -586,7 +586,7 @@ int i915_gem_object_mock_selftests(void)
err = i915_subtests(tests, i915);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index 94bc2e1898a4..5d069de4a19a 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -262,7 +262,7 @@ int i915_request_mock_selftests(void)
return -ENOMEM;
err = i915_subtests(tests, i915);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
index eb89e301b602..9fbba5defb3e 100644
--- a/drivers/gpu/drm/i915/selftests/i915_vma.c
+++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
@@ -734,7 +734,7 @@ int i915_vma_mock_selftests(void)
err = i915_subtests(tests, i915);
mutex_unlock(&i915->drm.struct_mutex);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
index 46580026c7fc..b6c9deeeda7b 100644
--- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
@@ -463,7 +463,7 @@ int intel_breadcrumbs_mock_selftests(void)
return -ENOMEM;
err = i915_subtests(tests, i915->engine[RCS]);
- drm_dev_unref(&i915->drm);
+ drm_dev_put(&i915->drm);
return err;
}
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 1d053bbefc02..27f54cbee7fb 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -307,7 +307,7 @@ static int imx_drm_bind(struct device *dev)
err_kms:
drm_mode_config_cleanup(drm);
err_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -327,7 +327,7 @@ static void imx_drm_unbind(struct device *dev)
component_unbind_all(drm->dev, drm);
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops imx_drm_ops = {
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index a2ca90fc403c..5d024a154e1a 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -341,7 +341,7 @@ static int mtk_drm_bind(struct device *dev)
err_deinit:
mtk_drm_kms_deinit(drm);
err_free:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -350,7 +350,7 @@ static void mtk_drm_unbind(struct device *dev)
struct mtk_drm_private *private = dev_get_drvdata(dev);
drm_dev_unregister(private->drm);
- drm_dev_unref(private->drm);
+ drm_dev_put(private->drm);
private->drm = NULL;
}
@@ -504,7 +504,7 @@ static int mtk_drm_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
mtk_drm_kms_deinit(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
component_master_del(&pdev->dev, &mtk_drm_ops);
pm_runtime_disable(&pdev->dev);
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 30cd514d8f7c..558a82f828b8 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -260,7 +260,7 @@ static int msm_drm_uninit(struct device *dev)
msm_mdss_destroy(ddev);
ddev->dev_private = NULL;
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
kfree(priv);
@@ -368,7 +368,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return -ENOMEM;
}
@@ -378,7 +378,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
ret = msm_mdss_init(ddev);
if (ret) {
kfree(priv);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return ret;
}
@@ -398,7 +398,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
if (ret) {
msm_mdss_destroy(ddev);
kfree(priv);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return ret;
}
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 5cae8db9dcd4..1ca9bafcd4f2 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -403,7 +403,7 @@ static int mxsfb_probe(struct platform_device *pdev)
err_unload:
mxsfb_unload(drm);
err_free:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -414,7 +414,7 @@ static int mxsfb_remove(struct platform_device *pdev)
drm_dev_unregister(drm);
mxsfb_unload(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
index 1ada186fab77..039e23548e08 100644
--- a/drivers/gpu/drm/nouveau/nouveau_platform.c
+++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
@@ -36,7 +36,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
ret = drm_dev_register(drm, 0);
if (ret < 0) {
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 3632854c2b91..e12cedc15e27 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -598,7 +598,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
omap_drm_irq_uninstall(ddev);
err_free_drm_dev:
omap_gem_deinit(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
err_destroy_wq:
destroy_workqueue(priv->wq);
omap_disconnect_dssdevs();
@@ -627,7 +627,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
omap_drm_irq_uninstall(ddev);
omap_gem_deinit(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
destroy_workqueue(priv->wq);
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 4621259d5387..6e21308dd6c6 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -304,7 +304,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
return 0;
dev_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -318,7 +318,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
if (priv->panel)
drm_panel_bridge_remove(priv->bridge);
drm_mode_config_cleanup(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
index 2445e75cf7ea..86bd42dca09c 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.c
+++ b/drivers/gpu/drm/qxl/qxl_drv.c
@@ -119,7 +119,7 @@ qxl_pci_remove(struct pci_dev *pdev)
dev->dev_private = NULL;
kfree(qdev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
}
static const struct file_operations qxl_fops = {
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 3917d839c04c..1adcf80912e1 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -378,7 +378,7 @@ static int rcar_du_remove(struct platform_device *pdev)
drm_kms_helper_poll_fini(ddev);
drm_mode_config_cleanup(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return 0;
}
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index f814d37b1db2..9c846be8fc64 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -184,7 +184,7 @@ static int rockchip_drm_bind(struct device *dev)
err_free:
drm_dev->dev_private = NULL;
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm_dev);
+ drm_dev_put(drm_dev);
return ret;
}
@@ -204,7 +204,7 @@ static void rockchip_drm_unbind(struct device *dev)
drm_dev->dev_private = NULL;
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm_dev);
+ drm_dev_put(drm_dev);
}
static const struct file_operations rockchip_drm_driver_fops = {
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 592572554eb0..8d1ff596c774 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -198,7 +198,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
drm_kms_helper_poll_fini(ddev);
drm_mode_config_cleanup(ddev);
drm_irq_uninstall(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return 0;
}
@@ -294,7 +294,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
drm_kms_helper_poll_fini(ddev);
drm_mode_config_cleanup(ddev);
err_free_drm_dev:
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return ret;
}
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 55b6967d27e1..e8d6199878ce 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -242,7 +242,7 @@ static int sti_bind(struct device *dev)
ret = sti_init(ddev);
if (ret)
- goto err_drm_dev_unref;
+ goto err_drm_dev_put;
ret = component_bind_all(ddev->dev, ddev);
if (ret)
@@ -266,8 +266,8 @@ static int sti_bind(struct device *dev)
drm_mode_config_cleanup(ddev);
err_cleanup:
sti_cleanup(ddev);
-err_drm_dev_unref:
- drm_dev_unref(ddev);
+err_drm_dev_put:
+ drm_dev_put(ddev);
return ret;
}
@@ -277,7 +277,7 @@ static void sti_unbind(struct device *dev)
drm_dev_unregister(ddev);
sti_cleanup(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
}
static const struct component_master_ops sti_ops = {
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 9ab00a87f7cc..6ece3acabd56 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -159,7 +159,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
return 0;
err_unref:
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return ret;
}
@@ -172,7 +172,7 @@ static int stm_drm_platform_remove(struct platform_device *pdev)
drm_dev_unregister(ddev);
drv_unload(ddev);
- drm_dev_unref(ddev);
+ drm_dev_put(ddev);
return 0;
}
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 50d19605c38f..42c881d5275d 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -143,7 +143,7 @@ static int sun4i_drv_bind(struct device *dev)
drm_mode_config_cleanup(drm);
of_reserved_mem_device_release(dev);
free_drm:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -156,7 +156,7 @@ static void sun4i_drv_unbind(struct device *dev)
sun4i_framebuffer_free(drm);
drm_mode_config_cleanup(drm);
of_reserved_mem_device_release(dev);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops sun4i_drv_master_ops = {
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 7afe2f635f74..f5119f2bbf5f 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1210,7 +1210,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
return 0;
unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return err;
}
@@ -1219,7 +1219,7 @@ static int host1x_drm_remove(struct host1x_device *dev)
struct drm_device *drm = dev_get_drvdata(&dev->dev);
drm_dev_unregister(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
index 4c6616278c48..ca2b6a8b74c2 100644
--- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
+++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
@@ -135,7 +135,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
/*
* We don't embed drm_device, because that prevent us from using
* devm_kzalloc() to allocate tinydrm_device in the driver since
- * drm_dev_unref() frees the structure. The devm_ functions provide
+ * drm_dev_put() frees the structure. The devm_ functions provide
* for easy error handling.
*/
drm = drm_dev_alloc(driver, parent);
@@ -155,7 +155,7 @@ static void tinydrm_fini(struct tinydrm_device *tdev)
drm_mode_config_cleanup(tdev->drm);
mutex_destroy(&tdev->dirty_lock);
tdev->drm->dev_private = NULL;
- drm_dev_unref(tdev->drm);
+ drm_dev_put(tdev->drm);
}
static void devm_tinydrm_release(void *data)
@@ -172,7 +172,7 @@ static void devm_tinydrm_release(void *data)
*
* This function initializes @tdev, the underlying DRM device and it's
* mode_config. Resources will be automatically freed on driver detach (devres)
- * using drm_mode_config_cleanup() and drm_dev_unref().
+ * using drm_mode_config_cleanup() and drm_dev_put().
*
* Returns:
* Zero on success, negative error code on failure.
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index ac344ddb23bc..e36a78ef68b7 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -250,7 +250,7 @@ static int tve200_probe(struct platform_device *pdev)
clk_disable:
clk_disable_unprepare(priv->pclk);
dev_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -265,7 +265,7 @@ static int tve200_remove(struct platform_device *pdev)
drm_panel_bridge_remove(priv->bridge);
drm_mode_config_cleanup(drm);
clk_disable_unprepare(priv->pclk);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return 0;
}
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 3c45a3064726..d5e94eb7a4ca 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -94,7 +94,7 @@ static int udl_usb_probe(struct usb_interface *interface,
return 0;
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return r;
}
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 94b99c90425a..259c85fcd32c 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -312,7 +312,7 @@ static int vc4_drm_bind(struct device *dev)
vc4_gem_destroy(drm);
vc4_bo_cache_destroy(drm);
dev_unref:
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -327,7 +327,7 @@ static void vc4_drm_unbind(struct device *dev)
drm_mode_config_cleanup(drm);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops vc4_drm_ops = {
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 2524ff116f00..305f87665499 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -505,7 +505,7 @@ static int __init vgem_init(void)
static void __exit vgem_exit(void)
{
drm_dev_unregister(&vgem_device->drm);
- drm_dev_unref(&vgem_device->drm);
+ drm_dev_put(&vgem_device->drm);
}
module_init(vgem_init);
diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
index 7df8d0c9026a..094b876f6da6 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
@@ -85,6 +85,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
return 0;
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return ret;
}
diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index 6f4205e80378..02ae1caf6e8a 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -122,7 +122,7 @@ static int zx_drm_bind(struct device *dev)
component_unbind_all(dev, drm);
out_unregister:
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
return ret;
}
@@ -136,7 +136,7 @@ static void zx_drm_unbind(struct device *dev)
drm_mode_config_cleanup(drm);
component_unbind_all(dev, drm);
dev_set_drvdata(dev, NULL);
- drm_dev_unref(drm);
+ drm_dev_put(drm);
}
static const struct component_master_ops zx_drm_master_ops = {
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index d23dcdd1bd95..c16dd4424b8a 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -622,7 +622,6 @@ void drm_dev_unregister(struct drm_device *dev);
void drm_dev_get(struct drm_device *dev);
void drm_dev_put(struct drm_device *dev);
-void drm_dev_unref(struct drm_device *dev);
void drm_put_dev(struct drm_device *dev);
void drm_dev_unplug(struct drm_device *dev);
--
2.14.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
(?)
@ 2018-04-26 10:43 ` Laurent Pinchart
-1 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2018-04-26 10:43 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: linux-renesas-soc, alexandre.belloni, heiko, airlied, gustavo,
linus.walleij, joonas.lahtinen, stefan, hjc, eric,
thierry.reding, nouveau, freedreno, marex, David1.Zhou,
linux-samsung-soc, jy0922.shim, linux-rockchip, tomi.valkeinen,
linux, krzk, jonathanh, z.liuxinliang, maxime.ripard,
kong.kongxinwei, kgene, bskeggs, linux-arm-msm, ck.hu, airlied,
virtualization, robdclark, linux-tegra, puck.chen, intel-gfx
Hi Vaishali,
Thank you for the patch.
On Thursday, 26 April 2018 13:28:19 EEST Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
I love seeing deprecated functions go.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
@ 2018-04-26 10:43 ` Laurent Pinchart
-1 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2018-04-26 10:43 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: linux-renesas-soc, alexandre.belloni, airlied, thierry.reding,
kraxel, nouveau, marex, linux-samsung-soc, linux-rockchip,
tomi.valkeinen, linux, krzk, jonathanh, z.liuxinliang,
maxime.ripard, kong.kongxinwei, kgene, bskeggs, linux-arm-msm,
airlied, virtualization, freedreno, linux-tegra, puck.chen,
intel-gfx, etnaviv, brodkin, boris.brezillon, zourongrong,
rodrigo.vivi, matthias.bgg, org, wens, vincent.abriou
Hi Vaishali,
Thank you for the patch.
On Thursday, 26 April 2018 13:28:19 EEST Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
I love seeing deprecated functions go.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 10:43 ` Laurent Pinchart
0 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2018-04-26 10:43 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexander.deucher, christian.koenig, David1.Zhou, airlied,
brodkin, linux, boris.brezillon, nicolas.ferre,
alexandre.belloni, gustavo, maarten.lankhorst, seanpaul, l.stach,
christian.gmeiner, inki.dae, jy0922.shim, sw0312.kim,
kyungmin.park, kgene, krzk, stefan, alison.wang, z.liuxinliang,
zourongrong, kong.kongxinwei, puck.chen, jani.nikula,
joonas.lahtinen, rodrigo.vivi, p.zabel, ck.hu, matthias.bgg,
robdclark, marex, bskeggs, tomi.valkeinen, eric, airlied, kraxel,
hjc, heiko, benjamin.gaignard, vincent.abriou, yannick.fertre,
philippe.cornu, maxime.ripard, wens, thierry.reding, jonathanh,
noralf, linus.walleij, shawnguo, amd-gfx, dri-devel,
linux-kernel, linux-arm-kernel, etnaviv, linux-samsung-soc,
intel-gfx, linux-mediatek, linux-arm-msm, freedreno, nouveau,
virtualization, linux-renesas-soc, linux-rockchip, linux-tegra
Hi Vaishali,
Thank you for the patch.
On Thursday, 26 April 2018 13:28:19 EEST Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
I love seeing deprecated functions go.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 22+ messages in thread
* ✗ Fi.CI.BAT: failure for drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
` (2 preceding siblings ...)
(?)
@ 2018-04-26 11:57 ` Patchwork
-1 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2018-04-26 11:57 UTC (permalink / raw)
To: Vaishali Thakkar; +Cc: intel-gfx
== Series Details ==
Series: drm/core: Remove drm_dev_unref() and it's uses
URL : https://patchwork.freedesktop.org/series/42325/
State : failure
== Summary ==
Applying: drm/core: Remove drm_dev_unref() and it's uses
error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M drivers/gpu/drm/drm_drv.c
M drivers/gpu/drm/exynos/exynos_drm_drv.c
M drivers/gpu/drm/mxsfb/mxsfb_drv.c
M drivers/gpu/drm/omapdrm/omap_drv.c
M drivers/gpu/drm/sti/sti_drv.c
M drivers/gpu/drm/stm/drv.c
M drivers/gpu/drm/tegra/drm.c
M drivers/gpu/drm/tinydrm/core/tinydrm-core.c
M drivers/gpu/drm/udl/udl_drv.c
M drivers/gpu/drm/vc4/vc4_drv.c
M include/drm/drm_drv.h
Falling back to patching base and 3-way merge...
Auto-merging include/drm/drm_drv.h
Auto-merging drivers/gpu/drm/vc4/vc4_drv.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/vc4/vc4_drv.c
Auto-merging drivers/gpu/drm/udl/udl_drv.c
Auto-merging drivers/gpu/drm/tinydrm/core/tinydrm-core.c
Auto-merging drivers/gpu/drm/tegra/drm.c
Auto-merging drivers/gpu/drm/stm/drv.c
Auto-merging drivers/gpu/drm/sti/sti_drv.c
Auto-merging drivers/gpu/drm/omapdrm/omap_drv.c
Auto-merging drivers/gpu/drm/mxsfb/mxsfb_drv.c
Auto-merging drivers/gpu/drm/exynos/exynos_drm_drv.c
Auto-merging drivers/gpu/drm/drm_drv.c
Patch failed at 0001 drm/core: Remove drm_dev_unref() and it's uses
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
@ 2018-04-26 12:06 ` Thierry Reding
-1 siblings, 0 replies; 22+ messages in thread
From: Thierry Reding @ 2018-04-26 12:06 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: linux-renesas-soc, alexandre.belloni, airlied, kraxel, nouveau,
marex, linux-samsung-soc, linux-rockchip, tomi.valkeinen, linux,
krzk, jonathanh, z.liuxinliang, maxime.ripard, kong.kongxinwei,
kgene, bskeggs, linux-arm-msm, airlied, virtualization,
linux-tegra, puck.chen, intel-gfx, etnaviv, brodkin,
boris.brezillon, zourongrong, rodrigo.vivi, matthias.bgg, wens,
vincent.abriou, linux-arm-kernel, amd-gfx, laurent.pin
[-- Attachment #1.1: Type: text/plain, Size: 531 bytes --]
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Yes, please.
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 12:06 ` Thierry Reding
0 siblings, 0 replies; 22+ messages in thread
From: Thierry Reding @ 2018-04-26 12:06 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexander.deucher, christian.koenig, David1.Zhou, airlied,
brodkin, linux, boris.brezillon, nicolas.ferre,
alexandre.belloni, gustavo, maarten.lankhorst, seanpaul, l.stach,
christian.gmeiner, inki.dae, jy0922.shim, sw0312.kim,
kyungmin.park, kgene, krzk, stefan, alison.wang, z.liuxinliang,
zourongrong, kong.kongxinwei, puck.chen, jani.nikula,
joonas.lahtinen, rodrigo.vivi, p.zabel, ck.hu, matthias.bgg,
robdclark, marex, bskeggs, tomi.valkeinen, eric, airlied, kraxel,
laurent.pinchart, hjc, heiko, benjamin.gaignard, vincent.abriou,
yannick.fertre, philippe.cornu, maxime.ripard, wens, jonathanh,
noralf, linus.walleij, shawnguo, amd-gfx, dri-devel,
linux-kernel, linux-arm-kernel, etnaviv, linux-samsung-soc,
intel-gfx, linux-mediatek, linux-arm-msm, freedreno, nouveau,
virtualization, linux-renesas-soc, linux-rockchip, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Yes, please.
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
` (4 preceding siblings ...)
(?)
@ 2018-04-26 12:06 ` Thierry Reding
-1 siblings, 0 replies; 22+ messages in thread
From: Thierry Reding @ 2018-04-26 12:06 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: linux-renesas-soc, alexandre.belloni, heiko, airlied, gustavo,
linus.walleij, joonas.lahtinen, stefan, hjc, eric,
benjamin.gaignard, nouveau, marex, David1.Zhou,
linux-samsung-soc, jy0922.shim, linux-rockchip, tomi.valkeinen,
linux, krzk, jonathanh, z.liuxinliang, maxime.ripard,
kong.kongxinwei, kgene, bskeggs, linux-arm-msm, ck.hu, airlied,
virtualization, robdclark, linux-tegra, puck.chen, intel-gfx,
maarten.lankhorst
[-- Attachment #1.1: Type: text/plain, Size: 531 bytes --]
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Yes, please.
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
@ 2018-04-26 12:15 ` Boris Brezillon
-1 siblings, 0 replies; 22+ messages in thread
From: Boris Brezillon @ 2018-04-26 12:15 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: linux-renesas-soc, alexandre.belloni, heiko, airlied,
linus.walleij, stefan, hjc, kraxel, benjamin.gaignard, nouveau,
marex, David1.Zhou, linux-samsung-soc, jy0922.shim,
linux-rockchip, tomi.valkeinen, linux, krzk, jonathanh,
z.liuxinliang, maxime.ripard, kong.kongxinwei, kgene, bskeggs,
linux-arm-msm, ck.hu, airlied, virtualization, linux-tegra,
puck.chen, intel-gfx, etnaviv, brodkin, zourongrong, dri-devel
On Thu, 26 Apr 2018 15:58:19 +0530
Vaishali Thakkar <vthakkar1994@gmail.com> wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
For atmel-hlcdc:
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 12:15 ` Boris Brezillon
0 siblings, 0 replies; 22+ messages in thread
From: Boris Brezillon @ 2018-04-26 12:15 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexander.deucher, christian.koenig, David1.Zhou, airlied,
brodkin, linux, nicolas.ferre, alexandre.belloni, gustavo,
maarten.lankhorst, seanpaul, l.stach, christian.gmeiner,
inki.dae, jy0922.shim, sw0312.kim, kyungmin.park, kgene, krzk,
stefan, alison.wang, z.liuxinliang, zourongrong, kong.kongxinwei,
puck.chen, jani.nikula, joonas.lahtinen, rodrigo.vivi, p.zabel,
ck.hu, matthias.bgg, robdclark, marex, bskeggs, tomi.valkeinen,
eric, airlied, kraxel, laurent.pinchart, hjc, heiko,
benjamin.gaignard, vincent.abriou, yannick.fertre,
philippe.cornu, maxime.ripard, wens, thierry.reding, jonathanh,
noralf, linus.walleij, shawnguo, amd-gfx, dri-devel,
linux-kernel, linux-arm-kernel, etnaviv, linux-samsung-soc,
intel-gfx, linux-mediatek, linux-arm-msm, freedreno, nouveau,
virtualization, linux-renesas-soc, linux-rockchip, linux-tegra
On Thu, 26 Apr 2018 15:58:19 +0530
Vaishali Thakkar <vthakkar1994@gmail.com> wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
For atmel-hlcdc:
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
` (6 preceding siblings ...)
(?)
@ 2018-04-26 12:36 ` Daniel Vetter
-1 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-26 12:36 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexandre.belloni, heiko, airlied, nouveau, linus.walleij,
stefan, virtualization, matthias.bgg, benjamin.gaignard, marex,
David1.Zhou, maxime.ripard, linux-samsung-soc, jy0922.shim,
linux, krzk, jonathanh, z.liuxinliang, linux-rockchip,
kong.kongxinwei, tomi.valkeinen, bskeggs, puck.chen, ck.hu,
airlied, linux-arm-msm, intel-gfx, nicolas.ferre, etnaviv,
brodkin, zourongrong, linux-mediatek, dri-devel, rodrigo.vivi
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Thanks for doing this. Unfortunately drm moves pretty fast, so already a
conflict when I tried to apply this. Some drivers are also in their own
trees, so this might lead to more fun :-/
Can you pls split it up per-driver (just the directories under
drivers/gpu/drm/ is enough)? Final patch to remove the function might then
get stalled a bit ofc.
Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
remove that spatch hunk in the final patch, since we no longer need it?
Thanks, Daniel
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 0b19482b36b8..5fb455febeba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> err_pci:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
>
> @@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> struct drm_device *dev = pci_get_drvdata(pdev);
>
> drm_dev_unregister(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> pci_disable_device(pdev);
> pci_set_drvdata(pdev, NULL);
> }
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
> arcpgu_unload(drm);
>
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> arcpgu_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 4b11b6b52f1d..d1705d298a39 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev)
>
> /*
> * The drm_device structure must be at the start of
> - * armada_private for drm_dev_unref() to work correctly.
> + * armada_private for drm_dev_put() to work correctly.
> */
> BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
>
> @@ -180,7 +180,7 @@ static int armada_drm_bind(struct device *dev)
> drm_mode_config_cleanup(&priv->drm);
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> return ret;
> }
>
> @@ -200,7 +200,7 @@ static void armada_drm_unbind(struct device *dev)
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
>
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> }
>
> static int compare_of(struct device *dev, void *data)
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index c1ea5c36b006..1c8487803a70 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -774,7 +774,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
> atmel_hlcdc_dc_unload(ddev);
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -785,7 +785,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> atmel_hlcdc_dc_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index a1b9338736e3..3dc507b13cf2 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -656,19 +656,6 @@ void drm_dev_put(struct drm_device *dev)
> }
> EXPORT_SYMBOL(drm_dev_put);
>
> -/**
> - * drm_dev_unref - Drop reference of a DRM device
> - * @dev: device to drop reference of or NULL
> - *
> - * This is a compatibility alias for drm_dev_put() and should not be used by new
> - * code.
> - */
> -void drm_dev_unref(struct drm_device *dev)
> -{
> - drm_dev_put(dev);
> -}
> -EXPORT_SYMBOL(drm_dev_unref);
> -
> static int create_compat_control_link(struct drm_device *dev)
> {
> struct drm_minor *minor;
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index ab50090d066c..716187a07227 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -613,7 +613,7 @@ static int etnaviv_bind(struct device *dev)
> out_bind:
> kfree(priv);
> out_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -630,7 +630,7 @@ static void etnaviv_unbind(struct device *dev)
> drm->dev_private = NULL;
> kfree(priv);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops etnaviv_master_ops = {
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index a518e9c6d6cc..3629e5c93e3a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -411,7 +411,7 @@ static int exynos_drm_bind(struct device *dev)
> err_free_private:
> kfree(private);
> err_free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -435,7 +435,7 @@ static void exynos_drm_unbind(struct device *dev)
> drm->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops exynos_drm_ops = {
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 80232321a244..664ac9dc1f65 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -358,7 +358,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> unregister_pix_clk:
> clk_unregister(fsl_dev->pix_clk);
> disable_clk:
> @@ -371,7 +371,7 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
> struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);
>
> drm_dev_unregister(fsl_dev->drm);
> - drm_dev_unref(fsl_dev->drm);
> + drm_dev_put(fsl_dev->drm);
> clk_disable_unprepare(fsl_dev->clk);
> clk_unregister(fsl_dev->pix_clk);
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index d4f6f1f9df5b..ec878c7e3f75 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -387,7 +387,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
> err_disable:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
>
> return ret;
> }
> @@ -398,7 +398,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
>
> drm_dev_unregister(dev);
> hibmc_unload(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static struct pci_device_id hibmc_pci_table[] = {
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index ddb0403f1975..e6a62d5a00a3 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -193,7 +193,7 @@ static int kirin_drm_bind(struct device *dev)
>
> ret = kirin_drm_kms_init(drm_dev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = drm_dev_register(drm_dev, 0);
> if (ret)
> @@ -203,8 +203,8 @@ static int kirin_drm_bind(struct device *dev)
>
> err_kms_cleanup:
> kirin_drm_kms_cleanup(drm_dev);
> -err_drm_dev_unref:
> - drm_dev_unref(drm_dev);
> +err_drm_dev_put:
> + drm_dev_put(drm_dev);
>
> return ret;
> }
> @@ -215,7 +215,7 @@ static void kirin_drm_unbind(struct device *dev)
>
> drm_dev_unregister(drm_dev);
> kirin_drm_kms_cleanup(drm_dev);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct component_master_ops kirin_drm_ops = {
> diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
> index 05bbef363fff..22de60920b1a 100644
> --- a/drivers/gpu/drm/i915/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
> @@ -1720,7 +1720,7 @@ int i915_gem_huge_page_mock_selftests(void)
>
> i915_modparams.enable_ppgtt = saved_ppgtt;
>
> - drm_dev_unref(&dev_priv->drm);
> + drm_dev_put(&dev_priv->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> index 89dc25a5a53b..a7055b12e53c 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> @@ -389,7 +389,7 @@ int i915_gem_dmabuf_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> index ab9d7bee0aae..7b21e4135aa5 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> @@ -490,7 +490,7 @@ int i915_gem_evict_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index f7dc926f4ef1..1cf4e9af0b65 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -1646,7 +1646,7 @@ int i915_gem_gtt_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> index fbdb2419d418..7066f22ef8f1 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> @@ -586,7 +586,7 @@ int i915_gem_object_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index 94bc2e1898a4..5d069de4a19a 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -262,7 +262,7 @@ int i915_request_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
> index eb89e301b602..9fbba5defb3e 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_vma.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
> @@ -734,7 +734,7 @@ int i915_vma_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> index 46580026c7fc..b6c9deeeda7b 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> @@ -463,7 +463,7 @@ int intel_breadcrumbs_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915->engine[RCS]);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 1d053bbefc02..27f54cbee7fb 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -307,7 +307,7 @@ static int imx_drm_bind(struct device *dev)
> err_kms:
> drm_mode_config_cleanup(drm);
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -327,7 +327,7 @@ static void imx_drm_unbind(struct device *dev)
> component_unbind_all(drm->dev, drm);
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops imx_drm_ops = {
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index a2ca90fc403c..5d024a154e1a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -341,7 +341,7 @@ static int mtk_drm_bind(struct device *dev)
> err_deinit:
> mtk_drm_kms_deinit(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -350,7 +350,7 @@ static void mtk_drm_unbind(struct device *dev)
> struct mtk_drm_private *private = dev_get_drvdata(dev);
>
> drm_dev_unregister(private->drm);
> - drm_dev_unref(private->drm);
> + drm_dev_put(private->drm);
> private->drm = NULL;
> }
>
> @@ -504,7 +504,7 @@ static int mtk_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mtk_drm_kms_deinit(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> component_master_del(&pdev->dev, &mtk_drm_ops);
> pm_runtime_disable(&pdev->dev);
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 30cd514d8f7c..558a82f828b8 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -260,7 +260,7 @@ static int msm_drm_uninit(struct device *dev)
> msm_mdss_destroy(ddev);
>
> ddev->dev_private = NULL;
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> kfree(priv);
>
> @@ -368,7 +368,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
>
> priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> if (!priv) {
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return -ENOMEM;
> }
>
> @@ -378,7 +378,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> ret = msm_mdss_init(ddev);
> if (ret) {
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -398,7 +398,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> if (ret) {
> msm_mdss_destroy(ddev);
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 5cae8db9dcd4..1ca9bafcd4f2 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -403,7 +403,7 @@ static int mxsfb_probe(struct platform_device *pdev)
> err_unload:
> mxsfb_unload(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -414,7 +414,7 @@ static int mxsfb_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mxsfb_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
> index 1ada186fab77..039e23548e08 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_platform.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
> @@ -36,7 +36,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
>
> ret = drm_dev_register(drm, 0);
> if (ret < 0) {
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 3632854c2b91..e12cedc15e27 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -598,7 +598,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
> omap_drm_irq_uninstall(ddev);
> err_free_drm_dev:
> omap_gem_deinit(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> err_destroy_wq:
> destroy_workqueue(priv->wq);
> omap_disconnect_dssdevs();
> @@ -627,7 +627,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
> omap_drm_irq_uninstall(ddev);
> omap_gem_deinit(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> destroy_workqueue(priv->wq);
>
> diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
> index 4621259d5387..6e21308dd6c6 100644
> --- a/drivers/gpu/drm/pl111/pl111_drv.c
> +++ b/drivers/gpu/drm/pl111/pl111_drv.c
> @@ -304,7 +304,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
> return 0;
>
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -318,7 +318,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
> if (priv->panel)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index 2445e75cf7ea..86bd42dca09c 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -119,7 +119,7 @@ qxl_pci_remove(struct pci_dev *pdev)
>
> dev->dev_private = NULL;
> kfree(qdev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static const struct file_operations qxl_fops = {
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 3917d839c04c..1adcf80912e1 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -378,7 +378,7 @@ static int rcar_du_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index f814d37b1db2..9c846be8fc64 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -184,7 +184,7 @@ static int rockchip_drm_bind(struct device *dev)
> err_free:
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> return ret;
> }
>
> @@ -204,7 +204,7 @@ static void rockchip_drm_unbind(struct device *dev)
>
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct file_operations rockchip_drm_driver_fops = {
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 592572554eb0..8d1ff596c774 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -198,7 +198,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> drm_irq_uninstall(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> @@ -294,7 +294,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> err_free_drm_dev:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 55b6967d27e1..e8d6199878ce 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -242,7 +242,7 @@ static int sti_bind(struct device *dev)
>
> ret = sti_init(ddev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = component_bind_all(ddev->dev, ddev);
> if (ret)
> @@ -266,8 +266,8 @@ static int sti_bind(struct device *dev)
> drm_mode_config_cleanup(ddev);
> err_cleanup:
> sti_cleanup(ddev);
> -err_drm_dev_unref:
> - drm_dev_unref(ddev);
> +err_drm_dev_put:
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -277,7 +277,7 @@ static void sti_unbind(struct device *dev)
>
> drm_dev_unregister(ddev);
> sti_cleanup(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> }
>
> static const struct component_master_ops sti_ops = {
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 9ab00a87f7cc..6ece3acabd56 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -159,7 +159,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
> return 0;
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -172,7 +172,7 @@ static int stm_drm_platform_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> drv_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 50d19605c38f..42c881d5275d 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -143,7 +143,7 @@ static int sun4i_drv_bind(struct device *dev)
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -156,7 +156,7 @@ static void sun4i_drv_unbind(struct device *dev)
> sun4i_framebuffer_free(drm);
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops sun4i_drv_master_ops = {
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 7afe2f635f74..f5119f2bbf5f 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -1210,7 +1210,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return err;
> }
>
> @@ -1219,7 +1219,7 @@ static int host1x_drm_remove(struct host1x_device *dev)
> struct drm_device *drm = dev_get_drvdata(&dev->dev);
>
> drm_dev_unregister(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> index 4c6616278c48..ca2b6a8b74c2 100644
> --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> @@ -135,7 +135,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
> /*
> * We don't embed drm_device, because that prevent us from using
> * devm_kzalloc() to allocate tinydrm_device in the driver since
> - * drm_dev_unref() frees the structure. The devm_ functions provide
> + * drm_dev_put() frees the structure. The devm_ functions provide
> * for easy error handling.
> */
> drm = drm_dev_alloc(driver, parent);
> @@ -155,7 +155,7 @@ static void tinydrm_fini(struct tinydrm_device *tdev)
> drm_mode_config_cleanup(tdev->drm);
> mutex_destroy(&tdev->dirty_lock);
> tdev->drm->dev_private = NULL;
> - drm_dev_unref(tdev->drm);
> + drm_dev_put(tdev->drm);
> }
>
> static void devm_tinydrm_release(void *data)
> @@ -172,7 +172,7 @@ static void devm_tinydrm_release(void *data)
> *
> * This function initializes @tdev, the underlying DRM device and it's
> * mode_config. Resources will be automatically freed on driver detach (devres)
> - * using drm_mode_config_cleanup() and drm_dev_unref().
> + * using drm_mode_config_cleanup() and drm_dev_put().
> *
> * Returns:
> * Zero on success, negative error code on failure.
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
> index ac344ddb23bc..e36a78ef68b7 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -250,7 +250,7 @@ static int tve200_probe(struct platform_device *pdev)
> clk_disable:
> clk_disable_unprepare(priv->pclk);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -265,7 +265,7 @@ static int tve200_remove(struct platform_device *pdev)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> clk_disable_unprepare(priv->pclk);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
> index 3c45a3064726..d5e94eb7a4ca 100644
> --- a/drivers/gpu/drm/udl/udl_drv.c
> +++ b/drivers/gpu/drm/udl/udl_drv.c
> @@ -94,7 +94,7 @@ static int udl_usb_probe(struct usb_interface *interface,
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return r;
> }
>
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 94b99c90425a..259c85fcd32c 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -312,7 +312,7 @@ static int vc4_drm_bind(struct device *dev)
> vc4_gem_destroy(drm);
> vc4_bo_cache_destroy(drm);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -327,7 +327,7 @@ static void vc4_drm_unbind(struct device *dev)
>
> drm_mode_config_cleanup(drm);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops vc4_drm_ops = {
> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> index 2524ff116f00..305f87665499 100644
> --- a/drivers/gpu/drm/vgem/vgem_drv.c
> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> @@ -505,7 +505,7 @@ static int __init vgem_init(void)
> static void __exit vgem_exit(void)
> {
> drm_dev_unregister(&vgem_device->drm);
> - drm_dev_unref(&vgem_device->drm);
> + drm_dev_put(&vgem_device->drm);
> }
>
> module_init(vgem_init);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> index 7df8d0c9026a..094b876f6da6 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> @@ -85,6 +85,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 6f4205e80378..02ae1caf6e8a 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -122,7 +122,7 @@ static int zx_drm_bind(struct device *dev)
> component_unbind_all(dev, drm);
> out_unregister:
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -136,7 +136,7 @@ static void zx_drm_unbind(struct device *dev)
> drm_mode_config_cleanup(drm);
> component_unbind_all(dev, drm);
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops zx_drm_master_ops = {
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index d23dcdd1bd95..c16dd4424b8a 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -622,7 +622,6 @@ void drm_dev_unregister(struct drm_device *dev);
>
> void drm_dev_get(struct drm_device *dev);
> void drm_dev_put(struct drm_device *dev);
> -void drm_dev_unref(struct drm_device *dev);
> void drm_put_dev(struct drm_device *dev);
> void drm_dev_unplug(struct drm_device *dev);
>
> --
> 2.14.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <20180426102819.6985-1-vthakkar1994-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 10:28 ` Vaishali Thakkar
@ 2018-04-26 12:36 ` Daniel Vetter
-1 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-26 12:36 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ,
heiko-4mtYJXux2i+zQB+pC5nmwQ, airlied-cv59FeDIM0c,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A, stefan-XLVq0VzYD2Y,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
kraxel-H+wXaHxf7aLQT0dZR+AlfA,
benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A, marex-ynQEQJNshbs,
David1.Zhou-5C7GfCeVMHo, maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ, linux-I+IVW8TIWO2tmTQ+vhA3Yw,
krzk-DgEjT+Ai2ygdnm+yROfE0A, jonathanh-DDmLM1+adcrQT0dZR+AlfA,
z.liuxinliang-C8/M+/jPZTeaMJb+Lgu22Q,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q,
tomi.valkeinen-l0cyMroinI0, bskeggs-H+wXaHxf7aLQT0dZR+AlfA,
puck.chen-C8/M+/jPZTeaMJb+Lgu22Q, ck.hu-NuS5LvNUpcJWk0Htik3J/w,
airlied-H+wXaHxf7aLQT0dZR+AlfA,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA,
etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
brodkin-HKixBCOQz3hWk0Htik3J/w,
zourongrong-Re5JQEeQqe8AvxtiuMwx3w,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Thanks for doing this. Unfortunately drm moves pretty fast, so already a
conflict when I tried to apply this. Some drivers are also in their own
trees, so this might lead to more fun :-/
Can you pls split it up per-driver (just the directories under
drivers/gpu/drm/ is enough)? Final patch to remove the function might then
get stalled a bit ofc.
Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
remove that spatch hunk in the final patch, since we no longer need it?
Thanks, Daniel
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 0b19482b36b8..5fb455febeba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> err_pci:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
>
> @@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> struct drm_device *dev = pci_get_drvdata(pdev);
>
> drm_dev_unregister(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> pci_disable_device(pdev);
> pci_set_drvdata(pdev, NULL);
> }
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
> arcpgu_unload(drm);
>
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> arcpgu_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 4b11b6b52f1d..d1705d298a39 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev)
>
> /*
> * The drm_device structure must be at the start of
> - * armada_private for drm_dev_unref() to work correctly.
> + * armada_private for drm_dev_put() to work correctly.
> */
> BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
>
> @@ -180,7 +180,7 @@ static int armada_drm_bind(struct device *dev)
> drm_mode_config_cleanup(&priv->drm);
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> return ret;
> }
>
> @@ -200,7 +200,7 @@ static void armada_drm_unbind(struct device *dev)
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
>
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> }
>
> static int compare_of(struct device *dev, void *data)
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index c1ea5c36b006..1c8487803a70 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -774,7 +774,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
> atmel_hlcdc_dc_unload(ddev);
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -785,7 +785,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> atmel_hlcdc_dc_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index a1b9338736e3..3dc507b13cf2 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -656,19 +656,6 @@ void drm_dev_put(struct drm_device *dev)
> }
> EXPORT_SYMBOL(drm_dev_put);
>
> -/**
> - * drm_dev_unref - Drop reference of a DRM device
> - * @dev: device to drop reference of or NULL
> - *
> - * This is a compatibility alias for drm_dev_put() and should not be used by new
> - * code.
> - */
> -void drm_dev_unref(struct drm_device *dev)
> -{
> - drm_dev_put(dev);
> -}
> -EXPORT_SYMBOL(drm_dev_unref);
> -
> static int create_compat_control_link(struct drm_device *dev)
> {
> struct drm_minor *minor;
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index ab50090d066c..716187a07227 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -613,7 +613,7 @@ static int etnaviv_bind(struct device *dev)
> out_bind:
> kfree(priv);
> out_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -630,7 +630,7 @@ static void etnaviv_unbind(struct device *dev)
> drm->dev_private = NULL;
> kfree(priv);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops etnaviv_master_ops = {
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index a518e9c6d6cc..3629e5c93e3a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -411,7 +411,7 @@ static int exynos_drm_bind(struct device *dev)
> err_free_private:
> kfree(private);
> err_free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -435,7 +435,7 @@ static void exynos_drm_unbind(struct device *dev)
> drm->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops exynos_drm_ops = {
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 80232321a244..664ac9dc1f65 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -358,7 +358,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> unregister_pix_clk:
> clk_unregister(fsl_dev->pix_clk);
> disable_clk:
> @@ -371,7 +371,7 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
> struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);
>
> drm_dev_unregister(fsl_dev->drm);
> - drm_dev_unref(fsl_dev->drm);
> + drm_dev_put(fsl_dev->drm);
> clk_disable_unprepare(fsl_dev->clk);
> clk_unregister(fsl_dev->pix_clk);
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index d4f6f1f9df5b..ec878c7e3f75 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -387,7 +387,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
> err_disable:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
>
> return ret;
> }
> @@ -398,7 +398,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
>
> drm_dev_unregister(dev);
> hibmc_unload(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static struct pci_device_id hibmc_pci_table[] = {
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index ddb0403f1975..e6a62d5a00a3 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -193,7 +193,7 @@ static int kirin_drm_bind(struct device *dev)
>
> ret = kirin_drm_kms_init(drm_dev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = drm_dev_register(drm_dev, 0);
> if (ret)
> @@ -203,8 +203,8 @@ static int kirin_drm_bind(struct device *dev)
>
> err_kms_cleanup:
> kirin_drm_kms_cleanup(drm_dev);
> -err_drm_dev_unref:
> - drm_dev_unref(drm_dev);
> +err_drm_dev_put:
> + drm_dev_put(drm_dev);
>
> return ret;
> }
> @@ -215,7 +215,7 @@ static void kirin_drm_unbind(struct device *dev)
>
> drm_dev_unregister(drm_dev);
> kirin_drm_kms_cleanup(drm_dev);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct component_master_ops kirin_drm_ops = {
> diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
> index 05bbef363fff..22de60920b1a 100644
> --- a/drivers/gpu/drm/i915/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
> @@ -1720,7 +1720,7 @@ int i915_gem_huge_page_mock_selftests(void)
>
> i915_modparams.enable_ppgtt = saved_ppgtt;
>
> - drm_dev_unref(&dev_priv->drm);
> + drm_dev_put(&dev_priv->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> index 89dc25a5a53b..a7055b12e53c 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> @@ -389,7 +389,7 @@ int i915_gem_dmabuf_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> index ab9d7bee0aae..7b21e4135aa5 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> @@ -490,7 +490,7 @@ int i915_gem_evict_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index f7dc926f4ef1..1cf4e9af0b65 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -1646,7 +1646,7 @@ int i915_gem_gtt_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> index fbdb2419d418..7066f22ef8f1 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> @@ -586,7 +586,7 @@ int i915_gem_object_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index 94bc2e1898a4..5d069de4a19a 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -262,7 +262,7 @@ int i915_request_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
> index eb89e301b602..9fbba5defb3e 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_vma.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
> @@ -734,7 +734,7 @@ int i915_vma_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> index 46580026c7fc..b6c9deeeda7b 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> @@ -463,7 +463,7 @@ int intel_breadcrumbs_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915->engine[RCS]);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 1d053bbefc02..27f54cbee7fb 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -307,7 +307,7 @@ static int imx_drm_bind(struct device *dev)
> err_kms:
> drm_mode_config_cleanup(drm);
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -327,7 +327,7 @@ static void imx_drm_unbind(struct device *dev)
> component_unbind_all(drm->dev, drm);
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops imx_drm_ops = {
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index a2ca90fc403c..5d024a154e1a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -341,7 +341,7 @@ static int mtk_drm_bind(struct device *dev)
> err_deinit:
> mtk_drm_kms_deinit(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -350,7 +350,7 @@ static void mtk_drm_unbind(struct device *dev)
> struct mtk_drm_private *private = dev_get_drvdata(dev);
>
> drm_dev_unregister(private->drm);
> - drm_dev_unref(private->drm);
> + drm_dev_put(private->drm);
> private->drm = NULL;
> }
>
> @@ -504,7 +504,7 @@ static int mtk_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mtk_drm_kms_deinit(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> component_master_del(&pdev->dev, &mtk_drm_ops);
> pm_runtime_disable(&pdev->dev);
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 30cd514d8f7c..558a82f828b8 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -260,7 +260,7 @@ static int msm_drm_uninit(struct device *dev)
> msm_mdss_destroy(ddev);
>
> ddev->dev_private = NULL;
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> kfree(priv);
>
> @@ -368,7 +368,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
>
> priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> if (!priv) {
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return -ENOMEM;
> }
>
> @@ -378,7 +378,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> ret = msm_mdss_init(ddev);
> if (ret) {
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -398,7 +398,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> if (ret) {
> msm_mdss_destroy(ddev);
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 5cae8db9dcd4..1ca9bafcd4f2 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -403,7 +403,7 @@ static int mxsfb_probe(struct platform_device *pdev)
> err_unload:
> mxsfb_unload(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -414,7 +414,7 @@ static int mxsfb_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mxsfb_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
> index 1ada186fab77..039e23548e08 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_platform.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
> @@ -36,7 +36,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
>
> ret = drm_dev_register(drm, 0);
> if (ret < 0) {
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 3632854c2b91..e12cedc15e27 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -598,7 +598,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
> omap_drm_irq_uninstall(ddev);
> err_free_drm_dev:
> omap_gem_deinit(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> err_destroy_wq:
> destroy_workqueue(priv->wq);
> omap_disconnect_dssdevs();
> @@ -627,7 +627,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
> omap_drm_irq_uninstall(ddev);
> omap_gem_deinit(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> destroy_workqueue(priv->wq);
>
> diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
> index 4621259d5387..6e21308dd6c6 100644
> --- a/drivers/gpu/drm/pl111/pl111_drv.c
> +++ b/drivers/gpu/drm/pl111/pl111_drv.c
> @@ -304,7 +304,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
> return 0;
>
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -318,7 +318,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
> if (priv->panel)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index 2445e75cf7ea..86bd42dca09c 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -119,7 +119,7 @@ qxl_pci_remove(struct pci_dev *pdev)
>
> dev->dev_private = NULL;
> kfree(qdev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static const struct file_operations qxl_fops = {
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 3917d839c04c..1adcf80912e1 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -378,7 +378,7 @@ static int rcar_du_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index f814d37b1db2..9c846be8fc64 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -184,7 +184,7 @@ static int rockchip_drm_bind(struct device *dev)
> err_free:
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> return ret;
> }
>
> @@ -204,7 +204,7 @@ static void rockchip_drm_unbind(struct device *dev)
>
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct file_operations rockchip_drm_driver_fops = {
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 592572554eb0..8d1ff596c774 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -198,7 +198,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> drm_irq_uninstall(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> @@ -294,7 +294,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> err_free_drm_dev:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 55b6967d27e1..e8d6199878ce 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -242,7 +242,7 @@ static int sti_bind(struct device *dev)
>
> ret = sti_init(ddev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = component_bind_all(ddev->dev, ddev);
> if (ret)
> @@ -266,8 +266,8 @@ static int sti_bind(struct device *dev)
> drm_mode_config_cleanup(ddev);
> err_cleanup:
> sti_cleanup(ddev);
> -err_drm_dev_unref:
> - drm_dev_unref(ddev);
> +err_drm_dev_put:
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -277,7 +277,7 @@ static void sti_unbind(struct device *dev)
>
> drm_dev_unregister(ddev);
> sti_cleanup(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> }
>
> static const struct component_master_ops sti_ops = {
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 9ab00a87f7cc..6ece3acabd56 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -159,7 +159,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
> return 0;
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -172,7 +172,7 @@ static int stm_drm_platform_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> drv_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 50d19605c38f..42c881d5275d 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -143,7 +143,7 @@ static int sun4i_drv_bind(struct device *dev)
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -156,7 +156,7 @@ static void sun4i_drv_unbind(struct device *dev)
> sun4i_framebuffer_free(drm);
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops sun4i_drv_master_ops = {
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 7afe2f635f74..f5119f2bbf5f 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -1210,7 +1210,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return err;
> }
>
> @@ -1219,7 +1219,7 @@ static int host1x_drm_remove(struct host1x_device *dev)
> struct drm_device *drm = dev_get_drvdata(&dev->dev);
>
> drm_dev_unregister(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> index 4c6616278c48..ca2b6a8b74c2 100644
> --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> @@ -135,7 +135,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
> /*
> * We don't embed drm_device, because that prevent us from using
> * devm_kzalloc() to allocate tinydrm_device in the driver since
> - * drm_dev_unref() frees the structure. The devm_ functions provide
> + * drm_dev_put() frees the structure. The devm_ functions provide
> * for easy error handling.
> */
> drm = drm_dev_alloc(driver, parent);
> @@ -155,7 +155,7 @@ static void tinydrm_fini(struct tinydrm_device *tdev)
> drm_mode_config_cleanup(tdev->drm);
> mutex_destroy(&tdev->dirty_lock);
> tdev->drm->dev_private = NULL;
> - drm_dev_unref(tdev->drm);
> + drm_dev_put(tdev->drm);
> }
>
> static void devm_tinydrm_release(void *data)
> @@ -172,7 +172,7 @@ static void devm_tinydrm_release(void *data)
> *
> * This function initializes @tdev, the underlying DRM device and it's
> * mode_config. Resources will be automatically freed on driver detach (devres)
> - * using drm_mode_config_cleanup() and drm_dev_unref().
> + * using drm_mode_config_cleanup() and drm_dev_put().
> *
> * Returns:
> * Zero on success, negative error code on failure.
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
> index ac344ddb23bc..e36a78ef68b7 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -250,7 +250,7 @@ static int tve200_probe(struct platform_device *pdev)
> clk_disable:
> clk_disable_unprepare(priv->pclk);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -265,7 +265,7 @@ static int tve200_remove(struct platform_device *pdev)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> clk_disable_unprepare(priv->pclk);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
> index 3c45a3064726..d5e94eb7a4ca 100644
> --- a/drivers/gpu/drm/udl/udl_drv.c
> +++ b/drivers/gpu/drm/udl/udl_drv.c
> @@ -94,7 +94,7 @@ static int udl_usb_probe(struct usb_interface *interface,
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return r;
> }
>
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 94b99c90425a..259c85fcd32c 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -312,7 +312,7 @@ static int vc4_drm_bind(struct device *dev)
> vc4_gem_destroy(drm);
> vc4_bo_cache_destroy(drm);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -327,7 +327,7 @@ static void vc4_drm_unbind(struct device *dev)
>
> drm_mode_config_cleanup(drm);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops vc4_drm_ops = {
> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> index 2524ff116f00..305f87665499 100644
> --- a/drivers/gpu/drm/vgem/vgem_drv.c
> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> @@ -505,7 +505,7 @@ static int __init vgem_init(void)
> static void __exit vgem_exit(void)
> {
> drm_dev_unregister(&vgem_device->drm);
> - drm_dev_unref(&vgem_device->drm);
> + drm_dev_put(&vgem_device->drm);
> }
>
> module_init(vgem_init);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> index 7df8d0c9026a..094b876f6da6 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> @@ -85,6 +85,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 6f4205e80378..02ae1caf6e8a 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -122,7 +122,7 @@ static int zx_drm_bind(struct device *dev)
> component_unbind_all(dev, drm);
> out_unregister:
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -136,7 +136,7 @@ static void zx_drm_unbind(struct device *dev)
> drm_mode_config_cleanup(drm);
> component_unbind_all(dev, drm);
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops zx_drm_master_ops = {
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index d23dcdd1bd95..c16dd4424b8a 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -622,7 +622,6 @@ void drm_dev_unregister(struct drm_device *dev);
>
> void drm_dev_get(struct drm_device *dev);
> void drm_dev_put(struct drm_device *dev);
> -void drm_dev_unref(struct drm_device *dev);
> void drm_put_dev(struct drm_device *dev);
> void drm_dev_unplug(struct drm_device *dev);
>
> --
> 2.14.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 12:36 ` Daniel Vetter
0 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-26 12:36 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: alexander.deucher, linux-renesas-soc, alexandre.belloni, heiko,
airlied, linus.walleij, stefan, hjc, kraxel, benjamin.gaignard,
nouveau, marex, David1.Zhou, linux-samsung-soc, jy0922.shim,
linux-rockchip, tomi.valkeinen, linux, krzk, jonathanh,
z.liuxinliang, maxime.ripard, kong.kongxinwei, kgene, bskeggs,
linux-arm-msm, ck.hu, airlied, virtualization, linux-tegra,
puck.chen, intel-gfx, etnaviv, brodkin, dri-devel, rodrigo.vivi,
matthias.bgg, wens, vincent.abriou, linux-arm-kernel, inki.dae,
amd-gfx, laurent.pinchart, alison.wang, freedreno, sw0312.kim,
nicolas.ferre, philippe.cornu, linux-kernel, yannick.fertre,
kyungmin.park, noralf, p.zabel, zourongrong, linux-mediatek,
shawnguo, christian.koenig, l.stach
On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> It's been a while since we introduced drm_dev{get/put} functions
> to replace reference/unreference in drm subsystem for the
> consistency purpose. So, with this patch, let's just replace
> all current use cases of drm_dev_unref() with drm_dev_put and remove
> the function itself.
>
> Coccinelle was used for mass-patching.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Thanks for doing this. Unfortunately drm moves pretty fast, so already a
conflict when I tried to apply this. Some drivers are also in their own
trees, so this might lead to more fun :-/
Can you pls split it up per-driver (just the directories under
drivers/gpu/drm/ is enough)? Final patch to remove the function might then
get stalled a bit ofc.
Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
remove that spatch hunk in the final patch, since we no longer need it?
Thanks, Daniel
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> drivers/gpu/drm/drm_drv.c | 13 -------------
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> drivers/gpu/drm/stm/drv.c | 4 ++--
> drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> drivers/gpu/drm/tegra/drm.c | 4 ++--
> drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> drivers/gpu/drm/udl/udl_drv.c | 2 +-
> drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> include/drm/drm_drv.h | 1 -
> 41 files changed, 73 insertions(+), 87 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 0b19482b36b8..5fb455febeba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> err_pci:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
>
> @@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> struct drm_device *dev = pci_get_drvdata(pdev);
>
> drm_dev_unregister(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> pci_disable_device(pdev);
> pci_set_drvdata(pdev, NULL);
> }
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
> arcpgu_unload(drm);
>
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> arcpgu_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 4b11b6b52f1d..d1705d298a39 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev)
>
> /*
> * The drm_device structure must be at the start of
> - * armada_private for drm_dev_unref() to work correctly.
> + * armada_private for drm_dev_put() to work correctly.
> */
> BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);
>
> @@ -180,7 +180,7 @@ static int armada_drm_bind(struct device *dev)
> drm_mode_config_cleanup(&priv->drm);
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> return ret;
> }
>
> @@ -200,7 +200,7 @@ static void armada_drm_unbind(struct device *dev)
> drm_mm_takedown(&priv->linear);
> flush_work(&priv->fb_unref_work);
>
> - drm_dev_unref(&priv->drm);
> + drm_dev_put(&priv->drm);
> }
>
> static int compare_of(struct device *dev, void *data)
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index c1ea5c36b006..1c8487803a70 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -774,7 +774,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
> atmel_hlcdc_dc_unload(ddev);
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -785,7 +785,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> atmel_hlcdc_dc_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index a1b9338736e3..3dc507b13cf2 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -656,19 +656,6 @@ void drm_dev_put(struct drm_device *dev)
> }
> EXPORT_SYMBOL(drm_dev_put);
>
> -/**
> - * drm_dev_unref - Drop reference of a DRM device
> - * @dev: device to drop reference of or NULL
> - *
> - * This is a compatibility alias for drm_dev_put() and should not be used by new
> - * code.
> - */
> -void drm_dev_unref(struct drm_device *dev)
> -{
> - drm_dev_put(dev);
> -}
> -EXPORT_SYMBOL(drm_dev_unref);
> -
> static int create_compat_control_link(struct drm_device *dev)
> {
> struct drm_minor *minor;
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index ab50090d066c..716187a07227 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -613,7 +613,7 @@ static int etnaviv_bind(struct device *dev)
> out_bind:
> kfree(priv);
> out_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -630,7 +630,7 @@ static void etnaviv_unbind(struct device *dev)
> drm->dev_private = NULL;
> kfree(priv);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops etnaviv_master_ops = {
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index a518e9c6d6cc..3629e5c93e3a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -411,7 +411,7 @@ static int exynos_drm_bind(struct device *dev)
> err_free_private:
> kfree(private);
> err_free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -435,7 +435,7 @@ static void exynos_drm_unbind(struct device *dev)
> drm->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops exynos_drm_ops = {
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 80232321a244..664ac9dc1f65 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -358,7 +358,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> unregister_pix_clk:
> clk_unregister(fsl_dev->pix_clk);
> disable_clk:
> @@ -371,7 +371,7 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
> struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);
>
> drm_dev_unregister(fsl_dev->drm);
> - drm_dev_unref(fsl_dev->drm);
> + drm_dev_put(fsl_dev->drm);
> clk_disable_unprepare(fsl_dev->clk);
> clk_unregister(fsl_dev->pix_clk);
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index d4f6f1f9df5b..ec878c7e3f75 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -387,7 +387,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
> err_disable:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
>
> return ret;
> }
> @@ -398,7 +398,7 @@ static void hibmc_pci_remove(struct pci_dev *pdev)
>
> drm_dev_unregister(dev);
> hibmc_unload(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static struct pci_device_id hibmc_pci_table[] = {
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index ddb0403f1975..e6a62d5a00a3 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -193,7 +193,7 @@ static int kirin_drm_bind(struct device *dev)
>
> ret = kirin_drm_kms_init(drm_dev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = drm_dev_register(drm_dev, 0);
> if (ret)
> @@ -203,8 +203,8 @@ static int kirin_drm_bind(struct device *dev)
>
> err_kms_cleanup:
> kirin_drm_kms_cleanup(drm_dev);
> -err_drm_dev_unref:
> - drm_dev_unref(drm_dev);
> +err_drm_dev_put:
> + drm_dev_put(drm_dev);
>
> return ret;
> }
> @@ -215,7 +215,7 @@ static void kirin_drm_unbind(struct device *dev)
>
> drm_dev_unregister(drm_dev);
> kirin_drm_kms_cleanup(drm_dev);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct component_master_ops kirin_drm_ops = {
> diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
> index 05bbef363fff..22de60920b1a 100644
> --- a/drivers/gpu/drm/i915/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
> @@ -1720,7 +1720,7 @@ int i915_gem_huge_page_mock_selftests(void)
>
> i915_modparams.enable_ppgtt = saved_ppgtt;
>
> - drm_dev_unref(&dev_priv->drm);
> + drm_dev_put(&dev_priv->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> index 89dc25a5a53b..a7055b12e53c 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
> @@ -389,7 +389,7 @@ int i915_gem_dmabuf_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> index ab9d7bee0aae..7b21e4135aa5 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> @@ -490,7 +490,7 @@ int i915_gem_evict_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index f7dc926f4ef1..1cf4e9af0b65 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -1646,7 +1646,7 @@ int i915_gem_gtt_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> index fbdb2419d418..7066f22ef8f1 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
> @@ -586,7 +586,7 @@ int i915_gem_object_mock_selftests(void)
>
> err = i915_subtests(tests, i915);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index 94bc2e1898a4..5d069de4a19a 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -262,7 +262,7 @@ int i915_request_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
> index eb89e301b602..9fbba5defb3e 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_vma.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
> @@ -734,7 +734,7 @@ int i915_vma_mock_selftests(void)
> err = i915_subtests(tests, i915);
> mutex_unlock(&i915->drm.struct_mutex);
>
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
> return err;
> }
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> index 46580026c7fc..b6c9deeeda7b 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> @@ -463,7 +463,7 @@ int intel_breadcrumbs_mock_selftests(void)
> return -ENOMEM;
>
> err = i915_subtests(tests, i915->engine[RCS]);
> - drm_dev_unref(&i915->drm);
> + drm_dev_put(&i915->drm);
>
> return err;
> }
> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 1d053bbefc02..27f54cbee7fb 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -307,7 +307,7 @@ static int imx_drm_bind(struct device *dev)
> err_kms:
> drm_mode_config_cleanup(drm);
> err_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -327,7 +327,7 @@ static void imx_drm_unbind(struct device *dev)
> component_unbind_all(drm->dev, drm);
> dev_set_drvdata(dev, NULL);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops imx_drm_ops = {
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index a2ca90fc403c..5d024a154e1a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -341,7 +341,7 @@ static int mtk_drm_bind(struct device *dev)
> err_deinit:
> mtk_drm_kms_deinit(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -350,7 +350,7 @@ static void mtk_drm_unbind(struct device *dev)
> struct mtk_drm_private *private = dev_get_drvdata(dev);
>
> drm_dev_unregister(private->drm);
> - drm_dev_unref(private->drm);
> + drm_dev_put(private->drm);
> private->drm = NULL;
> }
>
> @@ -504,7 +504,7 @@ static int mtk_drm_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mtk_drm_kms_deinit(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> component_master_del(&pdev->dev, &mtk_drm_ops);
> pm_runtime_disable(&pdev->dev);
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 30cd514d8f7c..558a82f828b8 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -260,7 +260,7 @@ static int msm_drm_uninit(struct device *dev)
> msm_mdss_destroy(ddev);
>
> ddev->dev_private = NULL;
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> kfree(priv);
>
> @@ -368,7 +368,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
>
> priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> if (!priv) {
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return -ENOMEM;
> }
>
> @@ -378,7 +378,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> ret = msm_mdss_init(ddev);
> if (ret) {
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -398,7 +398,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
> if (ret) {
> msm_mdss_destroy(ddev);
> kfree(priv);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 5cae8db9dcd4..1ca9bafcd4f2 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -403,7 +403,7 @@ static int mxsfb_probe(struct platform_device *pdev)
> err_unload:
> mxsfb_unload(drm);
> err_free:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return ret;
> }
> @@ -414,7 +414,7 @@ static int mxsfb_remove(struct platform_device *pdev)
>
> drm_dev_unregister(drm);
> mxsfb_unload(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/nouveau/nouveau_platform.c b/drivers/gpu/drm/nouveau/nouveau_platform.c
> index 1ada186fab77..039e23548e08 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_platform.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_platform.c
> @@ -36,7 +36,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
>
> ret = drm_dev_register(drm, 0);
> if (ret < 0) {
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 3632854c2b91..e12cedc15e27 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -598,7 +598,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
> omap_drm_irq_uninstall(ddev);
> err_free_drm_dev:
> omap_gem_deinit(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> err_destroy_wq:
> destroy_workqueue(priv->wq);
> omap_disconnect_dssdevs();
> @@ -627,7 +627,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
> omap_drm_irq_uninstall(ddev);
> omap_gem_deinit(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> destroy_workqueue(priv->wq);
>
> diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
> index 4621259d5387..6e21308dd6c6 100644
> --- a/drivers/gpu/drm/pl111/pl111_drv.c
> +++ b/drivers/gpu/drm/pl111/pl111_drv.c
> @@ -304,7 +304,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
> return 0;
>
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -318,7 +318,7 @@ static int pl111_amba_remove(struct amba_device *amba_dev)
> if (priv->panel)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
> index 2445e75cf7ea..86bd42dca09c 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.c
> +++ b/drivers/gpu/drm/qxl/qxl_drv.c
> @@ -119,7 +119,7 @@ qxl_pci_remove(struct pci_dev *pdev)
>
> dev->dev_private = NULL;
> kfree(qdev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> }
>
> static const struct file_operations qxl_fops = {
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 3917d839c04c..1adcf80912e1 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -378,7 +378,7 @@ static int rcar_du_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
>
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index f814d37b1db2..9c846be8fc64 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -184,7 +184,7 @@ static int rockchip_drm_bind(struct device *dev)
> err_free:
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> return ret;
> }
>
> @@ -204,7 +204,7 @@ static void rockchip_drm_unbind(struct device *dev)
>
> drm_dev->dev_private = NULL;
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm_dev);
> + drm_dev_put(drm_dev);
> }
>
> static const struct file_operations rockchip_drm_driver_fops = {
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 592572554eb0..8d1ff596c774 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -198,7 +198,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> drm_irq_uninstall(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> @@ -294,7 +294,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
> drm_kms_helper_poll_fini(ddev);
> drm_mode_config_cleanup(ddev);
> err_free_drm_dev:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 55b6967d27e1..e8d6199878ce 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -242,7 +242,7 @@ static int sti_bind(struct device *dev)
>
> ret = sti_init(ddev);
> if (ret)
> - goto err_drm_dev_unref;
> + goto err_drm_dev_put;
>
> ret = component_bind_all(ddev->dev, ddev);
> if (ret)
> @@ -266,8 +266,8 @@ static int sti_bind(struct device *dev)
> drm_mode_config_cleanup(ddev);
> err_cleanup:
> sti_cleanup(ddev);
> -err_drm_dev_unref:
> - drm_dev_unref(ddev);
> +err_drm_dev_put:
> + drm_dev_put(ddev);
> return ret;
> }
>
> @@ -277,7 +277,7 @@ static void sti_unbind(struct device *dev)
>
> drm_dev_unregister(ddev);
> sti_cleanup(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
> }
>
> static const struct component_master_ops sti_ops = {
> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
> index 9ab00a87f7cc..6ece3acabd56 100644
> --- a/drivers/gpu/drm/stm/drv.c
> +++ b/drivers/gpu/drm/stm/drv.c
> @@ -159,7 +159,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
> return 0;
>
> err_unref:
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return ret;
> }
> @@ -172,7 +172,7 @@ static int stm_drm_platform_remove(struct platform_device *pdev)
>
> drm_dev_unregister(ddev);
> drv_unload(ddev);
> - drm_dev_unref(ddev);
> + drm_dev_put(ddev);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 50d19605c38f..42c881d5275d 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -143,7 +143,7 @@ static int sun4i_drv_bind(struct device *dev)
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> free_drm:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -156,7 +156,7 @@ static void sun4i_drv_unbind(struct device *dev)
> sun4i_framebuffer_free(drm);
> drm_mode_config_cleanup(drm);
> of_reserved_mem_device_release(dev);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops sun4i_drv_master_ops = {
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 7afe2f635f74..f5119f2bbf5f 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -1210,7 +1210,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
> return 0;
>
> unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return err;
> }
>
> @@ -1219,7 +1219,7 @@ static int host1x_drm_remove(struct host1x_device *dev)
> struct drm_device *drm = dev_get_drvdata(&dev->dev);
>
> drm_dev_unregister(drm);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> index 4c6616278c48..ca2b6a8b74c2 100644
> --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c
> @@ -135,7 +135,7 @@ static int tinydrm_init(struct device *parent, struct tinydrm_device *tdev,
> /*
> * We don't embed drm_device, because that prevent us from using
> * devm_kzalloc() to allocate tinydrm_device in the driver since
> - * drm_dev_unref() frees the structure. The devm_ functions provide
> + * drm_dev_put() frees the structure. The devm_ functions provide
> * for easy error handling.
> */
> drm = drm_dev_alloc(driver, parent);
> @@ -155,7 +155,7 @@ static void tinydrm_fini(struct tinydrm_device *tdev)
> drm_mode_config_cleanup(tdev->drm);
> mutex_destroy(&tdev->dirty_lock);
> tdev->drm->dev_private = NULL;
> - drm_dev_unref(tdev->drm);
> + drm_dev_put(tdev->drm);
> }
>
> static void devm_tinydrm_release(void *data)
> @@ -172,7 +172,7 @@ static void devm_tinydrm_release(void *data)
> *
> * This function initializes @tdev, the underlying DRM device and it's
> * mode_config. Resources will be automatically freed on driver detach (devres)
> - * using drm_mode_config_cleanup() and drm_dev_unref().
> + * using drm_mode_config_cleanup() and drm_dev_put().
> *
> * Returns:
> * Zero on success, negative error code on failure.
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
> index ac344ddb23bc..e36a78ef68b7 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -250,7 +250,7 @@ static int tve200_probe(struct platform_device *pdev)
> clk_disable:
> clk_disable_unprepare(priv->pclk);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -265,7 +265,7 @@ static int tve200_remove(struct platform_device *pdev)
> drm_panel_bridge_remove(priv->bridge);
> drm_mode_config_cleanup(drm);
> clk_disable_unprepare(priv->pclk);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
> index 3c45a3064726..d5e94eb7a4ca 100644
> --- a/drivers/gpu/drm/udl/udl_drv.c
> +++ b/drivers/gpu/drm/udl/udl_drv.c
> @@ -94,7 +94,7 @@ static int udl_usb_probe(struct usb_interface *interface,
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return r;
> }
>
> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
> index 94b99c90425a..259c85fcd32c 100644
> --- a/drivers/gpu/drm/vc4/vc4_drv.c
> +++ b/drivers/gpu/drm/vc4/vc4_drv.c
> @@ -312,7 +312,7 @@ static int vc4_drm_bind(struct device *dev)
> vc4_gem_destroy(drm);
> vc4_bo_cache_destroy(drm);
> dev_unref:
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -327,7 +327,7 @@ static void vc4_drm_unbind(struct device *dev)
>
> drm_mode_config_cleanup(drm);
>
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops vc4_drm_ops = {
> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> index 2524ff116f00..305f87665499 100644
> --- a/drivers/gpu/drm/vgem/vgem_drv.c
> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> @@ -505,7 +505,7 @@ static int __init vgem_init(void)
> static void __exit vgem_exit(void)
> {
> drm_dev_unregister(&vgem_device->drm);
> - drm_dev_unref(&vgem_device->drm);
> + drm_dev_put(&vgem_device->drm);
> }
>
> module_init(vgem_init);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> index 7df8d0c9026a..094b876f6da6 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c
> @@ -85,6 +85,6 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
> return 0;
>
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 6f4205e80378..02ae1caf6e8a 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -122,7 +122,7 @@ static int zx_drm_bind(struct device *dev)
> component_unbind_all(dev, drm);
> out_unregister:
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> return ret;
> }
>
> @@ -136,7 +136,7 @@ static void zx_drm_unbind(struct device *dev)
> drm_mode_config_cleanup(drm);
> component_unbind_all(dev, drm);
> dev_set_drvdata(dev, NULL);
> - drm_dev_unref(drm);
> + drm_dev_put(drm);
> }
>
> static const struct component_master_ops zx_drm_master_ops = {
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index d23dcdd1bd95..c16dd4424b8a 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -622,7 +622,6 @@ void drm_dev_unregister(struct drm_device *dev);
>
> void drm_dev_get(struct drm_device *dev);
> void drm_dev_put(struct drm_device *dev);
> -void drm_dev_unref(struct drm_device *dev);
> void drm_put_dev(struct drm_device *dev);
> void drm_dev_unplug(struct drm_device *dev);
>
> --
> 2.14.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 12:36 ` Daniel Vetter
(?)
@ 2018-04-26 12:45 ` Laurent Pinchart
-1 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2018-04-26 12:45 UTC (permalink / raw)
To: Daniel Vetter
Cc: matthias.bgg, alexandre.belloni, heiko, airlied, nouveau,
linus.walleij, stefan, virtualization, benjamin.gaignard,
shawnguo, marex, David1.Zhou, maxime.ripard, linux-samsung-soc,
jy0922.shim, linux, krzk, jonathanh, z.liuxinliang,
linux-rockchip, kong.kongxinwei, tomi.valkeinen, bskeggs,
puck.chen, ck.hu, airlied, linux-arm-msm, intel-gfx,
nicolas.ferre, etnaviv, brodkin, zourongrong, linux-mediatek,
dri-devel
Hi Daniel,
On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
> On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> > It's been a while since we introduced drm_dev{get/put} functions
> > to replace reference/unreference in drm subsystem for the
> > consistency purpose. So, with this patch, let's just replace
> > all current use cases of drm_dev_unref() with drm_dev_put and remove
> > the function itself.
> >
> > Coccinelle was used for mass-patching.
> >
> > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>
> Thanks for doing this. Unfortunately drm moves pretty fast, so already a
> conflict when I tried to apply this. Some drivers are also in their own
> trees, so this might lead to more fun :-/
>
> Can you pls split it up per-driver (just the directories under
> drivers/gpu/drm/ is enough)? Final patch to remove the function might then
> get stalled a bit ofc.
I requested a single patch instead of splitting it per driver, you might want
to blame me for that.
> Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
> remove that spatch hunk in the final patch, since we no longer need it?
How about just rerunning the coccinelle patch when it's time to apply this ?
There's precedent for performing such automated changes, and it would ensure
that no driver is left out.
> > ---
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> > drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> > drivers/gpu/drm/drm_drv.c | 13 -------------
> > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> > drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> > drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> > drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> > drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> > drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> > drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> > drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> > drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> > drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> > drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> > drivers/gpu/drm/stm/drv.c | 4 ++--
> > drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> > drivers/gpu/drm/tegra/drm.c | 4 ++--
> > drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> > drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> > drivers/gpu/drm/udl/udl_drv.c | 2 +-
> > drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> > drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> > drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> > drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> > include/drm/drm_drv.h | 1 -
> > 41 files changed, 73 insertions(+), 87 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <20180426123615.GA12521-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>]
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
[not found] ` <20180426123615.GA12521-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
@ 2018-04-26 12:45 ` Laurent Pinchart
2018-04-26 12:57 ` Vaishali Thakkar
2018-04-26 13:14 ` Alexandre Belloni
0 siblings, 2 replies; 22+ messages in thread
From: Laurent Pinchart @ 2018-04-26 12:45 UTC (permalink / raw)
To: Daniel Vetter
Cc: alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ,
heiko-4mtYJXux2i+zQB+pC5nmwQ, airlied-cv59FeDIM0c,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A, stefan-XLVq0VzYD2Y,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w,
kraxel-H+wXaHxf7aLQT0dZR+AlfA,
benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A, marex-ynQEQJNshbs,
David1.Zhou-5C7GfCeVMHo, maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ, linux-I+IVW8TIWO2tmTQ+vhA3Yw,
krzk-DgEjT+Ai2ygdnm+yROfE0A, jonathanh-DDmLM1+adcrQT0dZR+AlfA,
z.liuxinliang-C8/M+/jPZTeaMJb+Lgu22Q,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q,
tomi.valkeinen-l0cyMroinI0, bskeggs-H+wXaHxf7aLQT0dZR+AlfA,
puck.chen-C8/M+/jPZTeaMJb+Lgu22Q, ck.hu-NuS5LvNUpcJWk0Htik3J/w,
airlied-H+wXaHxf7aLQT0dZR+AlfA,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA,
etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
brodkin-HKixBCOQz3hWk0Htik3J/w,
zourongrong-Re5JQEeQqe8AvxtiuMwx3w,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hi Daniel,
On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
> On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> > It's been a while since we introduced drm_dev{get/put} functions
> > to replace reference/unreference in drm subsystem for the
> > consistency purpose. So, with this patch, let's just replace
> > all current use cases of drm_dev_unref() with drm_dev_put and remove
> > the function itself.
> >
> > Coccinelle was used for mass-patching.
> >
> > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>
> Thanks for doing this. Unfortunately drm moves pretty fast, so already a
> conflict when I tried to apply this. Some drivers are also in their own
> trees, so this might lead to more fun :-/
>
> Can you pls split it up per-driver (just the directories under
> drivers/gpu/drm/ is enough)? Final patch to remove the function might then
> get stalled a bit ofc.
I requested a single patch instead of splitting it per driver, you might want
to blame me for that.
> Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
> remove that spatch hunk in the final patch, since we no longer need it?
How about just rerunning the coccinelle patch when it's time to apply this ?
There's precedent for performing such automated changes, and it would ensure
that no driver is left out.
> > ---
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
> > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> > drivers/gpu/drm/armada/armada_drv.c | 6 +++---
> > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
> > drivers/gpu/drm/drm_drv.c | 13 -------------
> > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
> > drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
> > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
> > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
> > drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
> > drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
> > drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
> > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
> > drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
> > drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
> > drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
> > drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
> > drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
> > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
> > drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
> > drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
> > drivers/gpu/drm/stm/drv.c | 4 ++--
> > drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
> > drivers/gpu/drm/tegra/drm.c | 4 ++--
> > drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
> > drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
> > drivers/gpu/drm/udl/udl_drv.c | 2 +-
> > drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
> > drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
> > drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
> > drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
> > include/drm/drm_drv.h | 1 -
> > 41 files changed, 73 insertions(+), 87 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 12:45 ` Laurent Pinchart
@ 2018-04-26 12:57 ` Vaishali Thakkar
2018-04-26 13:14 ` Alexandre Belloni
1 sibling, 0 replies; 22+ messages in thread
From: Vaishali Thakkar @ 2018-04-26 12:57 UTC (permalink / raw)
To: Laurent Pinchart
Cc: alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ, Heiko Stuebner,
airlied-cv59FeDIM0c, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Linus Walleij, stefan-XLVq0VzYD2Y,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
Matthias Brugger, kraxel-H+wXaHxf7aLQT0dZR+AlfA,
Benjamin Gaignard, Marek Vašut, David1.Zhou-5C7GfCeVMHo,
maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ, linux-I+IVW8TIWO2tmTQ+vhA3Yw,
krzk-DgEjT+Ai2ygdnm+yROfE0A, jonathanh-DDmLM1+adcrQT0dZR+AlfA,
z.liuxinliang-C8/M+/jPZTeaMJb+Lgu22Q,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
kong.kongxinwei-C8/M+/jPZTeaMJb+Lgu22Q, Tomi Valkeinen,
bskeggs-H+wXaHxf7aLQT0dZR+AlfA, puck.chen-C8/M+/jPZTeaMJb+Lgu22Q,
CK HU, airlied-H+wXaHxf7aLQT0dZR+AlfA,
p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, nicolas.ferre
On Thu, Apr 26, 2018 at 6:15 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Daniel,
>
> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
>> On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
>> > It's been a while since we introduced drm_dev{get/put} functions
>> > to replace reference/unreference in drm subsystem for the
>> > consistency purpose. So, with this patch, let's just replace
>> > all current use cases of drm_dev_unref() with drm_dev_put and remove
>> > the function itself.
>> >
>> > Coccinelle was used for mass-patching.
>> >
>> > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>>
>> Thanks for doing this. Unfortunately drm moves pretty fast, so already a
>> conflict when I tried to apply this. Some drivers are also in their own
>> trees, so this might lead to more fun :-/
>>
>> Can you pls split it up per-driver (just the directories under
>> drivers/gpu/drm/ is enough)? Final patch to remove the function might then
>> get stalled a bit ofc.
>
> I requested a single patch instead of splitting it per driver, you might want
> to blame me for that.
>
>> Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
>> remove that spatch hunk in the final patch, since we no longer need it?
>
> How about just rerunning the coccinelle patch when it's time to apply this ?
> There's precedent for performing such automated changes, and it would ensure
> that no driver is left out.
I was planning to send patches to remove all remaining reference/unreference
functions by the weekend [as there aren't much remaining now and I see that
new drivers keeps adding them instead of new API]. So, wanted to delete whole
cocci file after that. I thought of dividing a patch per function because
Laurent requested to send a single patch for all files.
But if we are going to split it per driver under gpu/drm, would it work if per
driver patch contains all function cases? Also, would you be fine with taking a
patch for removal of coccinelle file via your tree? Then I can include that in
the same patchset as well.
Thanks!
>> > ---
>> >
>> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
>> > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
>> > drivers/gpu/drm/armada/armada_drv.c | 6 +++---
>> > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
>> > drivers/gpu/drm/drm_drv.c | 13 -------------
>> > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
>> > drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
>> > drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
>> > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
>> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
>> > drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
>> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
>> > drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
>> > drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
>> > drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
>> > drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
>> > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
>> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
>> > drivers/gpu/drm/stm/drv.c | 4 ++--
>> > drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
>> > drivers/gpu/drm/tegra/drm.c | 4 ++--
>> > drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
>> > drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
>> > drivers/gpu/drm/udl/udl_drv.c | 2 +-
>> > drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
>> > drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
>> > drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
>> > drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
>> > include/drm/drm_drv.h | 1 -
>> > 41 files changed, 73 insertions(+), 87 deletions(-)
>
> --
> Regards,
>
> Laurent Pinchart
>
>
>
--
Vaishali
http://vaishalithakkar.in/
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 12:57 ` Vaishali Thakkar
0 siblings, 0 replies; 22+ messages in thread
From: Vaishali Thakkar @ 2018-04-26 12:57 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Daniel Vetter, alexander.deucher, linux-renesas-soc,
alexandre.belloni, Heiko Stuebner, airlied, Linus Walleij,
stefan, hjc, kraxel, Benjamin Gaignard, nouveau,
Marek Vašut, David1.Zhou, linux-samsung-soc, jy0922.shim,
linux-rockchip, Tomi Valkeinen, linux, krzk, jonathanh,
z.liuxinliang, maxime.ripard, kong.kongxinwei, Kukjin Kim,
bskeggs, linux-arm-msm, CK HU, airlied, virtualization,
linux-tegra, puck.chen, intel-gfx, etnaviv, brodkin, dri-devel,
rodrigo.vivi, Matthias Brugger, wen, vincent.abriou,
linux-arm-kernel, inki.dae, amd-gfx, alison.wang, freedreno,
sw0312.kim, nicolas.ferre, Philippe Cornu,
Linux Kernel Mailing List, yannick.fertre, Kyungmin Park,
Noralf Trønnes, p.zabel, Zou Rongrong, linux-mediatek,
shawnguo, christian.koenig, l.stach
On Thu, Apr 26, 2018 at 6:15 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Daniel,
>
> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
>> On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
>> > It's been a while since we introduced drm_dev{get/put} functions
>> > to replace reference/unreference in drm subsystem for the
>> > consistency purpose. So, with this patch, let's just replace
>> > all current use cases of drm_dev_unref() with drm_dev_put and remove
>> > the function itself.
>> >
>> > Coccinelle was used for mass-patching.
>> >
>> > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>>
>> Thanks for doing this. Unfortunately drm moves pretty fast, so already a
>> conflict when I tried to apply this. Some drivers are also in their own
>> trees, so this might lead to more fun :-/
>>
>> Can you pls split it up per-driver (just the directories under
>> drivers/gpu/drm/ is enough)? Final patch to remove the function might then
>> get stalled a bit ofc.
>
> I requested a single patch instead of splitting it per driver, you might want
> to blame me for that.
>
>> Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and
>> remove that spatch hunk in the final patch, since we no longer need it?
>
> How about just rerunning the coccinelle patch when it's time to apply this ?
> There's precedent for performing such automated changes, and it would ensure
> that no driver is left out.
I was planning to send patches to remove all remaining reference/unreference
functions by the weekend [as there aren't much remaining now and I see that
new drivers keeps adding them instead of new API]. So, wanted to delete whole
cocci file after that. I thought of dividing a patch per function because
Laurent requested to send a single patch for all files.
But if we are going to split it per driver under gpu/drm, would it work if per
driver patch contains all function cases? Also, would you be fine with taking a
patch for removal of coccinelle file via your tree? Then I can include that in
the same patchset as well.
Thanks!
>> > ---
>> >
>> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
>> > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
>> > drivers/gpu/drm/armada/armada_drv.c | 6 +++---
>> > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
>> > drivers/gpu/drm/drm_drv.c | 13 -------------
>> > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++--
>> > drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 ++++----
>> > drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_request.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +-
>> > drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +-
>> > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++--
>> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++---
>> > drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
>> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++--
>> > drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +-
>> > drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
>> > drivers/gpu/drm/pl111/pl111_drv.c | 4 ++--
>> > drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
>> > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +-
>> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++--
>> > drivers/gpu/drm/sti/sti_drv.c | 8 ++++----
>> > drivers/gpu/drm/stm/drv.c | 4 ++--
>> > drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++--
>> > drivers/gpu/drm/tegra/drm.c | 4 ++--
>> > drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++---
>> > drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
>> > drivers/gpu/drm/udl/udl_drv.c | 2 +-
>> > drivers/gpu/drm/vc4/vc4_drv.c | 4 ++--
>> > drivers/gpu/drm/vgem/vgem_drv.c | 2 +-
>> > drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +-
>> > drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++--
>> > include/drm/drm_drv.h | 1 -
>> > 41 files changed, 73 insertions(+), 87 deletions(-)
>
> --
> Regards,
>
> Laurent Pinchart
>
>
>
--
Vaishali
http://vaishalithakkar.in/
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 12:45 ` Laurent Pinchart
@ 2018-04-26 13:14 ` Alexandre Belloni
2018-04-26 13:14 ` Alexandre Belloni
1 sibling, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2018-04-26 13:14 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Daniel Vetter, Vaishali Thakkar, alexander.deucher,
linux-renesas-soc, heiko, airlied, linus.walleij, stefan, hjc,
kraxel, benjamin.gaignard, nouveau, marex, David1.Zhou,
linux-samsung-soc, jy0922.shim, linux-rockchip, tomi.valkeinen,
linux, krzk, jonathanh, z.liuxinliang, maxime.ripard,
kong.kongxinwei, kgene, bskeggs, linux-arm-msm, ck.hu, airlied,
virtualization
Hi,
On 26/04/2018 15:45:44+0300, Laurent Pinchart wrote:
> Hi Daniel,
>
> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
> > On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> > > It's been a while since we introduced drm_dev{get/put} functions
> > > to replace reference/unreference in drm subsystem for the
> > > consistency purpose. So, with this patch, let's just replace
> > > all current use cases of drm_dev_unref() with drm_dev_put and remove
> > > the function itself.
> > >
> > > Coccinelle was used for mass-patching.
> > >
> > > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> >
> > Thanks for doing this. Unfortunately drm moves pretty fast, so already a
> > conflict when I tried to apply this. Some drivers are also in their own
> > trees, so this might lead to more fun :-/
> >
> > Can you pls split it up per-driver (just the directories under
> > drivers/gpu/drm/ is enough)? Final patch to remove the function might then
> > get stalled a bit ofc.
>
> I requested a single patch instead of splitting it per driver, you might want
> to blame me for that.
>
Doesn't splitting the change per driver break bisectability unless there
is a guarantee that the change in include/drm/drm_drv.h is applied after
all the driver trees have been merged?
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
@ 2018-04-26 13:14 ` Alexandre Belloni
0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2018-04-26 13:14 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Daniel Vetter, Vaishali Thakkar, alexander.deucher,
linux-renesas-soc, heiko, airlied, linus.walleij, stefan, hjc,
kraxel, benjamin.gaignard, nouveau, marex, David1.Zhou,
linux-samsung-soc, jy0922.shim, linux-rockchip, tomi.valkeinen,
linux, krzk, jonathanh, z.liuxinliang, maxime.ripard,
kong.kongxinwei, kgene, bskeggs, linux-arm-msm, ck.hu, airlied,
virtualization, linux-tegra, puck.chen, intel-gfx, etnaviv,
brodkin, dri-devel, rodrigo.vivi, matthias.bgg, wens,
vincent.abriou, linux-arm-kernel, inki.dae, amd-gfx, alison.wang,
freedreno, sw0312.kim, nicolas.ferre, philippe.cornu,
linux-kernel, yannick.fertre, kyungmin.park, noralf, p.zabel,
zourongrong, linux-mediatek, shawnguo, christian.koenig, l.stach
Hi,
On 26/04/2018 15:45:44+0300, Laurent Pinchart wrote:
> Hi Daniel,
>
> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
> > On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
> > > It's been a while since we introduced drm_dev{get/put} functions
> > > to replace reference/unreference in drm subsystem for the
> > > consistency purpose. So, with this patch, let's just replace
> > > all current use cases of drm_dev_unref() with drm_dev_put and remove
> > > the function itself.
> > >
> > > Coccinelle was used for mass-patching.
> > >
> > > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> >
> > Thanks for doing this. Unfortunately drm moves pretty fast, so already a
> > conflict when I tried to apply this. Some drivers are also in their own
> > trees, so this might lead to more fun :-/
> >
> > Can you pls split it up per-driver (just the directories under
> > drivers/gpu/drm/ is enough)? Final patch to remove the function might then
> > get stalled a bit ofc.
>
> I requested a single patch instead of splitting it per driver, you might want
> to blame me for that.
>
Doesn't splitting the change per driver break bisectability unless there
is a guarantee that the change in include/drm/drm_drv.h is applied after
all the driver trees have been merged?
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
2018-04-26 13:14 ` Alexandre Belloni
(?)
@ 2018-04-26 13:52 ` Daniel Vetter
-1 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-26 13:52 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Heiko Stübner, Dave Airlie, Nouveau Dev, Linus Walleij,
Stefan Agner, open list:VIRTIO CORE, NET...,
Matthias Brugger, Laurent Pinchart, Benjamin Gaignard,
Marek Vasut, Chunming Zhou, Maxime Ripard, linux-samsung-soc,
Joonyoung Shim, Russell King - ARM Linux, Krzysztof Kozlowski,
Jon Hunter, Xinliang Liu, open list:ARM/Rockchip SoC...
On Thu, Apr 26, 2018 at 3:14 PM, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> Hi,
>
> On 26/04/2018 15:45:44+0300, Laurent Pinchart wrote:
>> Hi Daniel,
>>
>> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
>> > On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
>> > > It's been a while since we introduced drm_dev{get/put} functions
>> > > to replace reference/unreference in drm subsystem for the
>> > > consistency purpose. So, with this patch, let's just replace
>> > > all current use cases of drm_dev_unref() with drm_dev_put and remove
>> > > the function itself.
>> > >
>> > > Coccinelle was used for mass-patching.
>> > >
>> > > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>> >
>> > Thanks for doing this. Unfortunately drm moves pretty fast, so already a
>> > conflict when I tried to apply this. Some drivers are also in their own
>> > trees, so this might lead to more fun :-/
>> >
>> > Can you pls split it up per-driver (just the directories under
>> > drivers/gpu/drm/ is enough)? Final patch to remove the function might then
>> > get stalled a bit ofc.
>>
>> I requested a single patch instead of splitting it per driver, you might want
>> to blame me for that.
>>
>
> Doesn't splitting the change per driver break bisectability unless there
> is a guarantee that the change in include/drm/drm_drv.h is applied after
> all the driver trees have been merged?
That's why I said the final patch will likely take a bit longer to get
merged, since we have to wait until all the trees converge again. But
since I have conflicts already looks like we can't take the shortcut
:-(
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 22+ messages in thread
[parent not found: <20180426131404.GP4813-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>]
* Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
[not found] ` <20180426131404.GP4813-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
@ 2018-04-26 13:52 ` Daniel Vetter
0 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-26 13:52 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Heiko Stübner, Dave Airlie, Nouveau Dev, Linus Walleij,
Stefan Agner, open list:VIRTIO CORE, NET...,
Matthias Brugger, Laurent Pinchart, Benjamin Gaignard,
Marek Vasut, Chunming Zhou, Maxime Ripard, linux-samsung-soc,
Joonyoung Shim, Russell King - ARM Linux, Krzysztof Kozlowski,
Jon Hunter, Xinliang Liu, open list:ARM/Rockchip SoC...
On Thu, Apr 26, 2018 at 3:14 PM, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> Hi,
>
> On 26/04/2018 15:45:44+0300, Laurent Pinchart wrote:
>> Hi Daniel,
>>
>> On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote:
>> > On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote:
>> > > It's been a while since we introduced drm_dev{get/put} functions
>> > > to replace reference/unreference in drm subsystem for the
>> > > consistency purpose. So, with this patch, let's just replace
>> > > all current use cases of drm_dev_unref() with drm_dev_put and remove
>> > > the function itself.
>> > >
>> > > Coccinelle was used for mass-patching.
>> > >
>> > > Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
>> >
>> > Thanks for doing this. Unfortunately drm moves pretty fast, so already a
>> > conflict when I tried to apply this. Some drivers are also in their own
>> > trees, so this might lead to more fun :-/
>> >
>> > Can you pls split it up per-driver (just the directories under
>> > drivers/gpu/drm/ is enough)? Final patch to remove the function might then
>> > get stalled a bit ofc.
>>
>> I requested a single patch instead of splitting it per driver, you might want
>> to blame me for that.
>>
>
> Doesn't splitting the change per driver break bisectability unless there
> is a guarantee that the change in include/drm/drm_drv.h is applied after
> all the driver trees have been merged?
That's why I said the final patch will likely take a bit longer to get
merged, since we have to wait until all the trees converge again. But
since I have conflicts already looks like we can't take the shortcut
:-(
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 22+ messages in thread