aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sn/ioc3.c
diff options
context:
space:
mode:
authorPat Gefre <pfg@sgi.com>2006-02-28 19:59:09 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-28 23:53:43 -0500
commit15b370c95cbc1553eec30a99a5ffb3ac3c8d7b81 (patch)
tree267315602c0e5304c8b705ede315de53234dc010 /drivers/sn/ioc3.c
parent9cff3372bf665652e9dd71c09b817c20f58f754a (diff)
[PATCH] Altix: more ioc3 cleanups and locking fixes
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>
Diffstat (limited to 'drivers/sn/ioc3.c')
-rw-r--r--drivers/sn/ioc3.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index 12357e1fa558..93449a1a0065 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -62,7 +62,7 @@ static int nic_reset(struct ioc3_driver_data *idd)
62 return presence; 62 return presence;
63} 63}
64 64
65static inline int nic_read_bit(struct ioc3_driver_data *idd) 65static int nic_read_bit(struct ioc3_driver_data *idd)
66{ 66{
67 int result; 67 int result;
68 unsigned long flags; 68 unsigned long flags;
@@ -77,7 +77,7 @@ static inline int nic_read_bit(struct ioc3_driver_data *idd)
77 return result; 77 return result;
78} 78}
79 79
80static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit) 80static void nic_write_bit(struct ioc3_driver_data *idd, int bit)
81{ 81{
82 if (bit) 82 if (bit)
83 writel(mcr_pack(6, 110), &idd->vma->mcr); 83 writel(mcr_pack(6, 110), &idd->vma->mcr);
@@ -371,8 +371,7 @@ static void probe_nic(struct ioc3_driver_data *idd)
371 371
372/* Interrupts */ 372/* Interrupts */
373 373
374static inline void 374static void write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
375write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
376{ 375{
377 unsigned long flags; 376 unsigned long flags;
378 377
@@ -735,14 +734,12 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
735 } 734 }
736 735
737 /* Add this IOC3 to all submodules */ 736 /* Add this IOC3 to all submodules */
738 read_lock(&ioc3_submodules_lock);
739 for(id=0;id<IOC3_MAX_SUBMODULES;id++) 737 for(id=0;id<IOC3_MAX_SUBMODULES;id++)
740 if(ioc3_submodules[id] && ioc3_submodules[id]->probe) { 738 if(ioc3_submodules[id] && ioc3_submodules[id]->probe) {
741 idd->active[id] = 1; 739 idd->active[id] = 1;
742 idd->active[id] = !ioc3_submodules[id]->probe 740 idd->active[id] = !ioc3_submodules[id]->probe
743 (ioc3_submodules[id], idd); 741 (ioc3_submodules[id], idd);
744 } 742 }
745 read_unlock(&ioc3_submodules_lock);
746 743
747 printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev)); 744 printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev));
748 745
@@ -767,7 +764,6 @@ static void ioc3_remove(struct pci_dev *pdev)
767 idd = pci_get_drvdata(pdev); 764 idd = pci_get_drvdata(pdev);
768 765
769 /* Remove this IOC3 from all submodules */ 766 /* Remove this IOC3 from all submodules */
770 read_lock(&ioc3_submodules_lock);
771 for(id=0;id<IOC3_MAX_SUBMODULES;id++) 767 for(id=0;id<IOC3_MAX_SUBMODULES;id++)
772 if(idd->active[id]) { 768 if(idd->active[id]) {
773 if(ioc3_submodules[id] && ioc3_submodules[id]->remove) 769 if(ioc3_submodules[id] && ioc3_submodules[id]->remove)
@@ -781,7 +777,6 @@ static void ioc3_remove(struct pci_dev *pdev)
781 pci_name(pdev)); 777 pci_name(pdev));
782 idd->active[id] = 0; 778 idd->active[id] = 0;
783 } 779 }
784 read_unlock(&ioc3_submodules_lock);
785 780
786 /* Clear and disable all IRQs */ 781 /* Clear and disable all IRQs */
787 write_ireg(idd, ~0, IOC3_W_IEC); 782 write_ireg(idd, ~0, IOC3_W_IEC);