[media] cx88: don't use atomic_t for core->users
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / cx88 / cx88.h
index 9b3742a7746c5d6d57d87705da194690fefaa7fd..a399a8b086babf4e9facf27a690cdb577a5b6427 100644 (file)
@@ -389,8 +389,8 @@ struct cx88_core {
        struct mutex               lock;
        /* various v4l controls */
        u32                        freq;
-       atomic_t                   users;
-       atomic_t                   mpeg_users;
+       int                        users;
+       int                        mpeg_users;
 
        /* cx88-video needs to access cx8802 for hybrid tuner pll access. */
        struct cx8802_dev          *dvbdev;
@@ -505,6 +505,8 @@ struct cx8802_driver {
        int (*suspend)(struct pci_dev *pci_dev, pm_message_t state);
        int (*resume)(struct pci_dev *pci_dev);
 
+       /* Callers to the following functions must hold core->lock */
+
        /* MPEG 8802 -> mini driver - Driver probe and configuration */
        int (*probe)(struct cx8802_driver *drv);
        int (*remove)(struct cx8802_driver *drv);
@@ -561,8 +563,9 @@ struct cx8802_dev {
        /* for switching modulation types */
        unsigned char              ts_gen_cntrl;
 
-       /* List of attached drivers */
+       /* List of attached drivers; must hold core->lock to access */
        struct list_head           drvlist;
+
        struct work_struct         request_module_wk;
 };
 
@@ -685,6 +688,8 @@ int cx88_audio_thread(void *data);
 
 int cx8802_register_driver(struct cx8802_driver *drv);
 int cx8802_unregister_driver(struct cx8802_driver *drv);
+
+/* Caller must hold core->lock */
 struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype);
 
 /* ----------------------------------------------------------- */