Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1a98c16 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 00af4635
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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
 */
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ struct media_v2_topology {
#define MEDIA_IOC_SETUP_LINK	_IOWR('|', 0x03, struct media_link_desc)
#define MEDIA_IOC_G_TOPOLOGY	_IOWR('|', 0x04, struct media_v2_topology)

#if !defined(__KERNEL__) || defined(__NEED_MEDIA_LEGACY_API)
#ifndef __KERNEL__

/*
 * Legacy symbols used to avoid userspace compilation breakages.