4 * Copyright (C) 2010 Nokia Corporation
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <linux/bitmap.h>
24 #include <linux/module.h>
25 #include <linux/slab.h>
26 #include <media/media-entity.h>
27 #include <media/media-device.h>
29 static inline const char *gobj_type(enum media_gobj_type type
)
32 case MEDIA_GRAPH_ENTITY
:
36 case MEDIA_GRAPH_LINK
:
38 case MEDIA_GRAPH_INTF_DEVNODE
:
39 return "intf-devnode";
45 static inline const char *intf_type(struct media_interface
*intf
)
48 case MEDIA_INTF_T_DVB_FE
:
50 case MEDIA_INTF_T_DVB_DEMUX
:
52 case MEDIA_INTF_T_DVB_DVR
:
54 case MEDIA_INTF_T_DVB_CA
:
56 case MEDIA_INTF_T_DVB_NET
:
58 case MEDIA_INTF_T_V4L_VIDEO
:
60 case MEDIA_INTF_T_V4L_VBI
:
62 case MEDIA_INTF_T_V4L_RADIO
:
64 case MEDIA_INTF_T_V4L_SUBDEV
:
66 case MEDIA_INTF_T_V4L_SWRADIO
:
69 return "unknown-intf";
74 * __media_entity_enum_init - Initialise an entity enumeration
76 * @ent_enum: Entity enumeration to be initialised
77 * @idx_max: Maximum number of entities in the enumeration
79 * Returns zero on success or a negative error code.
81 __must_check
int __media_entity_enum_init(struct media_entity_enum
*ent_enum
,
84 if (idx_max
> MEDIA_ENTITY_ENUM_MAX_ID
) {
85 ent_enum
->bmap
= kcalloc(DIV_ROUND_UP(idx_max
, BITS_PER_LONG
),
86 sizeof(long), GFP_KERNEL
);
90 ent_enum
->bmap
= ent_enum
->prealloc_bmap
;
93 bitmap_zero(ent_enum
->bmap
, idx_max
);
94 ent_enum
->idx_max
= idx_max
;
98 EXPORT_SYMBOL_GPL(__media_entity_enum_init
);
101 * media_entity_enum_cleanup - Release resources of an entity enumeration
103 * @e: Entity enumeration to be released
105 void media_entity_enum_cleanup(struct media_entity_enum
*ent_enum
)
107 if (ent_enum
->bmap
!= ent_enum
->prealloc_bmap
)
108 kfree(ent_enum
->bmap
);
109 ent_enum
->bmap
= NULL
;
111 EXPORT_SYMBOL_GPL(media_entity_enum_cleanup
);
114 * dev_dbg_obj - Prints in debug mode a change on some object
116 * @event_name: Name of the event to report. Could be __func__
117 * @gobj: Pointer to the object
119 * Enabled only if DEBUG or CONFIG_DYNAMIC_DEBUG. Otherwise, it
120 * won't produce any code.
122 static void dev_dbg_obj(const char *event_name
, struct media_gobj
*gobj
)
124 #if defined(DEBUG) || defined (CONFIG_DYNAMIC_DEBUG)
125 switch (media_type(gobj
)) {
126 case MEDIA_GRAPH_ENTITY
:
127 dev_dbg(gobj
->mdev
->dev
,
128 "%s: id 0x%08x entity#%d: '%s'\n",
129 event_name
, gobj
->id
, media_localid(gobj
),
130 gobj_to_entity(gobj
)->name
);
132 case MEDIA_GRAPH_LINK
:
134 struct media_link
*link
= gobj_to_link(gobj
);
136 dev_dbg(gobj
->mdev
->dev
,
137 "%s: id 0x%08x link#%d: %s#%d ==> %s#%d\n",
138 event_name
, gobj
->id
, media_localid(gobj
),
140 gobj_type(media_type(link
->gobj0
)),
141 media_localid(link
->gobj0
),
143 gobj_type(media_type(link
->gobj1
)),
144 media_localid(link
->gobj1
));
147 case MEDIA_GRAPH_PAD
:
149 struct media_pad
*pad
= gobj_to_pad(gobj
);
151 dev_dbg(gobj
->mdev
->dev
,
152 "%s: id 0x%08x %s%spad#%d: '%s':%d\n",
153 event_name
, gobj
->id
,
154 pad
->flags
& MEDIA_PAD_FL_SINK
? " sink " : "",
155 pad
->flags
& MEDIA_PAD_FL_SOURCE
? "source " : "",
157 pad
->entity
->name
, pad
->index
);
160 case MEDIA_GRAPH_INTF_DEVNODE
:
162 struct media_interface
*intf
= gobj_to_intf(gobj
);
163 struct media_intf_devnode
*devnode
= intf_to_devnode(intf
);
165 dev_dbg(gobj
->mdev
->dev
,
166 "%s: id 0x%08x intf_devnode#%d: %s - major: %d, minor: %d\n",
167 event_name
, gobj
->id
, media_localid(gobj
),
169 devnode
->major
, devnode
->minor
);
176 void media_gobj_create(struct media_device
*mdev
,
177 enum media_gobj_type type
,
178 struct media_gobj
*gobj
)
184 /* Create a per-type unique object ID */
186 case MEDIA_GRAPH_ENTITY
:
187 gobj
->id
= media_gobj_gen_id(type
, ++mdev
->entity_id
);
188 list_add_tail(&gobj
->list
, &mdev
->entities
);
190 case MEDIA_GRAPH_PAD
:
191 gobj
->id
= media_gobj_gen_id(type
, ++mdev
->pad_id
);
192 list_add_tail(&gobj
->list
, &mdev
->pads
);
194 case MEDIA_GRAPH_LINK
:
195 gobj
->id
= media_gobj_gen_id(type
, ++mdev
->link_id
);
196 list_add_tail(&gobj
->list
, &mdev
->links
);
198 case MEDIA_GRAPH_INTF_DEVNODE
:
199 gobj
->id
= media_gobj_gen_id(type
, ++mdev
->intf_devnode_id
);
200 list_add_tail(&gobj
->list
, &mdev
->interfaces
);
204 mdev
->topology_version
++;
206 dev_dbg_obj(__func__
, gobj
);
209 void media_gobj_destroy(struct media_gobj
*gobj
)
211 dev_dbg_obj(__func__
, gobj
);
213 gobj
->mdev
->topology_version
++;
215 /* Remove the object from mdev list */
216 list_del(&gobj
->list
);
219 int media_entity_pads_init(struct media_entity
*entity
, u16 num_pads
,
220 struct media_pad
*pads
)
222 struct media_device
*mdev
= entity
->graph_obj
.mdev
;
225 entity
->num_pads
= num_pads
;
229 spin_lock(&mdev
->lock
);
231 for (i
= 0; i
< num_pads
; i
++) {
232 pads
[i
].entity
= entity
;
235 media_gobj_create(mdev
, MEDIA_GRAPH_PAD
,
236 &entity
->pads
[i
].graph_obj
);
240 spin_unlock(&mdev
->lock
);
244 EXPORT_SYMBOL_GPL(media_entity_pads_init
);
246 /* -----------------------------------------------------------------------------
250 static struct media_entity
*
251 media_entity_other(struct media_entity
*entity
, struct media_link
*link
)
253 if (link
->source
->entity
== entity
)
254 return link
->sink
->entity
;
256 return link
->source
->entity
;
259 /* push an entity to traversal stack */
260 static void stack_push(struct media_entity_graph
*graph
,
261 struct media_entity
*entity
)
263 if (graph
->top
== MEDIA_ENTITY_ENUM_MAX_DEPTH
- 1) {
268 graph
->stack
[graph
->top
].link
= entity
->links
.next
;
269 graph
->stack
[graph
->top
].entity
= entity
;
272 static struct media_entity
*stack_pop(struct media_entity_graph
*graph
)
274 struct media_entity
*entity
;
276 entity
= graph
->stack
[graph
->top
].entity
;
282 #define link_top(en) ((en)->stack[(en)->top].link)
283 #define stack_top(en) ((en)->stack[(en)->top].entity)
285 void media_entity_graph_walk_start(struct media_entity_graph
*graph
,
286 struct media_entity
*entity
)
289 graph
->stack
[graph
->top
].entity
= NULL
;
290 bitmap_zero(graph
->entities
, MEDIA_ENTITY_ENUM_MAX_ID
);
292 if (WARN_ON(media_entity_id(entity
) >= MEDIA_ENTITY_ENUM_MAX_ID
))
295 __set_bit(media_entity_id(entity
), graph
->entities
);
296 stack_push(graph
, entity
);
298 EXPORT_SYMBOL_GPL(media_entity_graph_walk_start
);
300 struct media_entity
*
301 media_entity_graph_walk_next(struct media_entity_graph
*graph
)
303 if (stack_top(graph
) == NULL
)
307 * Depth first search. Push entity to stack and continue from
308 * top of the stack until no more entities on the level can be
311 while (link_top(graph
) != &stack_top(graph
)->links
) {
312 struct media_entity
*entity
= stack_top(graph
);
313 struct media_link
*link
;
314 struct media_entity
*next
;
316 link
= list_entry(link_top(graph
), typeof(*link
), list
);
318 /* The link is not enabled so we do not follow. */
319 if (!(link
->flags
& MEDIA_LNK_FL_ENABLED
)) {
320 link_top(graph
) = link_top(graph
)->next
;
324 /* Get the entity in the other end of the link . */
325 next
= media_entity_other(entity
, link
);
326 if (WARN_ON(media_entity_id(next
) >= MEDIA_ENTITY_ENUM_MAX_ID
))
329 /* Has the entity already been visited? */
330 if (__test_and_set_bit(media_entity_id(next
), graph
->entities
)) {
331 link_top(graph
) = link_top(graph
)->next
;
335 /* Push the new entity to stack and start over. */
336 link_top(graph
) = link_top(graph
)->next
;
337 stack_push(graph
, next
);
340 return stack_pop(graph
);
342 EXPORT_SYMBOL_GPL(media_entity_graph_walk_next
);
344 /* -----------------------------------------------------------------------------
345 * Pipeline management
348 __must_check
int media_entity_pipeline_start(struct media_entity
*entity
,
349 struct media_pipeline
*pipe
)
351 struct media_device
*mdev
= entity
->graph_obj
.mdev
;
352 struct media_entity_graph
*graph
= &pipe
->graph
;
353 struct media_entity
*entity_err
= entity
;
354 struct media_link
*link
;
357 mutex_lock(&mdev
->graph_mutex
);
359 media_entity_graph_walk_start(graph
, entity
);
361 while ((entity
= media_entity_graph_walk_next(graph
))) {
362 DECLARE_BITMAP(active
, MEDIA_ENTITY_MAX_PADS
);
363 DECLARE_BITMAP(has_no_links
, MEDIA_ENTITY_MAX_PADS
);
365 entity
->stream_count
++;
367 if (WARN_ON(entity
->pipe
&& entity
->pipe
!= pipe
)) {
374 /* Already streaming --- no need to check. */
375 if (entity
->stream_count
> 1)
378 if (!entity
->ops
|| !entity
->ops
->link_validate
)
381 bitmap_zero(active
, entity
->num_pads
);
382 bitmap_fill(has_no_links
, entity
->num_pads
);
384 list_for_each_entry(link
, &entity
->links
, list
) {
385 struct media_pad
*pad
= link
->sink
->entity
== entity
386 ? link
->sink
: link
->source
;
388 /* Mark that a pad is connected by a link. */
389 bitmap_clear(has_no_links
, pad
->index
, 1);
392 * Pads that either do not need to connect or
393 * are connected through an enabled link are
396 if (!(pad
->flags
& MEDIA_PAD_FL_MUST_CONNECT
) ||
397 link
->flags
& MEDIA_LNK_FL_ENABLED
)
398 bitmap_set(active
, pad
->index
, 1);
401 * Link validation will only take place for
402 * sink ends of the link that are enabled.
404 if (link
->sink
!= pad
||
405 !(link
->flags
& MEDIA_LNK_FL_ENABLED
))
408 ret
= entity
->ops
->link_validate(link
);
409 if (ret
< 0 && ret
!= -ENOIOCTLCMD
) {
410 dev_dbg(entity
->graph_obj
.mdev
->dev
,
411 "link validation failed for \"%s\":%u -> \"%s\":%u, error %d\n",
412 link
->source
->entity
->name
,
414 entity
->name
, link
->sink
->index
, ret
);
419 /* Either no links or validated links are fine. */
420 bitmap_or(active
, active
, has_no_links
, entity
->num_pads
);
422 if (!bitmap_full(active
, entity
->num_pads
)) {
424 dev_dbg(entity
->graph_obj
.mdev
->dev
,
425 "\"%s\":%u must be connected by an enabled link\n",
427 (unsigned)find_first_zero_bit(
428 active
, entity
->num_pads
));
433 mutex_unlock(&mdev
->graph_mutex
);
439 * Link validation on graph failed. We revert what we did and
442 media_entity_graph_walk_start(graph
, entity_err
);
444 while ((entity_err
= media_entity_graph_walk_next(graph
))) {
445 entity_err
->stream_count
--;
446 if (entity_err
->stream_count
== 0)
447 entity_err
->pipe
= NULL
;
450 * We haven't increased stream_count further than this
453 if (entity_err
== entity
)
457 mutex_unlock(&mdev
->graph_mutex
);
461 EXPORT_SYMBOL_GPL(media_entity_pipeline_start
);
463 void media_entity_pipeline_stop(struct media_entity
*entity
)
465 struct media_device
*mdev
= entity
->graph_obj
.mdev
;
466 struct media_entity_graph
*graph
= &entity
->pipe
->graph
;
468 mutex_lock(&mdev
->graph_mutex
);
470 media_entity_graph_walk_start(graph
, entity
);
472 while ((entity
= media_entity_graph_walk_next(graph
))) {
473 entity
->stream_count
--;
474 if (entity
->stream_count
== 0)
478 mutex_unlock(&mdev
->graph_mutex
);
480 EXPORT_SYMBOL_GPL(media_entity_pipeline_stop
);
482 /* -----------------------------------------------------------------------------
486 struct media_entity
*media_entity_get(struct media_entity
*entity
)
491 if (entity
->graph_obj
.mdev
->dev
&&
492 !try_module_get(entity
->graph_obj
.mdev
->dev
->driver
->owner
))
497 EXPORT_SYMBOL_GPL(media_entity_get
);
499 void media_entity_put(struct media_entity
*entity
)
504 if (entity
->graph_obj
.mdev
->dev
)
505 module_put(entity
->graph_obj
.mdev
->dev
->driver
->owner
);
507 EXPORT_SYMBOL_GPL(media_entity_put
);
509 /* -----------------------------------------------------------------------------
513 static struct media_link
*media_add_link(struct list_head
*head
)
515 struct media_link
*link
;
517 link
= kzalloc(sizeof(*link
), GFP_KERNEL
);
521 list_add_tail(&link
->list
, head
);
526 static void __media_entity_remove_link(struct media_entity
*entity
,
527 struct media_link
*link
)
529 struct media_link
*rlink
, *tmp
;
530 struct media_entity
*remote
;
532 if (link
->source
->entity
== entity
)
533 remote
= link
->sink
->entity
;
535 remote
= link
->source
->entity
;
537 list_for_each_entry_safe(rlink
, tmp
, &remote
->links
, list
) {
538 if (rlink
!= link
->reverse
)
541 if (link
->source
->entity
== entity
)
542 remote
->num_backlinks
--;
544 /* Remove the remote link */
545 list_del(&rlink
->list
);
546 media_gobj_destroy(&rlink
->graph_obj
);
549 if (--remote
->num_links
== 0)
552 list_del(&link
->list
);
553 media_gobj_destroy(&link
->graph_obj
);
558 media_create_pad_link(struct media_entity
*source
, u16 source_pad
,
559 struct media_entity
*sink
, u16 sink_pad
, u32 flags
)
561 struct media_link
*link
;
562 struct media_link
*backlink
;
564 BUG_ON(source
== NULL
|| sink
== NULL
);
565 BUG_ON(source_pad
>= source
->num_pads
);
566 BUG_ON(sink_pad
>= sink
->num_pads
);
568 link
= media_add_link(&source
->links
);
572 link
->source
= &source
->pads
[source_pad
];
573 link
->sink
= &sink
->pads
[sink_pad
];
574 link
->flags
= flags
& ~MEDIA_LNK_FL_INTERFACE_LINK
;
576 /* Initialize graph object embedded at the new link */
577 media_gobj_create(source
->graph_obj
.mdev
, MEDIA_GRAPH_LINK
,
580 /* Create the backlink. Backlinks are used to help graph traversal and
581 * are not reported to userspace.
583 backlink
= media_add_link(&sink
->links
);
584 if (backlink
== NULL
) {
585 __media_entity_remove_link(source
, link
);
589 backlink
->source
= &source
->pads
[source_pad
];
590 backlink
->sink
= &sink
->pads
[sink_pad
];
591 backlink
->flags
= flags
;
592 backlink
->is_backlink
= true;
594 /* Initialize graph object embedded at the new link */
595 media_gobj_create(sink
->graph_obj
.mdev
, MEDIA_GRAPH_LINK
,
596 &backlink
->graph_obj
);
598 link
->reverse
= backlink
;
599 backlink
->reverse
= link
;
601 sink
->num_backlinks
++;
607 EXPORT_SYMBOL_GPL(media_create_pad_link
);
609 void __media_entity_remove_links(struct media_entity
*entity
)
611 struct media_link
*link
, *tmp
;
613 list_for_each_entry_safe(link
, tmp
, &entity
->links
, list
)
614 __media_entity_remove_link(entity
, link
);
616 entity
->num_links
= 0;
617 entity
->num_backlinks
= 0;
619 EXPORT_SYMBOL_GPL(__media_entity_remove_links
);
621 void media_entity_remove_links(struct media_entity
*entity
)
623 struct media_device
*mdev
= entity
->graph_obj
.mdev
;
625 /* Do nothing if the entity is not registered. */
629 spin_lock(&mdev
->lock
);
630 __media_entity_remove_links(entity
);
631 spin_unlock(&mdev
->lock
);
633 EXPORT_SYMBOL_GPL(media_entity_remove_links
);
635 static int __media_entity_setup_link_notify(struct media_link
*link
, u32 flags
)
639 /* Notify both entities. */
640 ret
= media_entity_call(link
->source
->entity
, link_setup
,
641 link
->source
, link
->sink
, flags
);
642 if (ret
< 0 && ret
!= -ENOIOCTLCMD
)
645 ret
= media_entity_call(link
->sink
->entity
, link_setup
,
646 link
->sink
, link
->source
, flags
);
647 if (ret
< 0 && ret
!= -ENOIOCTLCMD
) {
648 media_entity_call(link
->source
->entity
, link_setup
,
649 link
->source
, link
->sink
, link
->flags
);
654 link
->reverse
->flags
= link
->flags
;
659 int __media_entity_setup_link(struct media_link
*link
, u32 flags
)
661 const u32 mask
= MEDIA_LNK_FL_ENABLED
;
662 struct media_device
*mdev
;
663 struct media_entity
*source
, *sink
;
669 /* The non-modifiable link flags must not be modified. */
670 if ((link
->flags
& ~mask
) != (flags
& ~mask
))
673 if (link
->flags
& MEDIA_LNK_FL_IMMUTABLE
)
674 return link
->flags
== flags
? 0 : -EINVAL
;
676 if (link
->flags
== flags
)
679 source
= link
->source
->entity
;
680 sink
= link
->sink
->entity
;
682 if (!(link
->flags
& MEDIA_LNK_FL_DYNAMIC
) &&
683 (source
->stream_count
|| sink
->stream_count
))
686 mdev
= source
->graph_obj
.mdev
;
688 if (mdev
->link_notify
) {
689 ret
= mdev
->link_notify(link
, flags
,
690 MEDIA_DEV_NOTIFY_PRE_LINK_CH
);
695 ret
= __media_entity_setup_link_notify(link
, flags
);
697 if (mdev
->link_notify
)
698 mdev
->link_notify(link
, flags
, MEDIA_DEV_NOTIFY_POST_LINK_CH
);
703 int media_entity_setup_link(struct media_link
*link
, u32 flags
)
707 mutex_lock(&link
->graph_obj
.mdev
->graph_mutex
);
708 ret
= __media_entity_setup_link(link
, flags
);
709 mutex_unlock(&link
->graph_obj
.mdev
->graph_mutex
);
713 EXPORT_SYMBOL_GPL(media_entity_setup_link
);
716 media_entity_find_link(struct media_pad
*source
, struct media_pad
*sink
)
718 struct media_link
*link
;
720 list_for_each_entry(link
, &source
->entity
->links
, list
) {
721 if (link
->source
->entity
== source
->entity
&&
722 link
->source
->index
== source
->index
&&
723 link
->sink
->entity
== sink
->entity
&&
724 link
->sink
->index
== sink
->index
)
730 EXPORT_SYMBOL_GPL(media_entity_find_link
);
732 struct media_pad
*media_entity_remote_pad(struct media_pad
*pad
)
734 struct media_link
*link
;
736 list_for_each_entry(link
, &pad
->entity
->links
, list
) {
737 if (!(link
->flags
& MEDIA_LNK_FL_ENABLED
))
740 if (link
->source
== pad
)
743 if (link
->sink
== pad
)
750 EXPORT_SYMBOL_GPL(media_entity_remote_pad
);
752 static void media_interface_init(struct media_device
*mdev
,
753 struct media_interface
*intf
,
755 u32 intf_type
, u32 flags
)
757 intf
->type
= intf_type
;
759 INIT_LIST_HEAD(&intf
->links
);
761 media_gobj_create(mdev
, gobj_type
, &intf
->graph_obj
);
764 /* Functions related to the media interface via device nodes */
766 struct media_intf_devnode
*media_devnode_create(struct media_device
*mdev
,
768 u32 major
, u32 minor
)
770 struct media_intf_devnode
*devnode
;
772 devnode
= kzalloc(sizeof(*devnode
), GFP_KERNEL
);
776 devnode
->major
= major
;
777 devnode
->minor
= minor
;
779 media_interface_init(mdev
, &devnode
->intf
, MEDIA_GRAPH_INTF_DEVNODE
,
784 EXPORT_SYMBOL_GPL(media_devnode_create
);
786 void media_devnode_remove(struct media_intf_devnode
*devnode
)
788 media_remove_intf_links(&devnode
->intf
);
789 media_gobj_destroy(&devnode
->intf
.graph_obj
);
792 EXPORT_SYMBOL_GPL(media_devnode_remove
);
794 struct media_link
*media_create_intf_link(struct media_entity
*entity
,
795 struct media_interface
*intf
,
798 struct media_link
*link
;
800 link
= media_add_link(&intf
->links
);
805 link
->entity
= entity
;
806 link
->flags
= flags
| MEDIA_LNK_FL_INTERFACE_LINK
;
808 /* Initialize graph object embedded at the new link */
809 media_gobj_create(intf
->graph_obj
.mdev
, MEDIA_GRAPH_LINK
,
814 EXPORT_SYMBOL_GPL(media_create_intf_link
);
816 void __media_remove_intf_link(struct media_link
*link
)
818 list_del(&link
->list
);
819 media_gobj_destroy(&link
->graph_obj
);
822 EXPORT_SYMBOL_GPL(__media_remove_intf_link
);
824 void media_remove_intf_link(struct media_link
*link
)
826 struct media_device
*mdev
= link
->graph_obj
.mdev
;
828 /* Do nothing if the intf is not registered. */
832 spin_lock(&mdev
->lock
);
833 __media_remove_intf_link(link
);
834 spin_unlock(&mdev
->lock
);
836 EXPORT_SYMBOL_GPL(media_remove_intf_link
);
838 void __media_remove_intf_links(struct media_interface
*intf
)
840 struct media_link
*link
, *tmp
;
842 list_for_each_entry_safe(link
, tmp
, &intf
->links
, list
)
843 __media_remove_intf_link(link
);
846 EXPORT_SYMBOL_GPL(__media_remove_intf_links
);
848 void media_remove_intf_links(struct media_interface
*intf
)
850 struct media_device
*mdev
= intf
->graph_obj
.mdev
;
852 /* Do nothing if the intf is not registered. */
856 spin_lock(&mdev
->lock
);
857 __media_remove_intf_links(intf
);
858 spin_unlock(&mdev
->lock
);
860 EXPORT_SYMBOL_GPL(media_remove_intf_links
);