Commit e8e3e843 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Adam Wujek

wr_nic: use_count only if WR_IS_SWITCH

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 0e172c86
...@@ -32,11 +32,11 @@ static int wrn_remove(struct platform_device *pdev) ...@@ -32,11 +32,11 @@ static int wrn_remove(struct platform_device *pdev)
struct wrn_dev *wrn = drvdata->wrn; struct wrn_dev *wrn = drvdata->wrn;
int i; int i;
#if 0 if (WR_IS_SWITCH) {
spin_lock(&wrn->lock); spin_lock(&wrn->lock);
--wrn->use_count; /* Hmmm... looks like overkill... */ --wrn->use_count; /* Hmmm... looks like overkill... */
spin_unlock(&wrn->lock); spin_unlock(&wrn->lock);
#endif }
/* First of all, stop any transmission */ /* First of all, stop any transmission */
writel(0, &wrn->regs->CR); writel(0, &wrn->regs->CR);
...@@ -114,16 +114,16 @@ static int wrn_probe(struct platform_device *pdev) ...@@ -114,16 +114,16 @@ static int wrn_probe(struct platform_device *pdev)
/* No need to lock_irq: we only protect count and continue unlocked */ /* No need to lock_irq: we only protect count and continue unlocked */
#if 0 if (WR_IS_SWITCH) {
spin_lock(&wrn->lock); spin_lock(&wrn->lock);
if (++wrn->use_count != 1) { if (++wrn->use_count != 1) {
--wrn->use_count; --wrn->use_count;
spin_unlock(&wrn->lock);
return -EBUSY;
}
spin_unlock(&wrn->lock); spin_unlock(&wrn->lock);
printk("use count %i\n", wrn->use_count);
return -EBUSY;
} }
spin_unlock(&wrn->lock);
#endif
/* Map our resource list and instantiate the shortcut pointers */ /* Map our resource list and instantiate the shortcut pointers */
if ( (err = __wrn_map_resources(pdev)) ) if ( (err = __wrn_map_resources(pdev)) )
goto out; goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment