This patch set replaces functions named {un,reference} by their {put,get} counterparts. Each patch also removes the replaced functions from the DRM core and deletes them from the related Coccinelle script. Affected data types are struct drm_connector, struct drm_framebuffer, struct drm_gem_object, and struct drm_device.
This change fixes the related item on the DRM TODO list.
With the reference-counting functions being named {put,get}, the DRM interface is more aligned to Linux kernel nameing standard. The patch set does not change driver-internal interfaces.
Possible future changes: Most of DRM's remaining {un/ref} functions perform additional tasks besides reference counting and should probably not be renamed. Exceptions are ttm_bo_{reference,unref} and ttm_object_file_{un/ref}. These functions mostly perform reference counting, but would require additional changes to the calling code besides renaming.
Thomas Zimmermann (7): drm: Replace drm_connector_{un/reference} with drm_connector_{put,get} drm: Replace drm_framebuffer_{un/reference} with drm_framebuffer_{put,get} drm: Replace drm_gem_object_{un/reference} with drm_gem_object_{put,get} drm: Replace __drm_gem_object_unreference with __drm_gem_object_put drm: Replace drm_gem_object_unreference_unlocked with put function drm: Replace drm_dev_unref with drm_dev_put drm: Clean up after DRM put/get conversion
Documentation/gpu/todo.rst | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +- drivers/gpu/drm/arc/arcpgu_drv.c | 8 +-- drivers/gpu/drm/armada/armada_crtc.c | 8 +-- drivers/gpu/drm/armada/armada_drv.c | 6 +- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 +-- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c | 10 +-- drivers/gpu/drm/drm_drv.c | 13 ---- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 +-- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 10 +-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 +-- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 6 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 +-- drivers/gpu/drm/i915/i915_gem_object.h | 13 +--- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_context.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 | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_power.c | 2 +- drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +- drivers/gpu/drm/msm/msm_drv.c | 8 +-- drivers/gpu/drm/msm/msm_gem_submit.c | 4 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 +-- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 ++-- drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 14 ++-- 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 | 10 +-- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +- drivers/gpu/drm/tegra/drm.c | 8 +-- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +- drivers/gpu/drm/tve200/tve200_drv.c | 10 +-- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 +-- 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_connector.h | 24 ------- include/drm/drm_drv.h | 1 - include/drm/drm_framebuffer.h | 24 ------- include/drm/drm_gem.h | 50 -------------- scripts/coccinelle/api/drm-get-put.cocci | 78 ---------------------- 75 files changed, 156 insertions(+), 372 deletions(-) delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
-- 2.14.4
This patch unifies the naming of DRM functions for reference counting of struct drm_connector. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old functions and removes them from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/i915/intel_display.c | 4 ++-- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- include/drm/drm_connector.h | 24 ------------------------ scripts/coccinelle/api/drm-get-put.cocci | 10 ---------- 5 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index ed29219b1676..94f4794ab965 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -10691,7 +10691,7 @@ static void intel_modeset_update_connector_atomic_state(struct drm_device *dev) drm_connector_list_iter_begin(dev, &conn_iter); for_each_intel_connector_iter(connector, &conn_iter) { if (connector->base.state->crtc) - drm_connector_unreference(&connector->base); + drm_connector_put(&connector->base);
if (connector->base.encoder) { connector->base.state->best_encoder = @@ -10699,7 +10699,7 @@ static void intel_modeset_update_connector_atomic_state(struct drm_device *dev) connector->base.state->crtc = connector->base.encoder->crtc;
- drm_connector_reference(&connector->base); + drm_connector_get(&connector->base); } else { connector->base.state->best_encoder = NULL; connector->base.state->crtc = NULL; diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 9e6956c08688..b8c12b0fffff 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -518,7 +518,7 @@ static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr, intel_connector->mst_port = NULL; drm_modeset_unlock(&connector->dev->mode_config.connection_mutex);
- drm_connector_unreference(connector); + drm_connector_put(connector); }
static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index b83465ae7c1b..1f8bba8f6528 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1007,7 +1007,7 @@ nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr, mstc->port = NULL; drm_modeset_unlock(&drm->dev->mode_config.connection_mutex);
- drm_connector_unreference(&mstc->connector); + drm_connector_put(&mstc->connector); }
static void diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index ee4c48218c85..28f2997063bf 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1059,30 +1059,6 @@ static inline void drm_connector_put(struct drm_connector *connector) drm_mode_object_put(&connector->base); }
-/** - * drm_connector_reference - acquire a connector reference - * @connector: DRM connector - * - * This is a compatibility alias for drm_connector_get() and should not be - * used by new code. - */ -static inline void drm_connector_reference(struct drm_connector *connector) -{ - drm_connector_get(connector); -} - -/** - * drm_connector_unreference - release a connector reference - * @connector: DRM connector - * - * This is a compatibility alias for drm_connector_put() and should not be - * used by new code. - */ -static inline void drm_connector_unreference(struct drm_connector *connector) -{ - drm_connector_put(connector); -} - const char *drm_get_connector_status_name(enum drm_connector_status status); const char *drm_get_subpixel_order_name(enum subpixel_order order); const char *drm_get_dpms_name(int val); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 3a09c97ad87d..1b1c5344b07f 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,12 +16,6 @@ expression object; @@
( -- drm_connector_reference(object) -+ drm_connector_get(object) -| -- drm_connector_unreference(object) -+ drm_connector_put(object) -| - drm_framebuffer_reference(object) + drm_framebuffer_get(object) | @@ -50,10 +44,6 @@ position p; @@
( -drm_connector_unreference@p(object) -| -drm_connector_reference@p(object) -| drm_framebuffer_unreference@p(object) | drm_framebuffer_reference@p(object)
This patch unifies the naming of DRM functions for reference counting of struct drm_framebuffer. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old functions and removes them from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/armada/armada_crtc.c | 8 ++++---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- include/drm/drm_framebuffer.h | 24 ------------------------ scripts/coccinelle/api/drm-get-put.cocci | 10 ---------- 7 files changed, 9 insertions(+), 43 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 03eeee11dd5b..38724b554a54 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -1220,7 +1220,7 @@ static int armada_drm_primary_update(struct drm_plane *plane, * Take a reference on the new framebuffer - we want to * hold on to it while the hardware is displaying it. */ - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb);
work->old_fb = plane->fb; } else { @@ -1239,7 +1239,7 @@ static int armada_drm_primary_update(struct drm_plane *plane, if (!dplane->state.vsync_update) { work->fn(dcrtc, work); if (work->old_fb) - drm_framebuffer_unreference(work->old_fb); + drm_framebuffer_put(work->old_fb); return 0; }
@@ -1248,7 +1248,7 @@ static int armada_drm_primary_update(struct drm_plane *plane, if (ret) { work->fn(dcrtc, work); if (work->old_fb) - drm_framebuffer_unreference(work->old_fb); + drm_framebuffer_put(work->old_fb); }
dplane->next_work = !dplane->next_work; @@ -1308,7 +1308,7 @@ int armada_drm_plane_disable(struct drm_plane *plane, if (armada_drm_plane_work_queue(dcrtc, work)) { work->fn(dcrtc, work); if (work->old_fb) - drm_framebuffer_unreference(work->old_fb); + drm_framebuffer_put(work->old_fb); }
dplane->next_work = !dplane->next_work; diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index c391955009d6..bb2874d84d74 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -228,7 +228,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, * Take a reference on the new framebuffer - we want to * hold on to it while the hardware is displaying it. */ - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb);
work->old_fb = plane->fb; } else { diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 38a2a7f1204b..7098c6d35266 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -132,7 +132,7 @@ static void exynos_drm_plane_reset(struct drm_plane *plane) if (plane->state) { exynos_state = to_exynos_plane_state(plane->state); if (exynos_state->base.fb) - drm_framebuffer_unreference(exynos_state->base.fb); + drm_framebuffer_put(exynos_state->base.fb); kfree(exynos_state); plane->state = NULL; } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 36aa1738b67a..96af796abc05 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -185,7 +185,7 @@ static void mdp5_plane_reset(struct drm_plane *plane) struct mdp5_plane_state *mdp5_state;
if (plane->state && plane->state->fb) - drm_framebuffer_unreference(plane->state->fb); + drm_framebuffer_put(plane->state->fb);
kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); @@ -228,7 +228,7 @@ static void mdp5_plane_destroy_state(struct drm_plane *plane, struct mdp5_plane_state *pstate = to_mdp5_plane_state(state);
if (state->fb) - drm_framebuffer_unreference(state->fb); + drm_framebuffer_put(state->fb);
kfree(pstate); } diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 85c1f10bc2b6..844498c4267c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -429,7 +429,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon) nouveau_vma_del(&nouveau_fb->vma); nouveau_bo_unmap(nouveau_fb->nvbo); nouveau_bo_unpin(nouveau_fb->nvbo); - drm_framebuffer_unreference(&nouveau_fb->base); + drm_framebuffer_put(&nouveau_fb->base); }
return 0; diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h index c50502c656e5..c94acedfb08e 100644 --- a/include/drm/drm_framebuffer.h +++ b/include/drm/drm_framebuffer.h @@ -240,30 +240,6 @@ static inline void drm_framebuffer_put(struct drm_framebuffer *fb) drm_mode_object_put(&fb->base); }
-/** - * drm_framebuffer_reference - acquire a framebuffer reference - * @fb: DRM framebuffer - * - * This is a compatibility alias for drm_framebuffer_get() and should not be - * used by new code. - */ -static inline void drm_framebuffer_reference(struct drm_framebuffer *fb) -{ - drm_framebuffer_get(fb); -} - -/** - * drm_framebuffer_unreference - release a framebuffer reference - * @fb: DRM framebuffer - * - * This is a compatibility alias for drm_framebuffer_put() and should not be - * used by new code. - */ -static inline void drm_framebuffer_unreference(struct drm_framebuffer *fb) -{ - drm_framebuffer_put(fb); -} - /** * drm_framebuffer_read_refcount - read the framebuffer reference count. * @fb: framebuffer diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 1b1c5344b07f..1bfebbe9c4ff 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,12 +16,6 @@ expression object; @@
( -- drm_framebuffer_reference(object) -+ drm_framebuffer_get(object) -| -- drm_framebuffer_unreference(object) -+ drm_framebuffer_put(object) -| - drm_gem_object_reference(object) + drm_gem_object_get(object) | @@ -44,10 +38,6 @@ position p; @@
( -drm_framebuffer_unreference@p(object) -| -drm_framebuffer_reference@p(object) -| drm_gem_object_unreference@p(object) | drm_gem_object_reference@p(object)
This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old functions and removes them from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/i915/i915_gem_object.h | 8 +------- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 ++-- drivers/gpu/drm/msm/adreno/a5xx_power.c | 2 +- drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 2 +- drivers/gpu/drm/msm/msm_gem_submit.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +- include/drm/drm_gem.h | 24 ------------------------ scripts/coccinelle/api/drm-get-put.cocci | 10 ---------- 8 files changed, 8 insertions(+), 48 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_object.h b/drivers/gpu/drm/i915/i915_gem_object.h index 54f00b350779..da6e849f41a4 100644 --- a/drivers/gpu/drm/i915/i915_gem_object.h +++ b/drivers/gpu/drm/i915/i915_gem_object.h @@ -337,13 +337,10 @@ __attribute__((nonnull)) static inline struct drm_i915_gem_object * i915_gem_object_get(struct drm_i915_gem_object *obj) { - drm_gem_object_reference(&obj->base); + drm_gem_object_get(&obj->base); return obj; }
-__deprecated -extern void drm_gem_object_reference(struct drm_gem_object *); - __attribute__((nonnull)) static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) @@ -351,9 +348,6 @@ i915_gem_object_put(struct drm_i915_gem_object *obj) __drm_gem_object_unreference(&obj->base); }
-__deprecated -extern void drm_gem_object_unreference(struct drm_gem_object *); - __deprecated extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *);
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c index 059ec7d394d0..d2127b1c4ece 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c @@ -132,14 +132,14 @@ reset_set(void *data, u64 val) if (a5xx_gpu->pm4_bo) { if (a5xx_gpu->pm4_iova) msm_gem_put_iova(a5xx_gpu->pm4_bo, gpu->aspace); - drm_gem_object_unreference(a5xx_gpu->pm4_bo); + drm_gem_object_put(a5xx_gpu->pm4_bo); a5xx_gpu->pm4_bo = NULL; }
if (a5xx_gpu->pfp_bo) { if (a5xx_gpu->pfp_iova) msm_gem_put_iova(a5xx_gpu->pfp_bo, gpu->aspace); - drm_gem_object_unreference(a5xx_gpu->pfp_bo); + drm_gem_object_put(a5xx_gpu->pfp_bo); a5xx_gpu->pfp_bo = NULL; }
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c b/drivers/gpu/drm/msm/adreno/a5xx_power.c index e9c0e56dbec0..7a41e1c147e4 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_power.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c @@ -323,7 +323,7 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu) if (a5xx_gpu->gpmu_iova) msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->aspace); if (a5xx_gpu->gpmu_bo) - drm_gem_object_unreference(a5xx_gpu->gpmu_bo); + drm_gem_object_put(a5xx_gpu->gpmu_bo);
a5xx_gpu->gpmu_bo = NULL; a5xx_gpu->gpmu_iova = 0; diff --git a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c index 970c7963ae29..f3c21f827a4d 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c @@ -272,7 +272,7 @@ void a5xx_preempt_fini(struct msm_gpu *gpu) if (a5xx_gpu->preempt_iova[i]) msm_gem_put_iova(a5xx_gpu->preempt_bo[i], gpu->aspace);
- drm_gem_object_unreference(a5xx_gpu->preempt_bo[i]); + drm_gem_object_put(a5xx_gpu->preempt_bo[i]); a5xx_gpu->preempt_bo[i] = NULL; } } diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 7bd83e0afa97..7a7923e6220d 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -144,7 +144,7 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, goto out_unlock; }
- drm_gem_object_reference(obj); + drm_gem_object_get(obj);
submit->bos[i].obj = msm_obj;
@@ -396,7 +396,7 @@ static void submit_cleanup(struct msm_gem_submit *submit) struct msm_gem_object *msm_obj = submit->bos[i].obj; submit_unlock_unpin_bo(submit, i, false); list_del_init(&msm_obj->submit_entry); - drm_gem_object_unreference(&msm_obj->base); + drm_gem_object_put(&msm_obj->base); }
ww_acquire_fini(&submit->ticket); diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c index 8e41d649e248..1a73c9887cd3 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c @@ -187,7 +187,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, * Importing dmabuf exported from out own gem increases * refcount on gem itself instead of f_count of dmabuf. */ - drm_gem_object_reference(obj); + drm_gem_object_get(obj); return obj; } } diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 3583b98a1718..43465aa4eb73 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -222,18 +222,6 @@ __drm_gem_object_put(struct drm_gem_object *obj) void drm_gem_object_put_unlocked(struct drm_gem_object *obj); void drm_gem_object_put(struct drm_gem_object *obj);
-/** - * drm_gem_object_reference - acquire a GEM buffer object reference - * @obj: GEM buffer object - * - * This is a compatibility alias for drm_gem_object_get() and should not be - * used by new code. - */ -static inline void drm_gem_object_reference(struct drm_gem_object *obj) -{ - drm_gem_object_get(obj); -} - /** * __drm_gem_object_unreference - raw function to release a GEM buffer object * reference @@ -260,18 +248,6 @@ drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) drm_gem_object_put_unlocked(obj); }
-/** - * drm_gem_object_unreference - release a GEM buffer object reference - * @obj: GEM buffer object - * - * This is a compatibility alias for drm_gem_object_put() and should not be - * used by new code. - */ -static inline void drm_gem_object_unreference(struct drm_gem_object *obj) -{ - drm_gem_object_put(obj); -} - int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 1bfebbe9c4ff..c37aa5beca77 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,12 +16,6 @@ expression object; @@
( -- drm_gem_object_reference(object) -+ drm_gem_object_get(object) -| -- drm_gem_object_unreference(object) -+ drm_gem_object_put(object) -| - __drm_gem_object_unreference(object) + __drm_gem_object_put(object) | @@ -38,10 +32,6 @@ position p; @@
( -drm_gem_object_unreference@p(object) -| -drm_gem_object_reference@p(object) -| __drm_gem_object_unreference(object) | drm_gem_object_unreference_unlocked(object)
This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/i915/i915_gem_object.h | 2 +- include/drm/drm_gem.h | 13 ------------- scripts/coccinelle/api/drm-get-put.cocci | 5 ----- 3 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_object.h b/drivers/gpu/drm/i915/i915_gem_object.h index da6e849f41a4..0042496216fe 100644 --- a/drivers/gpu/drm/i915/i915_gem_object.h +++ b/drivers/gpu/drm/i915/i915_gem_object.h @@ -345,7 +345,7 @@ __attribute__((nonnull)) static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) { - __drm_gem_object_unreference(&obj->base); + __drm_gem_object_put(&obj->base); }
__deprecated diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 43465aa4eb73..2c3f04e071cf 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -222,19 +222,6 @@ __drm_gem_object_put(struct drm_gem_object *obj) void drm_gem_object_put_unlocked(struct drm_gem_object *obj); void drm_gem_object_put(struct drm_gem_object *obj);
-/** - * __drm_gem_object_unreference - raw function to release a GEM buffer object - * reference - * @obj: GEM buffer object - * - * This is a compatibility alias for __drm_gem_object_put() and should not be - * used by new code. - */ -static inline void __drm_gem_object_unreference(struct drm_gem_object *obj) -{ - __drm_gem_object_put(obj); -} - /** * drm_gem_object_unreference_unlocked - release a GEM buffer object reference * @obj: GEM buffer object diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index c37aa5beca77..4a948790b83c 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,9 +16,6 @@ expression object; @@
( -- __drm_gem_object_unreference(object) -+ __drm_gem_object_put(object) -| - drm_gem_object_unreference_unlocked(object) + drm_gem_object_put_unlocked(object) | @@ -32,8 +29,6 @@ position p; @@
( -__drm_gem_object_unreference(object) -| drm_gem_object_unreference_unlocked(object) | drm_dev_unref@p(object)
This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 10 +++++----- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 6 +++--- drivers/gpu/drm/i915/i915_gem_object.h | 3 --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 ++++---- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 +++++++------- drivers/gpu/drm/omapdrm/omap_drv.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 4 ++-- include/drm/drm_gem.h | 13 ------------- scripts/coccinelle/api/drm-get-put.cocci | 5 ----- 18 files changed, 35 insertions(+), 56 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 14eb8d0d5a00..6f0cf363371d 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c @@ -144,7 +144,7 @@ static int bochs_fbdev_destroy(struct bochs_device *bochs) drm_fb_helper_unregister_fbi(&bochs->fb.helper);
if (gfb->obj) { - drm_gem_object_unreference_unlocked(gfb->obj); + drm_gem_object_put_unlocked(gfb->obj); gfb->obj = NULL; }
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index 39cd08416773..032f418e407d 100644 --- a/drivers/gpu/drm/bochs/bochs_mm.c +++ b/drivers/gpu/drm/bochs/bochs_mm.c @@ -414,7 +414,7 @@ int bochs_dumb_create(struct drm_file *file, struct drm_device *dev, return ret;
ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); + drm_gem_object_put_unlocked(gobj); if (ret) return ret;
@@ -454,7 +454,7 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, bo = gem_to_bochs_bo(obj); *offset = bochs_bo_mmap_offset(bo);
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; }
@@ -464,7 +464,7 @@ static void bochs_user_framebuffer_destroy(struct drm_framebuffer *fb) { struct bochs_framebuffer *bochs_fb = to_bochs_framebuffer(fb);
- drm_gem_object_unreference_unlocked(bochs_fb->obj); + drm_gem_object_put_unlocked(bochs_fb->obj); drm_framebuffer_cleanup(fb); kfree(fb); } @@ -515,13 +515,13 @@ bochs_user_framebuffer_create(struct drm_device *dev,
bochs_fb = kzalloc(sizeof(*bochs_fb), GFP_KERNEL); if (!bochs_fb) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ERR_PTR(-ENOMEM); }
ret = bochs_framebuffer_init(dev, bochs_fb, mode_cmd, obj); if (ret) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); kfree(bochs_fb); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 7fcc1a7ab1a0..27b7d34d776c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c @@ -138,7 +138,7 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
err: while (i--) - drm_gem_object_unreference_unlocked(&exynos_gem[i]->base); + drm_gem_object_put_unlocked(&exynos_gem[i]->base);
return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 6e1494fa71b4..bdf5a7655228 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -143,7 +143,7 @@ static int exynos_drm_gem_handle_create(struct drm_gem_object *obj, DRM_DEBUG_KMS("gem handle = 0x%x\n", *handle);
/* drop reference from allocate - handle holds it now. */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
return 0; } @@ -186,7 +186,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
exynos_gem = to_exynos_gem(obj);
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
return exynos_gem->size; } @@ -329,13 +329,13 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, return; }
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
/* * decrease obj->refcount one more time because we has already * increased it at exynos_drm_gem_get_dma_addr(). */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); }
static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, @@ -383,7 +383,7 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, args->flags = exynos_gem->flags; args->size = exynos_gem->size;
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
return 0; } diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 8fa4ef192c1e..2f00a37684a2 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -517,7 +517,7 @@ static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev) drm_framebuffer_cleanup(&psbfb->base);
if (psbfb->base.obj[0]) - drm_gem_object_unreference_unlocked(psbfb->base.obj[0]); + drm_gem_object_put_unlocked(psbfb->base.obj[0]); return 0; }
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 131239759a75..913bf4c256fa 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -93,7 +93,7 @@ int psb_gem_create(struct drm_file *file, struct drm_device *dev, u64 size, return ret; } /* We have the initial and handle reference but need only one now */ - drm_gem_object_unreference_unlocked(&r->gem); + drm_gem_object_put_unlocked(&r->gem); *handlep = handle; return 0; } diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index c8f071c47daf..015dc9f9348d 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -353,7 +353,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put_unlocked(gma_crtc->cursor_obj); gma_crtc->cursor_obj = NULL; } return 0; @@ -429,7 +429,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, if (gma_crtc->cursor_obj) { gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put_unlocked(gma_crtc->cursor_obj); }
gma_crtc->cursor_obj = obj; @@ -437,7 +437,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, return ret;
unref_cursor: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return ret; }
diff --git a/drivers/gpu/drm/i915/i915_gem_object.h b/drivers/gpu/drm/i915/i915_gem_object.h index 0042496216fe..c3c6f2e588fb 100644 --- a/drivers/gpu/drm/i915/i915_gem_object.h +++ b/drivers/gpu/drm/i915/i915_gem_object.h @@ -348,9 +348,6 @@ i915_gem_object_put(struct drm_i915_gem_object *obj) __drm_gem_object_put(&obj->base); }
-__deprecated -extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *); - static inline void i915_gem_object_lock(struct drm_i915_gem_object *obj) { reservation_object_lock(obj->resv, NULL); diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 6aa6ee16dcbd..2c569e264df3 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -1017,7 +1017,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); nv_crtc->cursor.show(nv_crtc, true); out: - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ret; }
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index e2211bb2cf79..e67a471331b5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -139,7 +139,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, if (chan->ntfy) { nouveau_vma_del(&chan->ntfy_vma); nouveau_bo_unpin(chan->ntfy); - drm_gem_object_unreference_unlocked(&chan->ntfy->gem); + drm_gem_object_put_unlocked(&chan->ntfy->gem); }
if (chan->heap.block_size) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 774b429142bc..dfa236370726 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -205,7 +205,7 @@ nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb) struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb);
if (fb->nvbo) - drm_gem_object_unreference_unlocked(&fb->nvbo->gem); + drm_gem_object_put_unlocked(&fb->nvbo->gem);
drm_framebuffer_cleanup(drm_fb); kfree(fb); @@ -287,7 +287,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev, if (ret == 0) return &fb->base;
- drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ERR_PTR(ret); }
@@ -939,7 +939,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, return ret;
ret = drm_gem_handle_create(file_priv, &bo->gem, &args->handle); - drm_gem_object_unreference_unlocked(&bo->gem); + drm_gem_object_put_unlocked(&bo->gem); return ret; }
@@ -954,7 +954,7 @@ nouveau_display_dumb_map_offset(struct drm_file *file_priv, if (gem) { struct nouveau_bo *bo = nouveau_gem_object(gem); *poffset = drm_vma_node_offset_addr(&bo->bo.vma_node); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return 0; }
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 300daee74209..df73bec354e8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -274,7 +274,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, }
/* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unlocked(&nvbo->gem); return ret; }
@@ -354,7 +354,7 @@ validate_fini_no_ticket(struct validate_op *op, struct nouveau_fence *fence, list_del(&nvbo->entry); nvbo->reserved_by = NULL; ttm_bo_unreserve(&nvbo->bo); - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unlocked(&nvbo->gem); } }
@@ -400,14 +400,14 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, nvbo = nouveau_gem_object(gem); if (nvbo == res_bo) { res_bo = NULL; - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); continue; }
if (nvbo->reserved_by && nvbo->reserved_by == file_priv) { NV_PRINTK(err, cli, "multiple instances of buffer %d on " "validation list\n", b->handle); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); ret = -EINVAL; break; } @@ -894,7 +894,7 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data, ret = lret;
nouveau_bo_sync_for_cpu(nvbo); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem);
return ret; } @@ -913,7 +913,7 @@ nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data, nvbo = nouveau_gem_object(gem);
nouveau_bo_sync_for_device(nvbo); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return 0; }
@@ -930,7 +930,7 @@ nouveau_gem_ioctl_info(struct drm_device *dev, void *data, return -ENOENT;
ret = nouveau_gem_info(file_priv, gem, req); - drm_gem_object_unreference_unlocked(gem); + drm_gem_object_put_unlocked(gem); return ret; }
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index ef3b0e3571ec..926b765dde68 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -428,7 +428,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data, args->size = omap_gem_mmap_size(obj); args->offset = omap_gem_mmap_offset(obj);
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
return ret; } diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 9f1e3d8f8488..4d264fd554d8 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -319,7 +319,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
error: while (--i >= 0) - drm_gem_object_unreference_unlocked(bos[i]); + drm_gem_object_put_unlocked(bos[i]);
return fb; } diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 0f66c74a54b0..853448dbeeca 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -150,7 +150,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, /* note: if fb creation failed, we can't rely on fb destroy * to unref the bo: */ - drm_gem_object_unreference_unlocked(fbdev->bo); + drm_gem_object_put_unlocked(fbdev->bo); ret = PTR_ERR(fb); goto fail; } diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 0faf042b82e1..9d026ecb8617 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -664,7 +664,7 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
*offset = omap_gem_mmap_offset(obj);
- drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
fail: return ret; @@ -1298,7 +1298,7 @@ int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file, }
/* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj);
return 0; } diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 2c3f04e071cf..daa34328b5be 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -222,19 +222,6 @@ __drm_gem_object_put(struct drm_gem_object *obj) void drm_gem_object_put_unlocked(struct drm_gem_object *obj); void drm_gem_object_put(struct drm_gem_object *obj);
-/** - * drm_gem_object_unreference_unlocked - release a GEM buffer object reference - * @obj: GEM buffer object - * - * This is a compatibility alias for drm_gem_object_put_unlocked() and should - * not be used by new code. - */ -static inline void -drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) -{ - drm_gem_object_put_unlocked(obj); -} - int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 4a948790b83c..5339a8e0d76a 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,9 +16,6 @@ expression object; @@
( -- drm_gem_object_unreference_unlocked(object) -+ drm_gem_object_put_unlocked(object) -| - drm_dev_unref(object) + drm_dev_put(object) ) @@ -29,8 +26,6 @@ position p; @@
( -drm_gem_object_unreference_unlocked(object) -| drm_dev_unref@p(object) )
This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- drivers/gpu/drm/arc/arcpgu_drv.c | 8 ++++---- drivers/gpu/drm/armada/armada_drv.c | 6 +++--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 ++++---- drivers/gpu/drm/drm_drv.c | 13 ------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 ++++---- 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_context.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 | 8 ++++---- 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 | 14 +++++++------- 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 | 10 +++++----- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++--- drivers/gpu/drm/tve200/tve200_drv.c | 10 +++++----- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 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 - scripts/coccinelle/api/drm-get-put.cocci | 3 --- 43 files changed, 99 insertions(+), 116 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bf2f24da48..cf5b18e7d8db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -664,7 +664,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; }
@@ -674,7 +674,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..27d426bf7d01 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -204,7 +204,7 @@ static int arcpgu_probe(struct platform_device *pdev)
ret = arcpgu_load(drm); if (ret) - goto err_unref; + goto err_put;
ret = drm_dev_register(drm, 0); if (ret) @@ -215,8 +215,8 @@ static int arcpgu_probe(struct platform_device *pdev) err_unload: arcpgu_unload(drm);
-err_unref: - drm_dev_unref(drm); +err_put: + 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 843cac222e60..fedbfa333bb0 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -763,7 +763,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
ret = atmel_hlcdc_dc_load(ddev); if (ret) - goto err_unref; + goto err_put;
ret = drm_dev_register(ddev, 0); if (ret) @@ -774,8 +774,8 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) err_unload: atmel_hlcdc_dc_unload(ddev);
-err_unref: - drm_dev_unref(ddev); +err_put: + drm_dev_put(ddev);
return ret; } @@ -786,7 +786,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 7af748ed1c58..642503fb1046 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -696,19 +696,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 e5013a999147..35285c0aeeac 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -524,7 +524,7 @@ static int etnaviv_bind(struct device *dev) if (!priv) { dev_err(dev, "failed to allocate private data\n"); ret = -ENOMEM; - goto out_unref; + goto out_put; } drm->dev_private = priv;
@@ -550,8 +550,8 @@ static int etnaviv_bind(struct device *dev) component_unbind_all(dev, drm); out_bind: kfree(priv); -out_unref: - drm_dev_unref(drm); +out_put: + drm_dev_put(drm);
return ret; } @@ -568,7 +568,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 a81b4a5e24a7..ed3cc2989f93 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -420,7 +420,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; } @@ -444,7 +444,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..0496be5212e1 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -353,12 +353,12 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
ret = drm_dev_register(drm, 0); if (ret < 0) - goto unref; + goto put;
return 0;
-unref: - drm_dev_unref(drm); +put: + 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 7846ea4a99bc..da8c70dd70b4 100644 --- a/drivers/gpu/drm/i915/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c @@ -1724,7 +1724,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_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 708e8d721448..3a977bb5a33e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -586,7 +586,7 @@ int i915_gem_context_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_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 2dc72a984d45..8059268800fa 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 f80cf7ce3fa9..4e7bea6eff36 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1650,7 +1650,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 2b2dde94526f..549707b9d738 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 a3a89aadeccb..d246059338e9 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 8400a8cc5cf2..ffa74290e054 100644 --- a/drivers/gpu/drm/i915/selftests/i915_vma.c +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c @@ -733,7 +733,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 d6926e7820e5..f03b407fdbe2 100644 --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c @@ -464,7 +464,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..c895fe78fb48 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -229,7 +229,7 @@ static int imx_drm_bind(struct device *dev) imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL); if (!imxdrm) { ret = -ENOMEM; - goto err_unref; + goto err_put; }
imxdrm->drm = drm; @@ -306,8 +306,8 @@ static int imx_drm_bind(struct device *dev) component_unbind_all(drm->dev, drm); err_kms: drm_mode_config_cleanup(drm); -err_unref: - drm_dev_unref(drm); +err_put: + 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 021a0b6f9a59..8b96976c6b40 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -261,7 +261,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);
@@ -369,7 +369,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; }
@@ -379,7 +379,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 ffe5137ccaf8..4039f11b2b7b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -398,7 +398,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; } @@ -409,7 +409,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 926b765dde68..6042f77450a6 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -601,7 +601,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(); @@ -630,7 +630,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 454ff0804642..07e0aa573c1f 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -301,13 +301,13 @@ static int pl111_amba_probe(struct amba_device *amba_dev, if (IS_ERR(priv->regs)) { dev_err(dev, "%s failed mmio\n", __func__); ret = PTR_ERR(priv->regs); - goto dev_unref; + goto dev_put; }
/* This may override some variant settings */ ret = pl111_versatile_init(dev, priv); if (ret) - goto dev_unref; + goto dev_put;
/* turn off interrupts before requesting the irq */ writel(0, priv->regs + priv->ienb); @@ -321,16 +321,16 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
ret = pl111_modeset_init(drm); if (ret != 0) - goto dev_unref; + goto dev_put;
ret = drm_dev_register(drm, 0); if (ret < 0) - goto dev_unref; + goto dev_put;
return 0;
-dev_unref: - drm_dev_unref(drm); +dev_put: + drm_dev_put(drm); of_reserved_mem_device_release(dev);
return ret; @@ -347,7 +347,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); of_reserved_mem_device_release(dev);
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 02aee6cb0e53..9696a3030319 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -407,7 +407,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 90c46b49c931..832fc43960ee 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -224,7 +224,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) @@ -248,8 +248,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; }
@@ -259,7 +259,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 8698e08313e1..f2021b23554d 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -148,16 +148,16 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
ret = drv_load(ddev); if (ret) - goto err_unref; + goto err_put;
ret = drm_dev_register(ddev, 0); if (ret) - goto err_unref; + goto err_put;
return 0;
-err_unref: - drm_dev_unref(ddev); +err_put: + drm_dev_put(ddev);
return ret; } @@ -170,7 +170,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 776c1513e582..4a9e24fa195a 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1189,12 +1189,12 @@ static int host1x_drm_probe(struct host1x_device *dev)
err = drm_dev_register(drm, 0); if (err < 0) - goto unref; + goto put;
return 0;
-unref: - drm_dev_unref(drm); +put: + drm_dev_put(drm); return err; }
@@ -1203,7 +1203,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 24a33bf862fa..09526ab482c3 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..18e9c8e709f9 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -198,12 +198,12 @@ static int tve200_probe(struct platform_device *pdev) if (IS_ERR(priv->pclk)) { dev_err(dev, "unable to get PCLK\n"); ret = PTR_ERR(priv->pclk); - goto dev_unref; + goto dev_put; } ret = clk_prepare_enable(priv->pclk); if (ret) { dev_err(dev, "failed to enable PCLK\n"); - goto dev_unref; + goto dev_put; }
/* This clock is for the pixels (27MHz) */ @@ -249,8 +249,8 @@ static int tve200_probe(struct platform_device *pdev)
clk_disable: clk_disable_unprepare(priv->pclk); -dev_unref: - drm_dev_unref(drm); +dev_put: + 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 9ef515df724b..a63e3011e971 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 466d0a27b415..e5d49b28e784 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -288,7 +288,7 @@ static int vc4_drm_bind(struct device *dev)
ret = vc4_bo_cache_init(drm); if (ret) - goto dev_unref; + goto dev_put;
drm_mode_config_init(drm);
@@ -313,8 +313,8 @@ static int vc4_drm_bind(struct device *dev) gem_destroy: vc4_gem_destroy(drm); vc4_bo_cache_destroy(drm); -dev_unref: - drm_dev_unref(drm); +dev_put: + drm_dev_put(drm); return ret; }
@@ -331,7 +331,7 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_private_obj_fini(&vc4->ctm_manager);
- 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 c64a85950c82..4cb2c9119e48 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -504,7 +504,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 7e545f5f94d3..66ee535e5a48 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); bool drm_dev_enter(struct drm_device *dev, int *idx); void drm_dev_exit(int idx); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 5339a8e0d76a..b51bfaa58b83 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,8 +16,6 @@ expression object; @@
( -- drm_dev_unref(object) -+ drm_dev_put(object) )
@r depends on report@ @@ -26,7 +24,6 @@ position p; @@
( -drm_dev_unref@p(object) )
@script:python depends on report@
2018-06-09 15:18 GMT+02:00 Thomas Zimmermann tdz@users.sourceforge.net:
This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- drivers/gpu/drm/arc/arcpgu_drv.c | 8 ++++---- drivers/gpu/drm/armada/armada_drv.c | 6 +++--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 ++++---- drivers/gpu/drm/drm_drv.c | 13 ------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 ++++---- 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_context.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 | 8 ++++---- 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 | 14 +++++++------- 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 ++++----
For sti: Acked-by: Benjamin Gaignard benjamin.gaignard@linaro.org
drivers/gpu/drm/stm/drv.c | 10 +++++----- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++--- drivers/gpu/drm/tve200/tve200_drv.c | 10 +++++----- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 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 - scripts/coccinelle/api/drm-get-put.cocci | 3 --- 43 files changed, 99 insertions(+), 116 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bf2f24da48..cf5b18e7d8db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -664,7 +664,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;
}
@@ -674,7 +674,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..27d426bf7d01 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -204,7 +204,7 @@ static int arcpgu_probe(struct platform_device *pdev)
ret = arcpgu_load(drm); if (ret)
goto err_unref;
goto err_put; ret = drm_dev_register(drm, 0); if (ret)
@@ -215,8 +215,8 @@ static int arcpgu_probe(struct platform_device *pdev) err_unload: arcpgu_unload(drm);
-err_unref:
drm_dev_unref(drm);
+err_put:
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 843cac222e60..fedbfa333bb0 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -763,7 +763,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
ret = atmel_hlcdc_dc_load(ddev); if (ret)
goto err_unref;
goto err_put; ret = drm_dev_register(ddev, 0); if (ret)
@@ -774,8 +774,8 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) err_unload: atmel_hlcdc_dc_unload(ddev);
-err_unref:
drm_dev_unref(ddev);
+err_put:
drm_dev_put(ddev); return ret;
} @@ -786,7 +786,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 7af748ed1c58..642503fb1046 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -696,19 +696,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 e5013a999147..35285c0aeeac 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -524,7 +524,7 @@ static int etnaviv_bind(struct device *dev) if (!priv) { dev_err(dev, "failed to allocate private data\n"); ret = -ENOMEM;
goto out_unref;
goto out_put; } drm->dev_private = priv;
@@ -550,8 +550,8 @@ static int etnaviv_bind(struct device *dev) component_unbind_all(dev, drm); out_bind: kfree(priv); -out_unref:
drm_dev_unref(drm);
+out_put:
drm_dev_put(drm); return ret;
} @@ -568,7 +568,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 a81b4a5e24a7..ed3cc2989f93 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -420,7 +420,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;
} @@ -444,7 +444,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..0496be5212e1 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -353,12 +353,12 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
ret = drm_dev_register(drm, 0); if (ret < 0)
goto unref;
goto put; return 0;
-unref:
drm_dev_unref(drm);
+put:
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 7846ea4a99bc..da8c70dd70b4 100644 --- a/drivers/gpu/drm/i915/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c @@ -1724,7 +1724,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_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 708e8d721448..3a977bb5a33e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -586,7 +586,7 @@ int i915_gem_context_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_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 2dc72a984d45..8059268800fa 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 f80cf7ce3fa9..4e7bea6eff36 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1650,7 +1650,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 2b2dde94526f..549707b9d738 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 a3a89aadeccb..d246059338e9 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 8400a8cc5cf2..ffa74290e054 100644 --- a/drivers/gpu/drm/i915/selftests/i915_vma.c +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c @@ -733,7 +733,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 d6926e7820e5..f03b407fdbe2 100644 --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c @@ -464,7 +464,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..c895fe78fb48 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -229,7 +229,7 @@ static int imx_drm_bind(struct device *dev) imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL); if (!imxdrm) { ret = -ENOMEM;
goto err_unref;
goto err_put; } imxdrm->drm = drm;
@@ -306,8 +306,8 @@ static int imx_drm_bind(struct device *dev) component_unbind_all(drm->dev, drm); err_kms: drm_mode_config_cleanup(drm); -err_unref:
drm_dev_unref(drm);
+err_put:
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 021a0b6f9a59..8b96976c6b40 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -261,7 +261,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);
@@ -369,7 +369,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; }
@@ -379,7 +379,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 ffe5137ccaf8..4039f11b2b7b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -398,7 +398,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;
} @@ -409,7 +409,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 926b765dde68..6042f77450a6 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -601,7 +601,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(); @@ -630,7 +630,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 454ff0804642..07e0aa573c1f 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -301,13 +301,13 @@ static int pl111_amba_probe(struct amba_device *amba_dev, if (IS_ERR(priv->regs)) { dev_err(dev, "%s failed mmio\n", __func__); ret = PTR_ERR(priv->regs);
goto dev_unref;
goto dev_put; } /* This may override some variant settings */ ret = pl111_versatile_init(dev, priv); if (ret)
goto dev_unref;
goto dev_put; /* turn off interrupts before requesting the irq */ writel(0, priv->regs + priv->ienb);
@@ -321,16 +321,16 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
ret = pl111_modeset_init(drm); if (ret != 0)
goto dev_unref;
goto dev_put; ret = drm_dev_register(drm, 0); if (ret < 0)
goto dev_unref;
goto dev_put; return 0;
-dev_unref:
drm_dev_unref(drm);
+dev_put:
drm_dev_put(drm); of_reserved_mem_device_release(dev); return ret;
@@ -347,7 +347,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); of_reserved_mem_device_release(dev); 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 02aee6cb0e53..9696a3030319 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -407,7 +407,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 90c46b49c931..832fc43960ee 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -224,7 +224,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)
@@ -248,8 +248,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;
}
@@ -259,7 +259,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 8698e08313e1..f2021b23554d 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -148,16 +148,16 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
ret = drv_load(ddev); if (ret)
goto err_unref;
goto err_put; ret = drm_dev_register(ddev, 0); if (ret)
goto err_unref;
goto err_put; return 0;
-err_unref:
drm_dev_unref(ddev);
+err_put:
drm_dev_put(ddev); return ret;
} @@ -170,7 +170,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 776c1513e582..4a9e24fa195a 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1189,12 +1189,12 @@ static int host1x_drm_probe(struct host1x_device *dev)
err = drm_dev_register(drm, 0); if (err < 0)
goto unref;
goto put; return 0;
-unref:
drm_dev_unref(drm);
+put:
drm_dev_put(drm); return err;
}
@@ -1203,7 +1203,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 24a33bf862fa..09526ab482c3 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..18e9c8e709f9 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -198,12 +198,12 @@ static int tve200_probe(struct platform_device *pdev) if (IS_ERR(priv->pclk)) { dev_err(dev, "unable to get PCLK\n"); ret = PTR_ERR(priv->pclk);
goto dev_unref;
goto dev_put; } ret = clk_prepare_enable(priv->pclk); if (ret) { dev_err(dev, "failed to enable PCLK\n");
goto dev_unref;
goto dev_put; } /* This clock is for the pixels (27MHz) */
@@ -249,8 +249,8 @@ static int tve200_probe(struct platform_device *pdev)
clk_disable: clk_disable_unprepare(priv->pclk); -dev_unref:
drm_dev_unref(drm);
+dev_put:
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 9ef515df724b..a63e3011e971 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 466d0a27b415..e5d49b28e784 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -288,7 +288,7 @@ static int vc4_drm_bind(struct device *dev)
ret = vc4_bo_cache_init(drm); if (ret)
goto dev_unref;
goto dev_put; drm_mode_config_init(drm);
@@ -313,8 +313,8 @@ static int vc4_drm_bind(struct device *dev) gem_destroy: vc4_gem_destroy(drm); vc4_bo_cache_destroy(drm); -dev_unref:
drm_dev_unref(drm);
+dev_put:
drm_dev_put(drm); return ret;
}
@@ -331,7 +331,7 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_private_obj_fini(&vc4->ctm_manager);
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 c64a85950c82..4cb2c9119e48 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -504,7 +504,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 7e545f5f94d3..66ee535e5a48 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); bool drm_dev_enter(struct drm_device *dev, int *idx); void drm_dev_exit(int idx); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 5339a8e0d76a..b51bfaa58b83 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,8 +16,6 @@ expression object; @@
( -- drm_dev_unref(object) -+ drm_dev_put(object) )
@r depends on report@ @@ -26,7 +24,6 @@ position p; @@
( -drm_dev_unref@p(object) )
@script:python depends on report@
2.14.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
On 06/09/2018 03:18 PM, Thomas Zimmermann wrote:
This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- drivers/gpu/drm/arc/arcpgu_drv.c | 8 ++++---- drivers/gpu/drm/armada/armada_drv.c | 6 +++--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 ++++---- drivers/gpu/drm/drm_drv.c | 13 ------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 ++++---- 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_context.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 | 8 ++++---- 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 | 14 +++++++------- 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 | 10 +++++-----
For stm: Acked-by: Philippe Cornu philippe.cornu@st.com
drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++--- drivers/gpu/drm/tve200/tve200_drv.c | 10 +++++----- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 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 - scripts/coccinelle/api/drm-get-put.cocci | 3 --- 43 files changed, 99 insertions(+), 116 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bf2f24da48..cf5b18e7d8db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -664,7 +664,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; }
@@ -674,7 +674,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..27d426bf7d01 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -204,7 +204,7 @@ static int arcpgu_probe(struct platform_device *pdev)
ret = arcpgu_load(drm); if (ret)
goto err_unref;
goto err_put;
ret = drm_dev_register(drm, 0); if (ret)
@@ -215,8 +215,8 @@ static int arcpgu_probe(struct platform_device *pdev) err_unload: arcpgu_unload(drm);
-err_unref:
- drm_dev_unref(drm);
+err_put:
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.
*/ BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0);* armada_private for drm_dev_put() to work correctly.
@@ -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 843cac222e60..fedbfa333bb0 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -763,7 +763,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
ret = atmel_hlcdc_dc_load(ddev); if (ret)
goto err_unref;
goto err_put;
ret = drm_dev_register(ddev, 0); if (ret)
@@ -774,8 +774,8 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev) err_unload: atmel_hlcdc_dc_unload(ddev);
-err_unref:
- drm_dev_unref(ddev);
+err_put:
drm_dev_put(ddev);
return ret; }
@@ -786,7 +786,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 7af748ed1c58..642503fb1046 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -696,19 +696,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 e5013a999147..35285c0aeeac 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -524,7 +524,7 @@ static int etnaviv_bind(struct device *dev) if (!priv) { dev_err(dev, "failed to allocate private data\n"); ret = -ENOMEM;
goto out_unref;
} drm->dev_private = priv;goto out_put;
@@ -550,8 +550,8 @@ static int etnaviv_bind(struct device *dev) component_unbind_all(dev, drm); out_bind: kfree(priv); -out_unref:
- drm_dev_unref(drm);
+out_put:
drm_dev_put(drm);
return ret; }
@@ -568,7 +568,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 a81b4a5e24a7..ed3cc2989f93 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -420,7 +420,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; }
@@ -444,7 +444,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..0496be5212e1 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -353,12 +353,12 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
ret = drm_dev_register(drm, 0); if (ret < 0)
goto unref;
goto put;
return 0;
-unref:
- drm_dev_unref(drm);
+put:
- 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 7846ea4a99bc..da8c70dd70b4 100644 --- a/drivers/gpu/drm/i915/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c @@ -1724,7 +1724,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_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 708e8d721448..3a977bb5a33e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -586,7 +586,7 @@ int i915_gem_context_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_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 2dc72a984d45..8059268800fa 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 f80cf7ce3fa9..4e7bea6eff36 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1650,7 +1650,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 2b2dde94526f..549707b9d738 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 a3a89aadeccb..d246059338e9 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 8400a8cc5cf2..ffa74290e054 100644 --- a/drivers/gpu/drm/i915/selftests/i915_vma.c +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c @@ -733,7 +733,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 d6926e7820e5..f03b407fdbe2 100644 --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c @@ -464,7 +464,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..c895fe78fb48 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -229,7 +229,7 @@ static int imx_drm_bind(struct device *dev) imxdrm = devm_kzalloc(dev, sizeof(*imxdrm), GFP_KERNEL); if (!imxdrm) { ret = -ENOMEM;
goto err_unref;
goto err_put;
}
imxdrm->drm = drm;
@@ -306,8 +306,8 @@ static int imx_drm_bind(struct device *dev) component_unbind_all(drm->dev, drm); err_kms: drm_mode_config_cleanup(drm); -err_unref:
- drm_dev_unref(drm);
+err_put:
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 021a0b6f9a59..8b96976c6b40 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -261,7 +261,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);
@@ -369,7 +369,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);
return -ENOMEM; }drm_dev_put(ddev);
@@ -379,7 +379,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);
return ret; }drm_dev_put(ddev);
@@ -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);
return ret; }drm_dev_put(ddev);
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index ffe5137ccaf8..4039f11b2b7b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -398,7 +398,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; }
@@ -409,7 +409,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);
return ret; }drm_dev_put(drm);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 926b765dde68..6042f77450a6 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -601,7 +601,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();
@@ -630,7 +630,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 454ff0804642..07e0aa573c1f 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -301,13 +301,13 @@ static int pl111_amba_probe(struct amba_device *amba_dev, if (IS_ERR(priv->regs)) { dev_err(dev, "%s failed mmio\n", __func__); ret = PTR_ERR(priv->regs);
goto dev_unref;
goto dev_put;
}
/* This may override some variant settings */ ret = pl111_versatile_init(dev, priv); if (ret)
goto dev_unref;
goto dev_put;
/* turn off interrupts before requesting the irq */ writel(0, priv->regs + priv->ienb);
@@ -321,16 +321,16 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
ret = pl111_modeset_init(drm); if (ret != 0)
goto dev_unref;
goto dev_put;
ret = drm_dev_register(drm, 0); if (ret < 0)
goto dev_unref;
goto dev_put;
return 0;
-dev_unref:
- drm_dev_unref(drm);
+dev_put:
drm_dev_put(drm); of_reserved_mem_device_release(dev);
return ret;
@@ -347,7 +347,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); of_reserved_mem_device_release(dev);
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 02aee6cb0e53..9696a3030319 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -407,7 +407,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 90c46b49c931..832fc43960ee 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -224,7 +224,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)
@@ -248,8 +248,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; }
@@ -259,7 +259,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 8698e08313e1..f2021b23554d 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -148,16 +148,16 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
ret = drv_load(ddev); if (ret)
goto err_unref;
goto err_put;
ret = drm_dev_register(ddev, 0); if (ret)
goto err_unref;
goto err_put;
return 0;
-err_unref:
- drm_dev_unref(ddev);
+err_put:
drm_dev_put(ddev);
return ret; }
@@ -170,7 +170,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 776c1513e582..4a9e24fa195a 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1189,12 +1189,12 @@ static int host1x_drm_probe(struct host1x_device *dev)
err = drm_dev_register(drm, 0); if (err < 0)
goto unref;
goto put;
return 0;
-unref:
- drm_dev_unref(drm);
+put:
- drm_dev_put(drm); return err; }
@@ -1203,7 +1203,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 24a33bf862fa..09526ab482c3 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
*/ drm = drm_dev_alloc(driver, parent);
- for easy error handling.
@@ -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..18e9c8e709f9 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -198,12 +198,12 @@ static int tve200_probe(struct platform_device *pdev) if (IS_ERR(priv->pclk)) { dev_err(dev, "unable to get PCLK\n"); ret = PTR_ERR(priv->pclk);
goto dev_unref;
} ret = clk_prepare_enable(priv->pclk); if (ret) { dev_err(dev, "failed to enable PCLK\n");goto dev_put;
goto dev_unref;
goto dev_put;
}
/* This clock is for the pixels (27MHz) */
@@ -249,8 +249,8 @@ static int tve200_probe(struct platform_device *pdev)
clk_disable: clk_disable_unprepare(priv->pclk); -dev_unref:
- drm_dev_unref(drm);
+dev_put:
- 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 9ef515df724b..a63e3011e971 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 466d0a27b415..e5d49b28e784 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -288,7 +288,7 @@ static int vc4_drm_bind(struct device *dev)
ret = vc4_bo_cache_init(drm); if (ret)
goto dev_unref;
goto dev_put;
drm_mode_config_init(drm);
@@ -313,8 +313,8 @@ static int vc4_drm_bind(struct device *dev) gem_destroy: vc4_gem_destroy(drm); vc4_bo_cache_destroy(drm); -dev_unref:
- drm_dev_unref(drm);
+dev_put:
- drm_dev_put(drm); return ret; }
@@ -331,7 +331,7 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_private_obj_fini(&vc4->ctm_manager);
- 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 c64a85950c82..4cb2c9119e48 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -504,7 +504,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 7e545f5f94d3..66ee535e5a48 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); bool drm_dev_enter(struct drm_device *dev, int *idx); void drm_dev_exit(int idx); diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci index 5339a8e0d76a..b51bfaa58b83 100644 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ b/scripts/coccinelle/api/drm-get-put.cocci @@ -16,8 +16,6 @@ expression object; @@
( -- drm_dev_unref(object) -+ drm_dev_put(object) )
@r depends on report@ @@ -26,7 +24,6 @@ position p; @@
( -drm_dev_unref@p(object) )
@script:python depends on report@
On Sat, Jun 9, 2018 at 9:18 AM, Thomas Zimmermann tdz@users.sourceforge.net wrote:
This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.
The patch also deletes the old function and removes it from the Coccinelle script.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- drivers/gpu/drm/arc/arcpgu_drv.c | 8 ++++---- drivers/gpu/drm/armada/armada_drv.c | 6 +++--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 ++++---- drivers/gpu/drm/drm_drv.c | 13 ------------- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 ++++---- 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_context.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 | 8 ++++---- 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 | 14 +++++++------- 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 | 10 +++++----- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +++--- drivers/gpu/drm/tve200/tve200_drv.c | 10 +++++----- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- 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 - scripts/coccinelle/api/drm-get-put.cocci | 3 --- 43 files changed, 99 insertions(+), 116 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bf2f24da48..cf5b18e7d8db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -664,7 +664,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;
}
@@ -674,7 +674,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);
}
For amdgpu: Acked-by: Alex Deucher alexander.deucher@amd.com
All cases of simple conversion from un/reference to put,get have been fixed. This patch deletes the related, now empty, Coccinelle script; and removes the item from the DRM's TODO list.
Signed-off-by: Thomas Zimmermann tdz@users.sourceforge.net --- Documentation/gpu/todo.rst | 17 ---------------- scripts/coccinelle/api/drm-get-put.cocci | 35 -------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index a7c150d6b63f..fbd258ec4883 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -28,23 +28,6 @@ them, but also all the virtual ones used by KVM, so everyone qualifies).
Contact: Daniel Vetter, Thierry Reding, respective driver maintainers
-Switch from reference/unreference to get/put --------------------------------------------- - -For some reason DRM core uses ``reference``/``unreference`` suffixes for -refcounting functions, but kernel uses ``get``/``put`` (e.g. -``kref_get``/``put()``). It would be good to switch over for consistency, and -it's shorter. Needs to be done in 3 steps for each pair of functions: - -* Create new ``get``/``put`` functions, define the old names as compatibility - wrappers -* Switch over each file/driver using a cocci-generated spatch. -* Once all users of the old names are gone, remove them. - -This way drivers/patches in the progress of getting merged won't break. - -Contact: Daniel Vetter - Convert existing KMS drivers to atomic modesetting --------------------------------------------------
diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci deleted file mode 100644 index b51bfaa58b83..000000000000 --- a/scripts/coccinelle/api/drm-get-put.cocci +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/// -/// Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and -/// drm_*_unreference() helpers. -/// -// Confidence: High -// Copyright: (C) 2017 NVIDIA Corporation -// Options: --no-includes --include-headers -// - -virtual patch -virtual report - -@depends on patch@ -expression object; -@@ - -( -) - -@r depends on report@ -expression object; -position p; -@@ - -( -) - -@script:python depends on report@ -object << r.object; -p << r.p; -@@ - -msg="WARNING: use get/put helpers to reference and dereference %s" % (object) -coccilib.report.print_report(p[0], msg)
On Sat, Jun 09, 2018 at 03:17:58PM +0200, Thomas Zimmermann wrote:
This patch set replaces functions named {un,reference} by their {put,get} counterparts. Each patch also removes the replaced functions from the DRM core and deletes them from the related Coccinelle script. Affected data types are struct drm_connector, struct drm_framebuffer, struct drm_gem_object, and struct drm_device.
This change fixes the related item on the DRM TODO list.
With the reference-counting functions being named {put,get}, the DRM interface is more aligned to Linux kernel nameing standard. The patch set does not change driver-internal interfaces.
Possible future changes: Most of DRM's remaining {un/ref} functions perform additional tasks besides reference counting and should probably not be renamed. Exceptions are ttm_bo_{reference,unref} and ttm_object_file_{un/ref}. These functions mostly perform reference counting, but would require additional changes to the calling code besides renaming.
Thomas Zimmermann (7): drm: Replace drm_connector_{un/reference} with drm_connector_{put,get} drm: Replace drm_framebuffer_{un/reference} with drm_framebuffer_{put,get} drm: Replace drm_gem_object_{un/reference} with drm_gem_object_{put,get} drm: Replace __drm_gem_object_unreference with __drm_gem_object_put drm: Replace drm_gem_object_unreference_unlocked with put function drm: Replace drm_dev_unref with drm_dev_put drm: Clean up after DRM put/get conversion
You're touching lots of drivers here, which needs at least some acks from driver maintainers. scripts/get_maintainers.pl helps with figuring that out.
It might also be good to split up some of the patches into per-driver patches. -Daniel
Documentation/gpu/todo.rst | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +- drivers/gpu/drm/arc/arcpgu_drv.c | 8 +-- drivers/gpu/drm/armada/armada_crtc.c | 8 +-- drivers/gpu/drm/armada/armada_drv.c | 6 +- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 +-- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c | 10 +-- drivers/gpu/drm/drm_drv.c | 13 ---- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 +-- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 10 +-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 +-- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 6 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 +-- drivers/gpu/drm/i915/i915_gem_object.h | 13 +--- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_context.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 | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_power.c | 2 +- drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +- drivers/gpu/drm/msm/msm_drv.c | 8 +-- drivers/gpu/drm/msm/msm_gem_submit.c | 4 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 +-- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 ++-- drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 14 ++-- 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 | 10 +-- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +- drivers/gpu/drm/tegra/drm.c | 8 +-- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +- drivers/gpu/drm/tve200/tve200_drv.c | 10 +-- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 +-- 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_connector.h | 24 ------- include/drm/drm_drv.h | 1 - include/drm/drm_framebuffer.h | 24 ------- include/drm/drm_gem.h | 50 -------------- scripts/coccinelle/api/drm-get-put.cocci | 78 ---------------------- 75 files changed, 156 insertions(+), 372 deletions(-) delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
-- 2.14.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi
It might also be good to split up some of the patches into per-driver patches.
Thanks for the feedback. I'll do the (major) drivers first and will get back with whatever will be left of this patch set.
Best regards Thomas
-Daniel
Documentation/gpu/todo.rst | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +- drivers/gpu/drm/arc/arcpgu_drv.c | 8 +-- drivers/gpu/drm/armada/armada_crtc.c | 8 +-- drivers/gpu/drm/armada/armada_drv.c | 6 +- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 8 +-- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_mm.c | 10 +-- drivers/gpu/drm/drm_drv.c | 13 ---- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 +-- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_fb.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gem.c | 10 +-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 8 +-- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 6 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 8 +-- drivers/gpu/drm/i915/i915_gem_object.h | 13 +--- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_context.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 | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_power.c | 2 +- drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +- drivers/gpu/drm/msm/msm_drv.c | 8 +-- drivers/gpu/drm/msm/msm_gem_submit.c | 4 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 +-- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 ++-- drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 4 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +- drivers/gpu/drm/pl111/pl111_drv.c | 14 ++-- 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 | 10 +-- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +- drivers/gpu/drm/tegra/drm.c | 8 +-- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 6 +- drivers/gpu/drm/tve200/tve200_drv.c | 10 +-- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 8 +-- 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_connector.h | 24 ------- include/drm/drm_drv.h | 1 - include/drm/drm_framebuffer.h | 24 ------- include/drm/drm_gem.h | 50 -------------- scripts/coccinelle/api/drm-get-put.cocci | 78 ---------------------- 75 files changed, 156 insertions(+), 372 deletions(-) delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
-- 2.14.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
dri-devel@lists.freedesktop.org