[SCSI] sd, sr: do not emit change event at device add
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 19 Mar 2008 12:09:56 +0000 (13:09 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 19 Mar 2008 16:28:56 +0000 (11:28 -0500)
Initialize the "state changed" flag, so we do not send a change event
immediately after registering a new device.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sd.c
drivers/scsi/sr.c

index 7aee64dbfbeb2391678d555a4fb0e4e999255080..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)
index 208565bdbe8e946c5f7c0676d72c2b04174d59fa..7ee86d4a761810f6c66ffbd5ce4af203a824edeb 100644 (file)
@@ -623,6 +623,7 @@ static int sr_probe(struct device *dev)
        cd->disk = disk;
        cd->capacity = 0x1fffff;
        cd->device->changed = 1;        /* force recheck CD type */
+       cd->previous_state = 1;
        cd->use = 1;
        cd->readcd_known = 0;
        cd->readcd_cdda = 0;