aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch b/target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch
new file mode 100644
index 0000000000..6191b2acd8
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0769-media-entity-Add-link_type_name-helper.patch
@@ -0,0 +1,49 @@
+From 7fd3f647f18b808effb3a8d514f9b49c5c9b6d9e Mon Sep 17 00:00:00 2001
+From: Daniel Scally <djrscally@gmail.com>
+Date: Wed, 2 Mar 2022 22:03:02 +0000
+Subject: [PATCH] media: entity: Add link_type_name() helper
+
+Now we have three types of media link, printing the right name during
+debug output is slightly more complicated. Add a helper function to
+make it easier.
+
+Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Daniel Scally <djrscally@gmail.com>
+---
+ drivers/media/mc/mc-entity.c | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+--- a/drivers/media/mc/mc-entity.c
++++ b/drivers/media/mc/mc-entity.c
+@@ -60,6 +60,20 @@ static inline const char *intf_type(stru
+ }
+ };
+
++static inline const char *link_type_name(struct media_link *link)
++{
++ switch (link->flags & MEDIA_LNK_FL_LINK_TYPE) {
++ case MEDIA_LNK_FL_DATA_LINK:
++ return "data";
++ case MEDIA_LNK_FL_INTERFACE_LINK:
++ return "interface";
++ case MEDIA_LNK_FL_ANCILLARY_LINK:
++ return "ancillary";
++ default:
++ return "unknown";
++ }
++}
++
+ __must_check int __media_entity_enum_init(struct media_entity_enum *ent_enum,
+ int idx_max)
+ {
+@@ -107,9 +121,7 @@ static void dev_dbg_obj(const char *even
+
+ dev_dbg(gobj->mdev->dev,
+ "%s id %u: %s link id %u ==> id %u\n",
+- event_name, media_id(gobj),
+- media_type(link->gobj0) == MEDIA_GRAPH_PAD ?
+- "data" : "interface",
++ event_name, media_id(gobj), link_type_name(link),
+ media_id(link->gobj0),
+ media_id(link->gobj1));
+ break;