Commit 6aa2daae authored by Fernando Ramos's avatar Fernando Ramos Committed by Sean Paul

drm/nouveau: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()

As requested in Documentation/gpu/todo.rst, replace driver calls to
drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and
DRM_MODESET_LOCK_ALL_END()
Signed-off-by: default avatarFernando Ramos <greenfoo@u92.eu>
Reviewed-by: default avatarSean Paul <sean@poorly.run>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924064324.229457-11-greenfoo@u92.eu
parent 6067fddc
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <drm/drm_probe_helper.h> #include <drm/drm_probe_helper.h>
#include <drm/drm_scdc_helper.h> #include <drm/drm_scdc_helper.h>
#include <drm/drm_vblank.h> #include <drm/drm_vblank.h>
#include <drm/drm_drv.h>
#include <nvif/push507c.h> #include <nvif/push507c.h>
...@@ -667,16 +668,18 @@ nv50_audio_component_bind(struct device *kdev, struct device *hda_kdev, ...@@ -667,16 +668,18 @@ nv50_audio_component_bind(struct device *kdev, struct device *hda_kdev,
struct drm_device *drm_dev = dev_get_drvdata(kdev); struct drm_device *drm_dev = dev_get_drvdata(kdev);
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct drm_audio_component *acomp = data; struct drm_audio_component *acomp = data;
struct drm_modeset_acquire_ctx ctx;
int ret;
if (WARN_ON(!device_link_add(hda_kdev, kdev, DL_FLAG_STATELESS))) if (WARN_ON(!device_link_add(hda_kdev, kdev, DL_FLAG_STATELESS)))
return -ENOMEM; return -ENOMEM;
drm_modeset_lock_all(drm_dev); DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret);
acomp->ops = &nv50_audio_component_ops; acomp->ops = &nv50_audio_component_ops;
acomp->dev = kdev; acomp->dev = kdev;
drm->audio.component = acomp; drm->audio.component = acomp;
drm_modeset_unlock_all(drm_dev); DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret);
return 0; return ret;
} }
static void static void
...@@ -686,12 +689,14 @@ nv50_audio_component_unbind(struct device *kdev, struct device *hda_kdev, ...@@ -686,12 +689,14 @@ nv50_audio_component_unbind(struct device *kdev, struct device *hda_kdev,
struct drm_device *drm_dev = dev_get_drvdata(kdev); struct drm_device *drm_dev = dev_get_drvdata(kdev);
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct drm_audio_component *acomp = data; struct drm_audio_component *acomp = data;
struct drm_modeset_acquire_ctx ctx;
int ret;
drm_modeset_lock_all(drm_dev); DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret);
drm->audio.component = NULL; drm->audio.component = NULL;
acomp->ops = NULL; acomp->ops = NULL;
acomp->dev = NULL; acomp->dev = NULL;
drm_modeset_unlock_all(drm_dev); DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret);
} }
static const struct component_ops nv50_audio_component_bind_ops = { static const struct component_ops nv50_audio_component_bind_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment