diff options
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_entity.c | 18 | ||||
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_entity.h | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_entity.c b/drivers/media/platform/vsp1/vsp1_entity.c index a453bb4ddd37..fd95a75b04f4 100644 --- a/drivers/media/platform/vsp1/vsp1_entity.c +++ b/drivers/media/platform/vsp1/vsp1_entity.c | |||
@@ -24,22 +24,24 @@ | |||
24 | 24 | ||
25 | bool vsp1_entity_is_streaming(struct vsp1_entity *entity) | 25 | bool vsp1_entity_is_streaming(struct vsp1_entity *entity) |
26 | { | 26 | { |
27 | unsigned long flags; | ||
27 | bool streaming; | 28 | bool streaming; |
28 | 29 | ||
29 | mutex_lock(&entity->lock); | 30 | spin_lock_irqsave(&entity->lock, flags); |
30 | streaming = entity->streaming; | 31 | streaming = entity->streaming; |
31 | mutex_unlock(&entity->lock); | 32 | spin_unlock_irqrestore(&entity->lock, flags); |
32 | 33 | ||
33 | return streaming; | 34 | return streaming; |
34 | } | 35 | } |
35 | 36 | ||
36 | int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) | 37 | int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) |
37 | { | 38 | { |
39 | unsigned long flags; | ||
38 | int ret; | 40 | int ret; |
39 | 41 | ||
40 | mutex_lock(&entity->lock); | 42 | spin_lock_irqsave(&entity->lock, flags); |
41 | entity->streaming = streaming; | 43 | entity->streaming = streaming; |
42 | mutex_unlock(&entity->lock); | 44 | spin_unlock_irqrestore(&entity->lock, flags); |
43 | 45 | ||
44 | if (!streaming) | 46 | if (!streaming) |
45 | return 0; | 47 | return 0; |
@@ -49,9 +51,9 @@ int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming) | |||
49 | 51 | ||
50 | ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler); | 52 | ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler); |
51 | if (ret < 0) { | 53 | if (ret < 0) { |
52 | mutex_lock(&entity->lock); | 54 | spin_lock_irqsave(&entity->lock, flags); |
53 | entity->streaming = false; | 55 | entity->streaming = false; |
54 | mutex_unlock(&entity->lock); | 56 | spin_unlock_irqrestore(&entity->lock, flags); |
55 | } | 57 | } |
56 | 58 | ||
57 | return ret; | 59 | return ret; |
@@ -193,7 +195,7 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity, | |||
193 | if (i == ARRAY_SIZE(vsp1_routes)) | 195 | if (i == ARRAY_SIZE(vsp1_routes)) |
194 | return -EINVAL; | 196 | return -EINVAL; |
195 | 197 | ||
196 | mutex_init(&entity->lock); | 198 | spin_lock_init(&entity->lock); |
197 | 199 | ||
198 | entity->vsp1 = vsp1; | 200 | entity->vsp1 = vsp1; |
199 | entity->source_pad = num_pads - 1; | 201 | entity->source_pad = num_pads - 1; |
@@ -228,6 +230,4 @@ void vsp1_entity_destroy(struct vsp1_entity *entity) | |||
228 | if (entity->subdev.ctrl_handler) | 230 | if (entity->subdev.ctrl_handler) |
229 | v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); | 231 | v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); |
230 | media_entity_cleanup(&entity->subdev.entity); | 232 | media_entity_cleanup(&entity->subdev.entity); |
231 | |||
232 | mutex_destroy(&entity->lock); | ||
233 | } | 233 | } |
diff --git a/drivers/media/platform/vsp1/vsp1_entity.h b/drivers/media/platform/vsp1/vsp1_entity.h index 62c768d1c6aa..8867a5787c28 100644 --- a/drivers/media/platform/vsp1/vsp1_entity.h +++ b/drivers/media/platform/vsp1/vsp1_entity.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define __VSP1_ENTITY_H__ | 14 | #define __VSP1_ENTITY_H__ |
15 | 15 | ||
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/spinlock.h> |
18 | 18 | ||
19 | #include <media/v4l2-subdev.h> | 19 | #include <media/v4l2-subdev.h> |
20 | 20 | ||
@@ -73,7 +73,7 @@ struct vsp1_entity { | |||
73 | 73 | ||
74 | struct vsp1_video *video; | 74 | struct vsp1_video *video; |
75 | 75 | ||
76 | struct mutex lock; /* Protects the streaming field */ | 76 | spinlock_t lock; /* Protects the streaming field */ |
77 | bool streaming; | 77 | bool streaming; |
78 | }; | 78 | }; |
79 | 79 | ||