[PATCH] drm/omap: tiler: add hibernation callback

Rob Clark robdclark at gmail.com
Wed Mar 18 09:04:38 PDT 2015


On Wed, Feb 25, 2015 at 1:08 PM,  <grygorii.strashko at linaro.org> wrote:
> From: Grygorii Strashko <grygorii.strashko at linaro.org>
>
> Setting a dev_pm_ops resume callback but not a set of
> hibernation handler means that pm function will not be
> called upon hibernation.
> Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
> assigns the suspend and hibernation handlers and move
> omap_dmm_resume under CONFIG_PM_SLEEP to avoid build warnings.
>
> Signed-off-by: Grygorii Strashko <grygorii.strashko at linaro.org>

Reviewed-by: Rob Clark <robdclark at gmail.com>

> ---
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> index 56c6055..afb8cfc 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -941,7 +941,7 @@ error:
>  }
>  #endif
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
>  static int omap_dmm_resume(struct device *dev)
>  {
>         struct tcm_area area;
> @@ -965,12 +965,10 @@ static int omap_dmm_resume(struct device *dev)
>
>         return 0;
>  }
> -
> -static const struct dev_pm_ops omap_dmm_pm_ops = {
> -       .resume = omap_dmm_resume,
> -};
>  #endif
>
> +SIMPLE_DEV_PM_OPS(omap_dmm_pm_ops, NULL, omap_dmm_resume);
> +
>  #if defined(CONFIG_OF)
>  static const struct of_device_id dmm_of_match[] = {
>         { .compatible = "ti,omap4-dmm", },
> @@ -986,9 +984,7 @@ struct platform_driver omap_dmm_driver = {
>                 .owner = THIS_MODULE,
>                 .name = DMM_DRIVER_NAME,
>                 .of_match_table = of_match_ptr(dmm_of_match),
> -#ifdef CONFIG_PM
>                 .pm = &omap_dmm_pm_ops,
> -#endif
>         },
>  };
>
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


More information about the dri-devel mailing list