From: Tejun Heo Date: Sun, 5 Mar 2006 08:55:58 +0000 (+0900) Subject: [PATCH] libata: re-initialize parameters before configuring X-Git-Tag: firefly_0821_release~37605^2~29 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=208a9933bc7d71e7ad194a9ffbfbcd7878c48dfe;p=firefly-linux-kernel-4.4.55.git [PATCH] libata: re-initialize parameters before configuring In ata_dev_configure(), reinitialize parameters before configuring. This change is for revalidation and hotplug. As ata_dev_configure() can be entered multiple times, parameters need to be reinitialized. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b710fc480740..59828490a750 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -1086,6 +1086,15 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev) DPRINTK("ENTER, host %u, dev %u\n", ap->id, dev->devno); + /* initialize to-be-configured parameters */ + dev->flags = 0; + dev->max_sectors = 0; + dev->cdb_len = 0; + dev->n_sectors = 0; + dev->cylinders = 0; + dev->heads = 0; + dev->sectors = 0; + /* * common ATA, ATAPI feature tests */