[PATCH 05/13] libata-hp: call ata_dev_init() from ata_bus_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Call ata_dev_init() before actual probing instead of during host
initialization.  This is in preparation of hotplug.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>

---

 drivers/scsi/libata-core.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

bc205de9459b473c8fef86b3f4e6e356aa9186fd
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 3406f3d..09e82f9 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1466,7 +1466,6 @@ static void ata_dev_init(struct ata_port
  *	RETURNS:
  *	Zero on success, negative errno otherwise.
  */
-
 static int ata_bus_probe(struct ata_port *ap)
 {
 	unsigned int classes[ATA_MAX_DEVICES];
@@ -1476,8 +1475,10 @@ static int ata_bus_probe(struct ata_port
 
 	ata_port_probe(ap);
 
-	for (i = 0; i < ATA_MAX_DEVICES; i++)
+	for (i = 0; i < ATA_MAX_DEVICES; i++) {
 		tries[i] = ATA_PROBE_MAX_TRIES;
+		ata_dev_init(ap, &ap->device[i]);
+	}
 
  retry:
 	down_xfermask = 0;
@@ -4882,11 +4883,8 @@ static void ata_host_init(struct ata_por
 	INIT_WORK(&ap->port_task, NULL, NULL);
 	INIT_LIST_HEAD(&ap->eh_done_q);
 
-	for (i = 0; i < ATA_MAX_DEVICES; i++) {
-		struct ata_device *dev = &ap->device[i];
-		dev->devno = i;
-		ata_dev_init(ap, dev);
-	}
+	for (i = 0; i < ATA_MAX_DEVICES; i++)
+		ap->device[i].devno = i;
 
 #ifdef ATA_IRQ_TRAP
 	ap->stats.unhandled_irq = 1;
-- 
1.2.4


-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux