]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] SOLO6x10: remove unneeded register locking and barriers
authorKrzysztof Hałasa <khalasa@piap.pl>
Mon, 8 Jun 2015 13:42:24 +0000 (10:42 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 6 Jul 2015 11:25:47 +0000 (08:25 -0300)
readl() and writel() are atomic, we don't need the spin lock.
Also, flushing posted write buffer isn't required. Especially on read :-)

Signed-off-by: Krzysztof Ha?asa <khalasa@piap.pl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/solo6x10/solo6x10-core.c
drivers/media/pci/solo6x10/solo6x10.h

index 84627e6f7377dfaaddc48a507f0573404a36ffb4..9c948b1fc1d83dab45797a8617ba220d20b3ba2d 100644 (file)
@@ -483,7 +483,6 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        solo_dev->type = id->driver_data;
        solo_dev->pdev = pdev;
-       spin_lock_init(&solo_dev->reg_io_lock);
        ret = v4l2_device_register(&pdev->dev, &solo_dev->v4l2_dev);
        if (ret)
                goto fail_probe;
index 1ca54b08b3aaaf400a9095bd4d241510ab7b8059..27423d7f54100ac8f11f79c2557105111d340d60 100644 (file)
@@ -199,7 +199,6 @@ struct solo_dev {
        int                     nr_ext;
        u32                     irq_mask;
        u32                     motion_mask;
-       spinlock_t              reg_io_lock;
        struct v4l2_device      v4l2_dev;
 
        /* tw28xx accounting */
@@ -281,36 +280,13 @@ struct solo_dev {
 
 static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
 {
-       unsigned long flags;
-       u32 ret;
-       u16 val;
-
-       spin_lock_irqsave(&solo_dev->reg_io_lock, flags);
-
-       ret = readl(solo_dev->reg_base + reg);
-       rmb();
-       pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
-       rmb();
-
-       spin_unlock_irqrestore(&solo_dev->reg_io_lock, flags);
-
-       return ret;
+       return readl(solo_dev->reg_base + reg);
 }
 
 static inline void solo_reg_write(struct solo_dev *solo_dev, int reg,
                                  u32 data)
 {
-       unsigned long flags;
-       u16 val;
-
-       spin_lock_irqsave(&solo_dev->reg_io_lock, flags);
-
        writel(data, solo_dev->reg_base + reg);
-       wmb();
-       pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
-       rmb();
-
-       spin_unlock_irqrestore(&solo_dev->reg_io_lock, flags);
 }
 
 static inline void solo_irq_on(struct solo_dev *dev, u32 mask)