Message ID | 1441851826.5845.105.camel@kxue-X58A-UD3R (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
T24g5ZubLCAyMDE1LTA5LTEwIGF0IDEwOjIzICswODAwLCBLZW4gWHVlIHdyb3RlOg0KDQpDYW4g c29tZW9uZSBoZWxwIHRvIGFwcGx5IHRoaXMgcGF0Y2ggc2VyaWVzPyBUaGFua3MuDQpodHRwOi8v bWFyYy5pbmZvLz9sPWxpbnV4LXNjc2kmbT0xNDQxODUyMDY4MjU2MDkmdz0yDQpodHRwOi8vbWFy Yy5pbmZvLz9sPWxpbnV4LXNjc2kmbT0xNDQxODUyMDg1MjU2MTEmdz0yIA0KDQo+IFJldmVydCAi U0NTSTogRml4IE5VTEwgcG9pbnRlciBkZXJlZmVyZW5jZSBpbiBydW50aW1lIFBNIg0KPiANCj4g VGhpcyByZXZlcnRzIGNvbW1pdCA0OTcxOGYwZmI4YzkgKCJTQ1NJOiBGaXggTlVMTCBwb2ludGVy IGRlcmVmZXJlbmNlDQo+IGluDQo+IHJ1bnRpbWUgUE0iKQ0KPiANCj4gVGhlIG9sZCBjb21taXQg bWF5IGxlYWQgdG8gYSBpc3N1ZSB0aGF0DQo+IGJsa197cHJlfHBvc3R9X3J1bnRpbWVfc3VzcGVu ZCBhbmQNCj4gYmxrX3twcmV8cG9zdH1fcnVudGltZV9yZXN1bWUgY2FuIG5vdCBiZSBjYWxsZWQg aW4gcGFpcnMuDQo+IA0KPiBUYWtlIHNyIGRldmljZSBhcyBleGFtcGxlLCB3aGVuIHNyIGRldmlj ZSBnb2VzIHRvIHJ1bnRpbWUgc3VzcGVuZCwgDQo+IGJsa197cHJlfHBvc3R9X3J1bnRpbWVfc3Vz cGVuZCB3aWxsIGJlIGNhbGxlZCBzaW5jZSBzciBkZXZpY2UgZGVmaW5lZA0KPiBwbS0+cnVudGlt ZV9zdXNwZW5kLiBCdXQgYmxrX3twcmV8cG9zdH1fcnVudGltZV9yZXN1bWUgd2lsbCBub3QgYmUN Cj4gY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Vycik7DQo+IC0JfQ0KPiArCWJsa19w b3N0X3J1bnRpbWVfcmVzdW1lKHNkZXYtPnJlcXVlc3RfcXVldWUsIGVycik7DQo+ICsNCj4gIAly ZXR1cm4gZXJyOw0KPiAgfQ0KPiAg -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index e4b7998..459abe1 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c @@ -219,13 +219,13 @@ static int sdev_runtime_suspend(struct device *dev) struct scsi_device *sdev = to_scsi_device(dev); int err = 0; - if (pm && pm->runtime_suspend) { - err = blk_pre_runtime_suspend(sdev->request_queue); - if (err) - return err; + err = blk_pre_runtime_suspend(sdev->request_queue); + if (err) + return err; + if (pm && pm->runtime_suspend) err = pm->runtime_suspend(dev); - blk_post_runtime_suspend(sdev->request_queue, err); - } + blk_post_runtime_suspend(sdev->request_queue, err); + return err; } @@ -248,11 +248,11 @@ static int sdev_runtime_resume(struct device *dev) const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; int err = 0; - if (pm && pm->runtime_resume) { - blk_pre_runtime_resume(sdev->request_queue); + blk_pre_runtime_resume(sdev->request_queue); + if (pm && pm->runtime_resume) err = pm->runtime_resume(dev); - blk_post_runtime_resume(sdev->request_queue, err); - } + blk_post_runtime_resume(sdev->request_queue, err); + return err; }