History

[media] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs

Instead of abusing MEDIA_ENT_T_V4L2_SUBDEV, initialize new subdev entities as MEDIA_ENT_T_UNKNOWN.

Mauro Carvalho Chehab committed 11 years ago

Commit b50bde41 parent bf4178a3 files · +21 −1Browse files

Unified · Split

3 files
  1. drivers/media/media-device.c +6 −0
  2. drivers/media/v4l2-core/v4l2-subdev.c +1 −1
  3. include/uapi/linux/media.h +14 −0
drivers/media/media-device.c+6−0
@@ -435,6 +435,12 @@ int __must_check media_device_register_entity(struct media_device *mdev, · 434 unmodified lines
435{435{
436 int i;436 int i;
437 437
438 if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN ||
439 entity->type == MEDIA_ENT_T_UNKNOWN)
440 dev_warn(mdev->dev,
441 "Entity type for entity %s was not initialized!\n",
442 entity->name);
443
438 /* Warn if we apparently re-register an entity */444 /* Warn if we apparently re-register an entity */
439 WARN_ON(entity->graph_obj.mdev != NULL);445 WARN_ON(entity->graph_obj.mdev != NULL);
440 entity->graph_obj.mdev = mdev;446 entity->graph_obj.mdev = mdev;
drivers/media/v4l2-core/v4l2-subdev.c+1−1
@@ -584,7 +584,7 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops) · 583 unmodified lines
584 sd->host_priv = NULL;584 sd->host_priv = NULL;
585#if defined(CONFIG_MEDIA_CONTROLLER)585#if defined(CONFIG_MEDIA_CONTROLLER)
586 sd->entity.name = sd->name;586 sd->entity.name = sd->name;
587 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV;587 sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
588#endif588#endif
589}589}
590EXPORT_SYMBOL(v4l2_subdev_init);590EXPORT_SYMBOL(v4l2_subdev_init);
include/uapi/linux/media.h+14−0
@@ -42,6 +42,14 @@ struct media_device_info { · 41 unmodified lines
42 42
43#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)43#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
44 44
45/* Used values for media_entity_desc::type */
46
47/*
48 * Initial value to be used when a new entity is created
49 * Drivers should change it to something useful
50 */
51#define MEDIA_ENT_T_UNKNOWN 0x00000000
52
45/*53/*
46 * Base numbers for entity types54 * Base numbers for entity types
47 *55 *
@@ -76,6 +84,12 @@ struct media_device_info { · 28 unmodified lines
76 84
77/* V4L2 Sub-device entities */85/* V4L2 Sub-device entities */
78 86
87/*
88 * Subdevs are initialized with MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN,
89 * in order to preserve backward compatibility.
90 * Drivers should change to the proper subdev type before
91 * registering the entity.
92 */
79#define MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_T_V4L2_SUBDEV_BASE93#define MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_T_V4L2_SUBDEV_BASE
80 94
81#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV_BASE + 1)95#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV_BASE + 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t