diff options
author | Hans Verkuil <hansverk@cisco.com> | 2018-06-15 09:19:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-06-28 08:10:51 -0400 |
commit | e1a98c163eb276b5b5e1bece560ed7f0b9eb3b49 (patch) | |
tree | 62a7773b87c61fd2595320cce6779260f2c8f128 /drivers/media/media-device.c | |
parent | 00af4635a1de10644ed76fee973b44a001499108 (diff) |
media: media.h: remove __NEED_MEDIA_LEGACY_API
The __NEED_MEDIA_LEGACY_API define is 1) ugly and 2) dangerous
since it is all too easy for drivers to define it to get hold of
legacy defines. Instead just define what we need in media-device.c
which is the only place where we need the legacy define
(MEDIA_ENT_T_DEVNODE_UNKNOWN).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r-- | drivers/media/media-device.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index ae59c3177555..47bb2254fbfd 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -16,9 +16,6 @@ * GNU General Public License for more details. */ -/* We need to access legacy defines from linux/media.h */ -#define __NEED_MEDIA_LEGACY_API - #include <linux/compat.h> #include <linux/export.h> #include <linux/idr.h> @@ -35,6 +32,16 @@ #ifdef CONFIG_MEDIA_CONTROLLER +/* + * Legacy defines from linux/media.h. This is the only place we need this + * so we just define it here. The media.h header doesn't expose it to the + * kernel to prevent it from being used by drivers, but here (and only here!) + * we need it to handle the legacy behavior. + */ +#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff +#define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_F_OLD_BASE | \ + MEDIA_ENT_SUBTYPE_MASK) + /* ----------------------------------------------------------------------------- * Userspace API */ |