diff options
author | Daniel Vetter | 2020-03-24 21:39:36 +0100 |
---|---|---|
committer | Daniel Vetter | 2020-03-26 15:37:31 +0100 |
commit | f96306f9892b3a28ece4c65c4d1b95f631b3e63c (patch) | |
tree | e259f3640c1077d63664ea9e6906ee3ae983bf4e /drivers/gpu/drm/drm_gem.c | |
parent | 2cbf7fc6718b9443ecd6261308c6348d8ffcccae (diff) |
drm: manage drm_minor cleanup with drmm_
The cleanup here is somewhat tricky, since we can't tell apart the
allocated minor index from 0. So register a cleanup action first, and
if the index allocation fails, unregister that cleanup action again to
avoid bad mistakes.
The kdev for the minor already handles NULL, so no problem there.
Hence add drmm_remove_action() to the drm_managed library.
v2: Make pointer math around void ** consistent with what Laurent
suggested.
v3: Use drmm_add_action_or_reset and remove drmm_remove_action. Noticed
because of some questions from Thomas. This also means we need to move
the drmm_add_action_or_reset helper earlier in the series.
v4: Uh ... fix slightly embarrassing bug CI spotted.
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324203936.3330994-1-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
0 files changed, 0 insertions, 0 deletions