[PATCH] Altix: more ioc3 cleanups and locking fixes
authorPat Gefre <pfg@sgi.com>
Wed, 1 Mar 2006 00:59:09 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 1 Mar 2006 04:53:43 +0000 (20:53 -0800)
Some "inline" removing that Andrew suggested, removed some locking on
add/remove at this level - we'll let the callees decide.

Signed-off-by: Patrick Gefre <pfg@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/sn/ioc3.c

index 12357e1fa5589e6661472d2752d701566ca41c05..93449a1a0065f5caf493097fa15c5616fe6ed221 100644 (file)
@@ -62,7 +62,7 @@ static int nic_reset(struct ioc3_driver_data *idd)
         return presence;
 }
 
-static inline int nic_read_bit(struct ioc3_driver_data *idd)
+static int nic_read_bit(struct ioc3_driver_data *idd)
 {
        int result;
        unsigned long flags;
@@ -77,7 +77,7 @@ static inline int nic_read_bit(struct ioc3_driver_data *idd)
        return result;
 }
 
-static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit)
+static void nic_write_bit(struct ioc3_driver_data *idd, int bit)
 {
        if (bit)
                writel(mcr_pack(6, 110), &idd->vma->mcr);
@@ -371,8 +371,7 @@ static void probe_nic(struct ioc3_driver_data *idd)
 
 /* Interrupts */
 
-static inline void
-write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
+static void write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
 {
        unsigned long flags;
 
@@ -735,14 +734,12 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
        }
 
        /* Add this IOC3 to all submodules */
-       read_lock(&ioc3_submodules_lock);
        for(id=0;id<IOC3_MAX_SUBMODULES;id++)
                if(ioc3_submodules[id] && ioc3_submodules[id]->probe) {
                        idd->active[id] = 1;
                        idd->active[id] = !ioc3_submodules[id]->probe
                                                (ioc3_submodules[id], idd);
                }
-       read_unlock(&ioc3_submodules_lock);
 
        printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev));
 
@@ -767,7 +764,6 @@ static void ioc3_remove(struct pci_dev *pdev)
        idd = pci_get_drvdata(pdev);
 
        /* Remove this IOC3 from all submodules */
-       read_lock(&ioc3_submodules_lock);
        for(id=0;id<IOC3_MAX_SUBMODULES;id++)
                if(idd->active[id]) {
                        if(ioc3_submodules[id] && ioc3_submodules[id]->remove)
@@ -781,7 +777,6 @@ static void ioc3_remove(struct pci_dev *pdev)
                                                pci_name(pdev));
                        idd->active[id] = 0;
                }
-       read_unlock(&ioc3_submodules_lock);
 
        /* Clear and disable all IRQs */
        write_ireg(idd, ~0, IOC3_W_IEC);