Re: [PATCH] PM: lenient generic runtime pm callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ohad Ben-Cohen <ohad@xxxxxxxxxx> writes:

> Allow drivers, that belong to subsystems which use the generic
> runtime pm callbacks, not to define runtime pm suspend/resume handlers,
> by implicitly assuming success in such cases.
>
> This is needed to eliminate nop handlers that would otherwise be
> necessary by drivers which enable runtime pm, but don't need
> to do anything when their devices are runtime-suspended/resumed.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@xxxxxxxxxx>

Acked-by: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>

for runtime PM of on-chip devices on OMAP, this will cleanup several nop
handlers we have had to put in place.

FWIW, the 'no_callbacks' approach won't work for runtime PM of on-chip
devices for us since most of the devices will have callbacks, only some
will not need them.

Kevin

> ---
>  drivers/base/power/generic_ops.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
> index 4b29d49..81f2c84 100644
> --- a/drivers/base/power/generic_ops.c
> +++ b/drivers/base/power/generic_ops.c
> @@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>  	int ret;
>  
> -	ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
> +	ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
>  
>  	return ret;
>  }
> @@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
>  	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
>  	int ret;
>  
> -	ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
> +	ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
>  
>  	return ret;
>  }
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux