Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298160
b: refs/heads/master
c: ee478af
h: refs/heads/master
v: v3
  • Loading branch information
Paul Parsons authored and David Woodhouse committed Mar 26, 2012
1 parent 1372475 commit ceaf957
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 7c8d206f219fe52966d970f791246a542718e5ba
refs/heads/master: ee478af8b675908b217198a75cf759d422a81ccb
14 changes: 13 additions & 1 deletion trunk/drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ struct sa_info {
struct sa_subdev_info subdev[0];
};

static DEFINE_SPINLOCK(sa1100_vpp_lock);
static int sa1100_vpp_refcnt;
static void sa1100_set_vpp(struct map_info *map, int on)
{
struct sa_subdev_info *subdev = container_of(map, struct sa_subdev_info, map);
subdev->plat->set_vpp(on);
unsigned long flags;

spin_lock_irqsave(&sa1100_vpp_lock, flags);
if (on) {
if (++sa1100_vpp_refcnt == 1) /* first nested 'on' */
subdev->plat->set_vpp(1);
} else {
if (--sa1100_vpp_refcnt == 0) /* last nested 'off' */
subdev->plat->set_vpp(0);
}
spin_unlock_irqrestore(&sa1100_vpp_lock, flags);
}

static void sa1100_destroy_subdev(struct sa_subdev_info *subdev)
Expand Down

0 comments on commit ceaf957

Please sign in to comment.