]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
driver core: platform: fix ups for constant struct device_driver
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2024 13:01:05 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Jun 2024 14:43:46 +0000 (16:43 +0200)
Fix up a few places in the platform core code that can easily handle
struct device_driver being constant.  This is part of the work to make
all struct device_driver pointers be constant.

Cc: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20240611130103.3262749-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c

index c8aa1be70526496069a13803d32ae51bcc9a40f4..a6884479f4ac6f98c14c4372bc844e7b9cc2b557 100644 (file)
@@ -1122,7 +1122,7 @@ static int platform_legacy_resume(struct device *dev)
 
 int platform_pm_suspend(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)
@@ -1140,7 +1140,7 @@ int platform_pm_suspend(struct device *dev)
 
 int platform_pm_resume(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)
@@ -1162,7 +1162,7 @@ int platform_pm_resume(struct device *dev)
 
 int platform_pm_freeze(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)
@@ -1180,7 +1180,7 @@ int platform_pm_freeze(struct device *dev)
 
 int platform_pm_thaw(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)
@@ -1198,7 +1198,7 @@ int platform_pm_thaw(struct device *dev)
 
 int platform_pm_poweroff(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)
@@ -1216,7 +1216,7 @@ int platform_pm_poweroff(struct device *dev)
 
 int platform_pm_restore(struct device *dev)
 {
-       struct device_driver *drv = dev->driver;
+       const struct device_driver *drv = dev->driver;
        int ret = 0;
 
        if (!drv)