Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298159
b: refs/heads/master
c: 7c8d206
h: refs/heads/master
i:
  298157: 712e952
  298155: 817ba85
  298151: e3e5f64
  298143: b4a8762
v: v3
  • Loading branch information
Paul Parsons authored and David Woodhouse committed Mar 26, 2012
1 parent 3610af2 commit 1372475
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fbabf3f45a15c2b39170980cee01368138f4d79
refs/heads/master: 7c8d206f219fe52966d970f791246a542718e5ba
13 changes: 12 additions & 1 deletion trunk/drivers/mtd/maps/pcmciamtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,24 @@ static void pcmcia_copy_to(struct map_info *map, unsigned long to, const void *f
}


static DEFINE_SPINLOCK(pcmcia_vpp_lock);
static int pcmcia_vpp_refcnt;
static void pcmciamtd_set_vpp(struct map_info *map, int on)
{
struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
struct pcmcia_device *link = dev->p_dev;
unsigned long flags;

pr_debug("dev = %p on = %d vpp = %d\n\n", dev, on, dev->vpp);
pcmcia_fixup_vpp(link, on ? dev->vpp : 0);
spin_lock_irqsave(&pcmcia_vpp_lock, flags);
if (on) {
if (++pcmcia_vpp_refcnt == 1) /* first nested 'on' */
pcmcia_fixup_vpp(link, dev->vpp);
} else {
if (--pcmcia_vpp_refcnt == 0) /* last nested 'off' */
pcmcia_fixup_vpp(link, 0);
}
spin_unlock_irqrestore(&pcmcia_vpp_lock, flags);
}


Expand Down

0 comments on commit 1372475

Please sign in to comment.