|
@@ -3405,6 +3405,9 @@ int blk_pre_runtime_suspend(struct request_queue *q)
|
|
|
{
|
|
|
int ret = 0;
|
|
|
|
|
|
+ if (!q->dev)
|
|
|
+ return ret;
|
|
|
+
|
|
|
spin_lock_irq(q->queue_lock);
|
|
|
if (q->nr_pending) {
|
|
|
ret = -EBUSY;
|
|
@@ -3432,6 +3435,9 @@ EXPORT_SYMBOL(blk_pre_runtime_suspend);
|
|
|
*/
|
|
|
void blk_post_runtime_suspend(struct request_queue *q, int err)
|
|
|
{
|
|
|
+ if (!q->dev)
|
|
|
+ return;
|
|
|
+
|
|
|
spin_lock_irq(q->queue_lock);
|
|
|
if (!err) {
|
|
|
q->rpm_status = RPM_SUSPENDED;
|
|
@@ -3456,6 +3462,9 @@ EXPORT_SYMBOL(blk_post_runtime_suspend);
|
|
|
*/
|
|
|
void blk_pre_runtime_resume(struct request_queue *q)
|
|
|
{
|
|
|
+ if (!q->dev)
|
|
|
+ return;
|
|
|
+
|
|
|
spin_lock_irq(q->queue_lock);
|
|
|
q->rpm_status = RPM_RESUMING;
|
|
|
spin_unlock_irq(q->queue_lock);
|
|
@@ -3478,6 +3487,9 @@ EXPORT_SYMBOL(blk_pre_runtime_resume);
|
|
|
*/
|
|
|
void blk_post_runtime_resume(struct request_queue *q, int err)
|
|
|
{
|
|
|
+ if (!q->dev)
|
|
|
+ return;
|
|
|
+
|
|
|
spin_lock_irq(q->queue_lock);
|
|
|
if (!err) {
|
|
|
q->rpm_status = RPM_ACTIVE;
|