Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10764
b: refs/heads/master
c: e9b7bd4
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent b919a80 commit 74cb94c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 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: a1d59ce842a35b552f22868404e4e7c923242257
refs/heads/master: e9b7bd4ee7f6e3ee002dc72c5211cd97c7186d00
26 changes: 3 additions & 23 deletions trunk/drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ LIST_HEAD(dpm_off_irq);
DECLARE_MUTEX(dpm_sem);
DECLARE_MUTEX(dpm_list_sem);

/*
* PM Reference Counting.
*/

static inline void device_pm_hold(struct device * dev)
{
if (dev)
atomic_inc(&dev->power.pm_users);
}

static inline void device_pm_release(struct device * dev)
{
if (dev)
atomic_dec(&dev->power.pm_users);
}


/**
* device_pm_set_parent - Specify power dependency.
* @dev: Device who needs power.
Expand All @@ -62,10 +45,8 @@ static inline void device_pm_release(struct device * dev)

void device_pm_set_parent(struct device * dev, struct device * parent)
{
struct device * old_parent = dev->power.pm_parent;
device_pm_release(old_parent);
dev->power.pm_parent = parent;
device_pm_hold(parent);
put_device(dev->power.pm_parent);
dev->power.pm_parent = get_device(parent);
}
EXPORT_SYMBOL_GPL(device_pm_set_parent);

Expand All @@ -75,7 +56,6 @@ int device_pm_add(struct device * dev)

pr_debug("PM: Adding info for %s:%s\n",
dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
atomic_set(&dev->power.pm_users, 0);
down(&dpm_list_sem);
list_add_tail(&dev->power.entry, &dpm_active);
device_pm_set_parent(dev, dev->parent);
Expand All @@ -91,7 +71,7 @@ void device_pm_remove(struct device * dev)
dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
down(&dpm_list_sem);
dpm_sysfs_remove(dev);
device_pm_release(dev->power.pm_parent);
put_device(dev->power.pm_parent);
list_del_init(&dev->power.entry);
up(&dpm_list_sem);
}
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ struct dev_pm_info {
unsigned should_wakeup:1;
pm_message_t prev_state;
void * saved_state;
atomic_t pm_users;
struct device * pm_parent;
struct list_head entry;
#endif
Expand Down

0 comments on commit 74cb94c

Please sign in to comment.