[PATCH 6/7] drm: Replace drm_dev_unref with drm_dev_put

Alex Deucher alexdeucher at gmail.com
Tue Jun 19 15:25:31 UTC 2018


On Sat, Jun 9, 2018 at 9:18 AM, Thomas Zimmermann
<tdz at 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 at 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 at amd.com>


More information about the dri-devel mailing list