]> git.baikalelectronics.ru Git - kernel.git/commit
drm: add minor-lookup/release helpers
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 29 Jan 2014 09:49:19 +0000 (10:49 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sun, 16 Mar 2014 11:25:17 +0000 (12:25 +0100)
commit022a4d477743130d8b7856f4a221392a3b80ef2c
treed28625fe2ae686919c757df8ec6b8940e0d46d22
parentb6640d8f1e5a4a62ffeefa795616e59b41696983
drm: add minor-lookup/release helpers

Instead of accessing drm_minors_idr directly, this adds a small helper to
hide the internals. This will help us later to remove the drm_global_mutex
requirement for minor-lookup.

Furthermore, this also makes sure that minor->dev is always valid and
takes a reference-count to the device as long as the minor is used in an
open-file. This way, "struct file*"->private_data->dev is guaranteed to be
valid (which it has to, as we cannot reset it).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/drm_stub.c
include/drm/drmP.h