diff mbox series

[v2,2/4] drm/ast: Remove test for device from ast_pm_freeze()

Message ID 20200617080340.29584-3-tzimmermann@suse.de (mailing list archive)
State New, archived
Headers show
Series ast cleanups | expand

Commit Message

Thomas Zimmermann June 17, 2020, 8:03 a.m. UTC
The driver cannot suspend before it has loaded completely. So the test
for device pointers is not required. Remove them.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Sam Ravnborg June 20, 2020, 9:11 p.m. UTC | #1
On Wed, Jun 17, 2020 at 10:03:38AM +0200, Thomas Zimmermann wrote:
> The driver cannot suspend before it has loaded completely. So the test
> for device pointers is not required. Remove them.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Sounds resonable.
Acked-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/ast/ast_drv.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index f7a14e4e1df0..0b58f7aee6b0 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -188,9 +188,6 @@ static int ast_pm_freeze(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct drm_device *ddev = pci_get_drvdata(pdev);
> -
> -	if (!ddev || !ddev->dev_private)
> -		return -ENODEV;
>  	return ast_drm_freeze(ddev);
>  }
>  
> -- 
> 2.27.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index f7a14e4e1df0..0b58f7aee6b0 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -188,9 +188,6 @@  static int ast_pm_freeze(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *ddev = pci_get_drvdata(pdev);
-
-	if (!ddev || !ddev->dev_private)
-		return -ENODEV;
 	return ast_drm_freeze(ddev);
 }