Skip to content

Commit

Permalink
[PATCH] Altix: more ioc3 cleanups and locking fixes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Pat Gefre authored and Linus Torvalds committed Mar 1, 2006
1 parent 9cff337 commit 15b370c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/sn/ioc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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));

Expand All @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 15b370c

Please sign in to comment.