[media] s5p-fimc: Simplify locking by removing the context data structure spinlock
[deliverable/linux.git] / drivers / media / video / s5p-fimc / fimc-core.h
index 4e20560c73d4d5ed6e74e81c324cd5ca7cc062ca..54198c781fe10c3fe1f353881543e6fbc68cd19d 100644 (file)
@@ -434,7 +434,6 @@ struct fimc_ctx;
  * @num_clocks: the number of clocks managed by this device instance
  * @clock:     clocks required for FIMC operation
  * @regs:      the mapped hardware registers
- * @regs_res:  the resource claimed for IO registers
  * @irq:       FIMC interrupt number
  * @irq_queue: interrupt handler waitqueue
  * @v4l2_dev:  root v4l2_device
@@ -454,7 +453,6 @@ struct fimc_dev {
        u16                             num_clocks;
        struct clk                      *clock[MAX_FIMC_CLOCKS];
        void __iomem                    *regs;
-       struct resource                 *regs_res;
        int                             irq;
        wait_queue_head_t               irq_queue;
        struct v4l2_device              *v4l2_dev;
@@ -467,7 +465,6 @@ struct fimc_dev {
 
 /**
  * fimc_ctx - the device context data
- * @slock:             spinlock protecting this data structure
  * @s_frame:           source frame properties
  * @d_frame:           destination frame properties
  * @out_order_1p:      output 1-plane YCBCR order
@@ -494,7 +491,6 @@ struct fimc_dev {
  * @ctrls_rdy:         true if the control handler is initialized
  */
 struct fimc_ctx {
-       spinlock_t              slock;
        struct fimc_frame       s_frame;
        struct fimc_frame       d_frame;
        u32                     out_order_1p;
@@ -562,13 +558,13 @@ static inline bool fimc_capture_active(struct fimc_dev *fimc)
        return ret;
 }
 
-static inline void fimc_ctx_state_lock_set(u32 state, struct fimc_ctx *ctx)
+static inline void fimc_ctx_state_set(u32 state, struct fimc_ctx *ctx)
 {
        unsigned long flags;
 
-       spin_lock_irqsave(&ctx->slock, flags);
+       spin_lock_irqsave(&ctx->fimc_dev->slock, flags);
        ctx->state |= state;
-       spin_unlock_irqrestore(&ctx->slock, flags);
+       spin_unlock_irqrestore(&ctx->fimc_dev->slock, flags);
 }
 
 static inline bool fimc_ctx_state_is_set(u32 mask, struct fimc_ctx *ctx)
@@ -576,9 +572,9 @@ static inline bool fimc_ctx_state_is_set(u32 mask, struct fimc_ctx *ctx)
        unsigned long flags;
        bool ret;
 
-       spin_lock_irqsave(&ctx->slock, flags);
+       spin_lock_irqsave(&ctx->fimc_dev->slock, flags);
        ret = (ctx->state & mask) == mask;
-       spin_unlock_irqrestore(&ctx->slock, flags);
+       spin_unlock_irqrestore(&ctx->fimc_dev->slock, flags);
        return ret;
 }
 
This page took 0.027499 seconds and 5 git commands to generate.