diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-01-29 06:31:40 -0500 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-03-16 07:25:17 -0400 |
commit | cb8a239b03608079cbfb784e9ac2f522fe846c29 (patch) | |
tree | 31d5db41b6af80f0f4a9e81b07f3377acd03af0b /include/drm/drmP.h | |
parent | b9a0d15cc59e896dc6b6c07583157d78fcf72fbb (diff) |
drm: turn DRM_MINOR_* into enum
Use enum for DRM_MINOR_* constants to avoid hard-coding the IDs.
Furthermore, add a DRM_MINOR_CNT so we can perform range-checks in
follow-ups.
This changes the IDs of the minor-types by -1, but they're not used as
indices so this is fine.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index ff20b888d525..2c322564ca7d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1008,9 +1008,12 @@ struct drm_driver { | |||
1008 | struct list_head legacy_dev_list; | 1008 | struct list_head legacy_dev_list; |
1009 | }; | 1009 | }; |
1010 | 1010 | ||
1011 | #define DRM_MINOR_LEGACY 1 | 1011 | enum drm_minor_type { |
1012 | #define DRM_MINOR_CONTROL 2 | 1012 | DRM_MINOR_LEGACY, |
1013 | #define DRM_MINOR_RENDER 3 | 1013 | DRM_MINOR_CONTROL, |
1014 | DRM_MINOR_RENDER, | ||
1015 | DRM_MINOR_CNT, | ||
1016 | }; | ||
1014 | 1017 | ||
1015 | /** | 1018 | /** |
1016 | * Info file list entry. This structure represents a debugfs or proc file to | 1019 | * Info file list entry. This structure represents a debugfs or proc file to |