media: replace WARN_ON in __media_pipeline_start()
authorShuah Khan <shuah@kernel.org>
Sat, 23 Feb 2019 00:17:09 +0000 (19:17 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 18:01:08 +0000 (14:01 -0400)
__media_pipeline_start() does WARN_ON() when active pipe doesn't
match the input arg entity's pipe.

Replace WARN_ON with a conditional and error message that includes
names of both entities.

Signed-off-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/media-entity.c

index dd859d7b235a986f46839f502c4a9c2805b6f46b..a998a2e0ea1dc93c37ca5f30baf749940056eb7d 100644 (file)
@@ -435,7 +435,10 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
 
                entity->stream_count++;
 
-               if (WARN_ON(entity->pipe && entity->pipe != pipe)) {
+               if (entity->pipe && entity->pipe != pipe) {
+                       pr_err("Pipe active for %s. Can't start for %s\n",
+                               entity->name,
+                               entity_err->name);
                        ret = -EBUSY;
                        goto error;
                }