missed some locking that should have been converted to use
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 18 Jul 2004 01:03:23 +0000 (01:03 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 18 Jul 2004 01:03:23 +0000 (01:03 +0000)
devpriv->window_lock

comedi/drivers/ni_atmio.c
comedi/drivers/ni_mio_cs.c
comedi/drivers/ni_pcimio.c

index 94d5f14ae0d56453a9372cceccaab247d8cf6271..c476e896fdafdf3b7a3ccff3f5bbeca6789008f9 100644 (file)
@@ -255,6 +255,11 @@ static int ni_irqpin[]={-1,-1,-1,0,1,2,-1,3,-1,-1,4,5,6,-1,-1,7};
 
 #define NI_E_IRQ_FLAGS         0
 
+typedef struct{
+       struct pci_dev *isapnp_dev;
+       NI_PRIVATE_COMMON
+}ni_private;
+#define devpriv ((ni_private *)dev->private)
 
 /* How we access registers */
 
@@ -276,14 +281,14 @@ static inline void __win_out(comedi_device *dev, unsigned short data, int addr)
 {
        unsigned long flags;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        if((addr)<8){
                ni_writew(data,addr*2);
        }else{
                ni_writew(addr,Window_Address);
                ni_writew(data,Window_Data);
        }
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 }
 
 #define win_in(addr) __win_in(dev,addr)
@@ -292,14 +297,14 @@ static inline unsigned short __win_in(comedi_device *dev, int addr)
        unsigned long flags;
        int ret;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        if(addr<8){
                ret = ni_readw(addr*2);
        }else{
                ni_writew(addr,Window_Address);
                ret = ni_readw(Window_Data);
        }
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 
        return ret;
 }
@@ -314,12 +319,6 @@ static struct isapnp_device_id device_ids[] = {
 MODULE_DEVICE_TABLE(isapnp, device_ids);
 #endif
 
-typedef struct{
-       struct pci_dev *isapnp_dev;
-       NI_PRIVATE_COMMON
-}ni_private;
-#define devpriv ((ni_private *)dev->private)
-
 static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it);
 static int ni_atmio_detach(comedi_device *dev);
 static comedi_driver driver_atmio={
index 2f08d04746b2fe62cc30191214ea6818ec7c4c37..ad43d16c828b7b46055193e2e99dca7ae0121d8b 100644 (file)
@@ -162,6 +162,12 @@ static ni_board ni_boards[]={
 
 #define NI_E_IRQ_FLAGS         SA_SHIRQ
 
+typedef struct{
+       dev_link_t *link;
+
+       NI_PRIVATE_COMMON
+}ni_private;
+#define devpriv ((ni_private *)dev->private)
 
 /* How we access registers */
 
@@ -183,14 +189,14 @@ static inline void __win_out(comedi_device *dev, unsigned short data, int addr)
 {
        unsigned long flags;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        if(addr<8){
                ni_writew(data,addr*2);
        }else{
                ni_writew(addr,Window_Address);
                ni_writew(data,Window_Data);
        }
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 }
 
 #define win_in(addr) __win_in(dev,addr)
@@ -199,25 +205,18 @@ static inline unsigned short __win_in(comedi_device *dev, int addr)
        unsigned long flags;
        int ret;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        if(addr<8){
                ret = ni_readw(addr*2);
        }else{
                ni_writew(addr,Window_Address);
                ret = ni_readw(Window_Data);
        }
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 
        return ret;
 }
 
-typedef struct{
-       dev_link_t *link;
-
-       NI_PRIVATE_COMMON
-}ni_private;
-#define devpriv ((ni_private *)dev->private)
-
 static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it);
 static int mio_cs_detach(comedi_device *dev);
 static comedi_driver driver_ni_mio_cs={
index 52dbc50a5b3c768e3560f936476bb8b562b5aa0b..8673a4435fac6255af9f890be03d9788697fbdfe 100644 (file)
@@ -666,6 +666,14 @@ static comedi_driver driver_pcimio={
 };
 COMEDI_INITCLEANUP(driver_pcimio);
 
+typedef struct{
+       struct mite_struct *mite;
+
+       NI_PRIVATE_COMMON
+
+       unsigned int last_buf_write_count;
+}ni_private;
+#define devpriv ((ni_private *)dev->private)
 
 /* How we access registers */
 
@@ -691,10 +699,10 @@ static inline void __win_out(comedi_device *dev, unsigned short data, int addr)
 {
        unsigned long flags;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        ni_writew(addr,Window_Address);
        ni_writew(data,Window_Data);
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 }
 
 #define win_in(addr) __win_in(dev,addr)
@@ -703,10 +711,10 @@ static inline unsigned short __win_in(comedi_device *dev, int addr)
        unsigned long flags;
        int ret;
 
-       comedi_spin_lock_irqsave(&dev->spinlock,flags);
+       comedi_spin_lock_irqsave(&devpriv->window_lock,flags);
        ni_writew(addr,Window_Address);
        ret = ni_readw(Window_Data);
-       comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
+       comedi_spin_unlock_irqrestore(&devpriv->window_lock,flags);
 
        return ret;
 }
@@ -716,17 +724,6 @@ static inline unsigned short __win_in(comedi_device *dev, int addr)
 
 #define NI_E_IRQ_FLAGS         SA_SHIRQ
 
-
-typedef struct{
-       struct mite_struct *mite;
-
-       NI_PRIVATE_COMMON
-
-       unsigned int last_buf_write_count;
-}ni_private;
-#define devpriv ((ni_private *)dev->private)
-
-
 #include "ni_mio_common.c"