diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-01-29 04:21:36 -0500 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-03-16 07:25:17 -0400 |
commit | 099d1c290e2ebc3b798961a6c177c3aef5f0b789 (patch) | |
tree | 4b0d0a693d5c08081e72cd24294d9d312b14a107 /drivers/gpu/drm/drm_usb.c | |
parent | cb8a239b03608079cbfb784e9ac2f522fe846c29 (diff) |
drm: provide device-refcount
Lets not trick ourselves into thinking "drm_device" objects are not
ref-counted. That's just utterly stupid. We manage "drm_minor" objects on
each drm-device and each minor can have an unlimited number of open
handles. Each of these handles has the drm_minor (and thus the drm_device)
as private-data in the file-handle. Therefore, we may not destroy
"drm_device" until all these handles are closed.
It is *not* possible to reset all these pointers atomically and restrict
access to them, and this is *not* how this is done! Instead, we use
ref-counts to make sure the object is valid and not freed.
Note that we currently use "dev->open_count" for that, which is *exactly*
the same as a reference-count, just open coded. So this patch doesn't
change any semantics on DRM devices (well, this patch just introduces the
ref-count, anyway. Follow-up patches will replace open_count by it).
Also note that generic VFS revoke support could allow us to drop this
ref-count again. We could then just synchronously disable any fops->xy()
calls. However, this is not the case, yet, and no such patches are
in sight (and I seriously question the idea of dropping the ref-cnt
again).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/drm_usb.c')
-rw-r--r-- | drivers/gpu/drm/drm_usb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c index 0f8cb1ae7607..c3406aad2944 100644 --- a/drivers/gpu/drm/drm_usb.c +++ b/drivers/gpu/drm/drm_usb.c | |||
@@ -30,7 +30,7 @@ int drm_get_usb_dev(struct usb_interface *interface, | |||
30 | return 0; | 30 | return 0; |
31 | 31 | ||
32 | err_free: | 32 | err_free: |
33 | drm_dev_free(dev); | 33 | drm_dev_unref(dev); |
34 | return ret; | 34 | return ret; |
35 | 35 | ||
36 | } | 36 | } |