diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2016-09-01 15:48:37 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-09-19 14:57:39 +0300 |
commit | 2cc107dc5b2f247dda9495fa488229cc187057d6 (patch) | |
tree | b10f47c5177aeeb90eeddccce03b01fd326b045c /include/asm-generic | |
parent | 82d5e73f6b7955867fc86314430bf923ab9cc485 (diff) | |
download | linux-2cc107dc5b2f247dda9495fa488229cc187057d6.tar.xz |
drm: cleanup drm_core_{init,exit}()
Various cleanups to the DRM core initialization and exit handlers:
- Register chrdev last: Once register_chrdev() returns, open() will
succeed on the given chrdevs. This is usually not an issue, as no
chardevs are registered, yet. However, nodes can be created by
user-space via mknod(2), even though such major/minor combinations are
unknown to the kernel. Avoid calling into drm_stub_open() in those
cases.
Again, drm_stub_open() would just bail out as the inode is unknown,
but it's really non-obvious if you hack on drm_stub_open().
- Unify error-paths into just one label. All the error-path helpers can
be called even though the constructors were not called yet, or failed.
Hence, just call all cleanups unconditionally.
- Call into drm_global_release(). This is a no-op, but provides
debugging helpers in case there're GLOBALS left on module unload. This
function was unused until now.
- Use DRM_ERROR() instead of printk(), and also print the error-code on
failure (even if it is static!).
- Don't throw away error-codes of register_chrdev()!
- Don't hardcode -1 as errno. This is just plain wrong.
- Order exit-handlers in the exact reverse order of initialization
(except if the order actually matters for syncing-reasons, which is
not the case here, though).
v2:
- Call drm_core_exit() directly from the init-error-handler. Requires to
drop __exit annotation, though.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160901124837.680-7-dh.herrmann@gmail.com
Diffstat (limited to 'include/asm-generic')
0 files changed, 0 insertions, 0 deletions