Skip to content

Commit

Permalink
PM: remove deprecated dpm_runtime_* routines
Browse files Browse the repository at this point in the history
This patch (as933) removes the deprecated dpm_runtime_suspend() and
dpm_runtime_resume() routines from the PM core.  The only user of
those routines is the PCMCIA ds driver; local replacements are added.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 18, 2007
1 parent 471d055 commit 3f8df78
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 109 deletions.
1 change: 0 additions & 1 deletion Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Who: Hans Verkuil <hverkuil@xs4all.nl> and
---------------------------

What: dev->power.power_state
dpm_runtime_{suspend,resume)()
When: July 2007
Why: Broken design for runtime control over driver power states, confusing
driver-internal runtime power management with: mechanisms to support
Expand Down
2 changes: 1 addition & 1 deletion drivers/base/power/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-y := shutdown.o
obj-$(CONFIG_PM) += main.o suspend.o resume.o runtime.o sysfs.o
obj-$(CONFIG_PM) += main.o suspend.o resume.o sysfs.o
obj-$(CONFIG_PM_TRACE) += trace.o

ifeq ($(CONFIG_DEBUG_DRIVER),y)
Expand Down
5 changes: 0 additions & 5 deletions drivers/base/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ extern int resume_device(struct device *);
*/
extern int suspend_device(struct device *, pm_message_t);


/*
* runtime.c
*/

#else /* CONFIG_PM */


Expand Down
85 changes: 0 additions & 85 deletions drivers/base/power/runtime.c

This file was deleted.

40 changes: 34 additions & 6 deletions drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,34 @@ static int pcmcia_bus_uevent(struct device *dev, char **envp, int num_envp,

#endif

/************************ runtime PM support ***************************/

static int pcmcia_dev_suspend(struct device *dev, pm_message_t state);
static int pcmcia_dev_resume(struct device *dev);

static int runtime_suspend(struct device *dev)
{
int rc;

down(&dev->sem);
rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
up(&dev->sem);
if (!rc)
dev->power.power_state.event = PM_EVENT_SUSPEND;
return rc;
}

static void runtime_resume(struct device *dev)
{
int rc;

down(&dev->sem);
rc = pcmcia_dev_resume(dev);
up(&dev->sem);
if (!rc)
dev->power.power_state.event = PM_EVENT_ON;
}

/************************ per-device sysfs output ***************************/

#define pcmcia_device_attr(field, test, format) \
Expand Down Expand Up @@ -1173,9 +1201,9 @@ static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute
return -EINVAL;

if ((!p_dev->suspended) && !strncmp(buf, "off", 3))
ret = dpm_runtime_suspend(dev, PMSG_SUSPEND);
ret = runtime_suspend(dev);
else if (p_dev->suspended && !strncmp(buf, "on", 2))
dpm_runtime_resume(dev);
runtime_resume(dev);

return ret ? ret : count;
}
Expand Down Expand Up @@ -1312,21 +1340,21 @@ static int pcmcia_bus_suspend_callback(struct device *dev, void * _data)
struct pcmcia_socket *skt = _data;
struct pcmcia_device *p_dev = to_pcmcia_dev(dev);

if (p_dev->socket != skt)
if (p_dev->socket != skt || p_dev->suspended)
return 0;

return dpm_runtime_suspend(dev, PMSG_SUSPEND);
return runtime_suspend(dev);
}

static int pcmcia_bus_resume_callback(struct device *dev, void * _data)
{
struct pcmcia_socket *skt = _data;
struct pcmcia_device *p_dev = to_pcmcia_dev(dev);

if (p_dev->socket != skt)
if (p_dev->socket != skt || !p_dev->suspended)
return 0;

dpm_runtime_resume(dev);
runtime_resume(dev);

return 0;
}
Expand Down
11 changes: 0 additions & 11 deletions include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ extern int device_prepare_suspend(pm_message_t state);
#define device_may_wakeup(dev) \
(device_can_wakeup(dev) && (dev)->power.should_wakeup)

extern int dpm_runtime_suspend(struct device *, pm_message_t);
extern void dpm_runtime_resume(struct device *);
extern void __suspend_report_result(const char *function, void *fn, int ret);

#define suspend_report_result(fn, ret) \
Expand Down Expand Up @@ -317,15 +315,6 @@ static inline int device_suspend(pm_message_t state)
#define device_set_wakeup_enable(dev,val) do{}while(0)
#define device_may_wakeup(dev) (0)

static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
{
return 0;
}

static inline void dpm_runtime_resume(struct device * dev)
{
}

#define suspend_report_result(fn, ret) do { } while (0)

static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
Expand Down

0 comments on commit 3f8df78

Please sign in to comment.