[PATCH 2/4] libata: Add ata_port_init

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

 



Separate out the ata_port initialization from ata_host_init
so that it can be used in future SAS patches.

Signed-off-by: Brian King <brking@xxxxxxxxxx>
---

 libata-dev-bjking1/drivers/scsi/libata-core.c |   49 ++++++++++++++++++--------
 libata-dev-bjking1/drivers/scsi/libata.h      |    2 +
 2 files changed, 36 insertions(+), 15 deletions(-)

diff -puN drivers/scsi/libata-core.c~libata_port_init drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_port_init	2006-08-07 09:06:37.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-08-07 12:39:34.000000000 -0500
@@ -5240,35 +5240,25 @@ void ata_dev_init(struct ata_device *dev
 }
 
 /**
- *	ata_host_init - Initialize an ata_port structure
+ *	ata_port_init - Initialize an ata_port structure
  *	@ap: Structure to initialize
- *	@host: associated SCSI mid-layer structure
  *	@host_set: Collection of hosts to which @ap belongs
  *	@ent: Probe information provided by low-level driver
  *	@port_no: Port number associated with this ata_port
  *
- *	Initialize a new ata_port structure, and its associated
- *	scsi_host.
+ *	Initialize a new ata_port structure.
  *
  *	LOCKING:
  *	Inherited from caller.
  */
-static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
-			  struct ata_host_set *host_set,
-			  const struct ata_probe_ent *ent, unsigned int port_no)
+void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set,
+		   const struct ata_probe_ent *ent, unsigned int port_no)
 {
 	unsigned int i;
 
-	host->max_id = 16;
-	host->max_lun = 1;
-	host->max_channel = 1;
-	host->unique_id = ata_unique_id++;
-	host->max_cmd_len = 12;
-
 	ap->lock = &host_set->lock;
 	ap->flags = ATA_FLAG_DISABLED;
-	ap->id = host->unique_id;
-	ap->host = host;
+	ap->id = ata_unique_id++;
 	ap->ctl = ATA_DEVCTL_OBS;
 	ap->host_set = host_set;
 	ap->dev = ent->dev;
@@ -5320,6 +5310,35 @@ static void ata_host_init(struct ata_por
 }
 
 /**
+ *	ata_host_init - Initialize an ata_port structure
+ *	@ap: Structure to initialize
+ *	@host: associated SCSI mid-layer structure
+ *	@host_set: Collection of hosts to which @ap belongs
+ *	@ent: Probe information provided by low-level driver
+ *	@port_no: Port number associated with this ata_port
+ *
+ *	Initialize a new ata_port structure, and its associated
+ *	scsi_host.
+ *
+ *	LOCKING:
+ *	Inherited from caller.
+ */
+
+static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
+			  struct ata_host_set *host_set,
+			  const struct ata_probe_ent *ent, unsigned int port_no)
+{
+	ata_port_init(ap, host_set, ent, port_no);
+	ap->host = host;
+
+	host->unique_id = ap->id;
+	host->max_id = 16;
+	host->max_lun = 1;
+	host->max_channel = 1;
+	host->max_cmd_len = 12;
+}
+
+/**
  *	ata_host_add - Attach low-level ATA driver to system
  *	@ent: Information provided by low-level driver
  *	@host_set: Collections of ports to which we add
diff -puN drivers/scsi/libata.h~libata_port_init drivers/scsi/libata.h
--- libata-dev/drivers/scsi/libata.h~libata_port_init	2006-08-07 09:06:37.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata.h	2006-08-07 12:37:58.000000000 -0500
@@ -69,6 +69,8 @@ extern int ata_flush_cache(struct ata_de
 extern void ata_dev_init(struct ata_device *dev);
 extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
 extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
+extern void ata_port_init(struct ata_port *ap, struct ata_host_set *host_set,
+			  const struct ata_probe_ent *ent, unsigned int port_no);
 
 
 /* libata-scsi.c */
_
-
: 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