lkml.org 
[lkml]   [2022]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 02/26] drm: bochs: Use the dev_pm_ops provided by modeset helper
    Date
    Use the drm_mode_config_pm_ops structure exported by
    drm_modeset_helper.c, which provides the exact same PM callbacks.

    Signed-off-by: Paul Cercueil <paul@crapouillou.net>
    ---
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: virtualization@lists.linux-foundation.org
    ---
    drivers/gpu/drm/tiny/bochs.c | 27 ++-------------------------
    1 file changed, 2 insertions(+), 25 deletions(-)

    diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
    index 04682f831544..26e9cba89f68 100644
    --- a/drivers/gpu/drm/tiny/bochs.c
    +++ b/drivers/gpu/drm/tiny/bochs.c
    @@ -2,6 +2,7 @@

    #include <linux/module.h>
    #include <linux/pci.h>
    +#include <linux/pm.h>

    #include <drm/drm_aperture.h>
    #include <drm/drm_atomic_helper.h>
    @@ -610,30 +611,6 @@ static const struct drm_driver bochs_driver = {
    DRM_GEM_VRAM_DRIVER,
    };

    -/* ---------------------------------------------------------------------- */
    -/* pm interface */
    -
    -#ifdef CONFIG_PM_SLEEP
    -static int bochs_pm_suspend(struct device *dev)
    -{
    - struct drm_device *drm_dev = dev_get_drvdata(dev);
    -
    - return drm_mode_config_helper_suspend(drm_dev);
    -}
    -
    -static int bochs_pm_resume(struct device *dev)
    -{
    - struct drm_device *drm_dev = dev_get_drvdata(dev);
    -
    - return drm_mode_config_helper_resume(drm_dev);
    -}
    -#endif
    -
    -static const struct dev_pm_ops bochs_pm_ops = {
    - SET_SYSTEM_SLEEP_PM_OPS(bochs_pm_suspend,
    - bochs_pm_resume)
    -};
    -
    /* ---------------------------------------------------------------------- */
    /* pci interface */

    @@ -721,7 +698,7 @@ static struct pci_driver bochs_pci_driver = {
    .id_table = bochs_pci_tbl,
    .probe = bochs_pci_probe,
    .remove = bochs_pci_remove,
    - .driver.pm = &bochs_pm_ops,
    + .driver.pm = pm_sleep_ptr(&drm_mode_config_pm_ops),
    };

    /* ---------------------------------------------------------------------- */
    --
    2.35.1
    \
     
     \ /
      Last update: 2022-11-07 18:52    [W:4.148 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site