aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-31 05:27:30 -0400
committerTejun Heo <htejun@gmail.com>2006-05-31 05:27:30 -0400
commit3ef3b43d5633d30fa3f033f62094ec2e9c5b8376 (patch)
tree815ba1afeb202834667e1dff08fa69b63ec0628f /drivers
parentabdda7331d469fa965167365f011d05e226008fb (diff)
[PATCH] libata-hp-prep: implement ata_dev_init()
Move initialization of struct ata_device into ata_dev_init() in preparation for hotplug. This patch calls ata_dev_init() from ata_host_init() and thus makes no functional difference. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c26
-rw-r--r--drivers/scsi/libata.h1
2 files changed, 22 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 66df895c9617..8fda8228159c 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -5142,6 +5142,26 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
5142} 5142}
5143 5143
5144/** 5144/**
5145 * ata_dev_init - Initialize an ata_device structure
5146 * @dev: Device structure to initialize
5147 *
5148 * Initialize @dev in preparation for probing.
5149 *
5150 * LOCKING:
5151 * Inherited from caller.
5152 */
5153void ata_dev_init(struct ata_device *dev)
5154{
5155 struct ata_port *ap = dev->ap;
5156
5157 memset((void *)dev, 0, sizeof(*dev));
5158 dev->devno = dev - ap->device;
5159 dev->pio_mask = UINT_MAX;
5160 dev->mwdma_mask = UINT_MAX;
5161 dev->udma_mask = UINT_MAX;
5162}
5163
5164/**
5145 * ata_host_init - Initialize an ata_port structure 5165 * ata_host_init - Initialize an ata_port structure
5146 * @ap: Structure to initialize 5166 * @ap: Structure to initialize
5147 * @host: associated SCSI mid-layer structure 5167 * @host: associated SCSI mid-layer structure
@@ -5155,7 +5175,6 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
5155 * LOCKING: 5175 * LOCKING:
5156 * Inherited from caller. 5176 * Inherited from caller.
5157 */ 5177 */
5158
5159static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, 5178static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
5160 struct ata_host_set *host_set, 5179 struct ata_host_set *host_set,
5161 const struct ata_probe_ent *ent, unsigned int port_no) 5180 const struct ata_probe_ent *ent, unsigned int port_no)
@@ -5199,10 +5218,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
5199 for (i = 0; i < ATA_MAX_DEVICES; i++) { 5218 for (i = 0; i < ATA_MAX_DEVICES; i++) {
5200 struct ata_device *dev = &ap->device[i]; 5219 struct ata_device *dev = &ap->device[i];
5201 dev->ap = ap; 5220 dev->ap = ap;
5202 dev->devno = i; 5221 ata_dev_init(dev);
5203 dev->pio_mask = UINT_MAX;
5204 dev->mwdma_mask = UINT_MAX;
5205 dev->udma_mask = UINT_MAX;
5206 } 5222 }
5207 5223
5208#ifdef ATA_IRQ_TRAP 5224#ifdef ATA_IRQ_TRAP
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index d56d9e1d73dc..c2b1c919b964 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -62,6 +62,7 @@ extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
62extern void ata_dev_select(struct ata_port *ap, unsigned int device, 62extern void ata_dev_select(struct ata_port *ap, unsigned int device,
63 unsigned int wait, unsigned int can_sleep); 63 unsigned int wait, unsigned int can_sleep);
64extern void swap_buf_le16(u16 *buf, unsigned int buf_words); 64extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
65extern void ata_dev_init(struct ata_device *dev);
65extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); 66extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
66extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); 67extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
67 68