X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fspi%2Fspi.c;h=94f5e8ed83a7a8427105201aaa81f14ff5c710c7;hb=f11a7c0935637c15416679bd347bbc4eac1ca740;hp=791c4dc550aee0e7df764270282ef977edf6a151;hpb=5d870c8e216f121307445c71caa72e7e10a20061;p=linux-2.6-omap-h63xx.git diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 791c4dc550a..94f5e8ed83a 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) int value; struct spi_driver *drv = to_spi_driver(dev->driver); - if (!drv->suspend) + if (!drv || !drv->suspend) return 0; /* suspend will stop irqs and dma; no more i/o */ @@ -105,7 +105,7 @@ static int spi_resume(struct device *dev) int value; struct spi_driver *drv = to_spi_driver(dev->driver); - if (!drv->resume) + if (!drv || !drv->resume) return 0; /* resume may restart the i/o queue */ @@ -449,7 +449,6 @@ void spi_unregister_master(struct spi_master *master) { (void) device_for_each_child(master->cdev.dev, NULL, __unregister); class_device_unregister(&master->cdev); - master->cdev.dev = NULL; } EXPORT_SYMBOL_GPL(spi_unregister_master);