Skip to content

Commit 841b7eb

Browse files
committed
driver core: platform: fix ups for constant struct device_driver
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ff985c7 commit 841b7eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/base/platform.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ static int platform_legacy_resume(struct device *dev)
11221122

11231123
int platform_pm_suspend(struct device *dev)
11241124
{
1125-
struct device_driver *drv = dev->driver;
1125+
const struct device_driver *drv = dev->driver;
11261126
int ret = 0;
11271127

11281128
if (!drv)
@@ -1140,7 +1140,7 @@ int platform_pm_suspend(struct device *dev)
11401140

11411141
int platform_pm_resume(struct device *dev)
11421142
{
1143-
struct device_driver *drv = dev->driver;
1143+
const struct device_driver *drv = dev->driver;
11441144
int ret = 0;
11451145

11461146
if (!drv)
@@ -1162,7 +1162,7 @@ int platform_pm_resume(struct device *dev)
11621162

11631163
int platform_pm_freeze(struct device *dev)
11641164
{
1165-
struct device_driver *drv = dev->driver;
1165+
const struct device_driver *drv = dev->driver;
11661166
int ret = 0;
11671167

11681168
if (!drv)
@@ -1180,7 +1180,7 @@ int platform_pm_freeze(struct device *dev)
11801180

11811181
int platform_pm_thaw(struct device *dev)
11821182
{
1183-
struct device_driver *drv = dev->driver;
1183+
const struct device_driver *drv = dev->driver;
11841184
int ret = 0;
11851185

11861186
if (!drv)
@@ -1198,7 +1198,7 @@ int platform_pm_thaw(struct device *dev)
11981198

11991199
int platform_pm_poweroff(struct device *dev)
12001200
{
1201-
struct device_driver *drv = dev->driver;
1201+
const struct device_driver *drv = dev->driver;
12021202
int ret = 0;
12031203

12041204
if (!drv)
@@ -1216,7 +1216,7 @@ int platform_pm_poweroff(struct device *dev)
12161216

12171217
int platform_pm_restore(struct device *dev)
12181218
{
1219-
struct device_driver *drv = dev->driver;
1219+
const struct device_driver *drv = dev->driver;
12201220
int ret = 0;
12211221

12221222
if (!drv)

0 commit comments

Comments
 (0)