]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/panfrost: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 20 Sep 2021 09:05:17 +0000 (11:05 +0200)
committerSteven Price <steven.price@arm.com>
Mon, 20 Sep 2021 13:34:37 +0000 (14:34 +0100)
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210920090522.23784-6-wsa+renesas@sang-engineering.com
drivers/gpu/drm/panfrost/panfrost_device.c

index 1c692428b0d42e21c25084e30df1a2e8eb9fb691..7f51a4682ccb1d3fd5e7ddeaaad6926cbd780352 100644 (file)
@@ -398,8 +398,7 @@ void panfrost_device_reset(struct panfrost_device *pfdev)
 #ifdef CONFIG_PM
 int panfrost_device_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct panfrost_device *pfdev = platform_get_drvdata(pdev);
+       struct panfrost_device *pfdev = dev_get_drvdata(dev);
 
        panfrost_device_reset(pfdev);
        panfrost_devfreq_resume(pfdev);
@@ -409,8 +408,7 @@ int panfrost_device_resume(struct device *dev)
 
 int panfrost_device_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct panfrost_device *pfdev = platform_get_drvdata(pdev);
+       struct panfrost_device *pfdev = dev_get_drvdata(dev);
 
        if (!panfrost_job_is_idle(pfdev))
                return -EBUSY;