diff options
-rw-r--r-- | drivers/spi/spi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 791c4dc550ae..94f5e8ed83a7 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -90,7 +90,7 @@ static int spi_suspend(struct device *dev, pm_message_t message) | |||
90 | int value; | 90 | int value; |
91 | struct spi_driver *drv = to_spi_driver(dev->driver); | 91 | struct spi_driver *drv = to_spi_driver(dev->driver); |
92 | 92 | ||
93 | if (!drv->suspend) | 93 | if (!drv || !drv->suspend) |
94 | return 0; | 94 | return 0; |
95 | 95 | ||
96 | /* suspend will stop irqs and dma; no more i/o */ | 96 | /* suspend will stop irqs and dma; no more i/o */ |
@@ -105,7 +105,7 @@ static int spi_resume(struct device *dev) | |||
105 | int value; | 105 | int value; |
106 | struct spi_driver *drv = to_spi_driver(dev->driver); | 106 | struct spi_driver *drv = to_spi_driver(dev->driver); |
107 | 107 | ||
108 | if (!drv->resume) | 108 | if (!drv || !drv->resume) |
109 | return 0; | 109 | return 0; |
110 | 110 | ||
111 | /* resume may restart the i/o queue */ | 111 | /* resume may restart the i/o queue */ |
@@ -449,7 +449,6 @@ void spi_unregister_master(struct spi_master *master) | |||
449 | { | 449 | { |
450 | (void) device_for_each_child(master->cdev.dev, NULL, __unregister); | 450 | (void) device_for_each_child(master->cdev.dev, NULL, __unregister); |
451 | class_device_unregister(&master->cdev); | 451 | class_device_unregister(&master->cdev); |
452 | master->cdev.dev = NULL; | ||
453 | } | 452 | } |
454 | EXPORT_SYMBOL_GPL(spi_unregister_master); | 453 | EXPORT_SYMBOL_GPL(spi_unregister_master); |
455 | 454 | ||