Re: [PATCH 2/4] PM: Run the driver callback directly if the subsystemone is not there
From: Alan Stern
Date: Sat Dec 10 2011 - 09:59:22 EST
On Sat, 10 Dec 2011, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@xxxxxxx>
>
> Make the PM core execute driver PM callbacks directly if the
> corresponding subsystem callbacks are not present.
> --- linux.orig/drivers/base/power/runtime.c
> +++ linux/drivers/base/power/runtime.c
> @@ -250,6 +250,9 @@ static int rpm_idle(struct device *dev,
> else
> callback = NULL;
>
> + if (!callback && dev->driver && dev->driver->pm)
> + callback = dev->driver->pm->runtime_idle;
> +
> if (callback)
> __rpm_callback(callback, dev);
>
> @@ -713,6 +716,12 @@ static int rpm_resume(struct device *dev
> else
> callback = NULL;
>
> + if (!callback && dev->driver && dev->driver->pm)
> + callback = dev->driver->pm->runtime_suspend;
> +
> + if (!callback && dev->driver && dev->driver->pm)
> + callback = dev->driver->pm->runtime_resume;
> +
> retval = rpm_callback(callback, dev);
> if (retval) {
> __update_runtime_status(dev, RPM_SUSPENDED);
Looks like part of that got added in the wrong place.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/