diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/platform.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 0358dc3ea3ad..e9477e0bbca5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -1351,9 +1351,13 @@ static int platform_remove(struct device *_dev) static void platform_shutdown(struct device *_dev) { - struct platform_driver *drv = to_platform_driver(_dev->driver); struct platform_device *dev = to_platform_device(_dev); + struct platform_driver *drv; + + if (!_dev->driver) + return; + drv = to_platform_driver(_dev->driver); if (drv->shutdown) drv->shutdown(dev); } |