]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/sd.c
[SCSI] sd, sr: do not emit change event at device add
[linux-2.6-omap-h63xx.git] / drivers / scsi / sd.c
index 37df8bbe7f462b3c74228abef8f9ed71a6e6e731..5fe7aaed904c3230c08a3a02e6c7a8cc082760a0 100644 (file)
@@ -1654,6 +1654,7 @@ static int sd_probe(struct device *dev)
        sdkp->disk = gd;
        sdkp->index = index;
        sdkp->openers = 0;
+       sdkp->previous_state = 1;
 
        if (!sdp->timeout) {
                if (sdp->type != TYPE_MOD)
@@ -1835,8 +1836,7 @@ static int sd_suspend(struct device *dev, pm_message_t mesg)
                        goto done;
        }
 
-       if (mesg.event == PM_EVENT_SUSPEND &&
-           sdkp->device->manage_start_stop) {
+       if ((mesg.event & PM_EVENT_SLEEP) && sdkp->device->manage_start_stop) {
                sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
                ret = sd_start_stop_device(sdkp, 0);
        }