diff options
author | Tejun Heo <htejun@gmail.com> | 2006-05-31 09:27:30 (GMT) |
---|---|---|
committer | Tejun Heo <htejun@gmail.com> | 2006-05-31 09:27:30 (GMT) |
commit | 3ef3b43d5633d30fa3f033f62094ec2e9c5b8376 (patch) | |
tree | 815ba1afeb202834667e1dff08fa69b63ec0628f /drivers/scsi/libata-core.c | |
parent | abdda7331d469fa965167365f011d05e226008fb (diff) | |
download | linux-fsl-qoriq-3ef3b43d5633d30fa3f033f62094ec2e9c5b8376.tar.xz |
[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/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 66df895..8fda822 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) } /** + * ata_dev_init - Initialize an ata_device structure + * @dev: Device structure to initialize + * + * Initialize @dev in preparation for probing. + * + * LOCKING: + * Inherited from caller. + */ +void ata_dev_init(struct ata_device *dev) +{ + struct ata_port *ap = dev->ap; + + memset((void *)dev, 0, sizeof(*dev)); + dev->devno = dev - ap->device; + dev->pio_mask = UINT_MAX; + dev->mwdma_mask = UINT_MAX; + dev->udma_mask = UINT_MAX; +} + +/** * ata_host_init - Initialize an ata_port structure * @ap: Structure to initialize * @host: associated SCSI mid-layer structure @@ -5155,7 +5175,6 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister) * 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) @@ -5199,10 +5218,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, for (i = 0; i < ATA_MAX_DEVICES; i++) { struct ata_device *dev = &ap->device[i]; dev->ap = ap; - dev->devno = i; - dev->pio_mask = UINT_MAX; - dev->mwdma_mask = UINT_MAX; - dev->udma_mask = UINT_MAX; + ata_dev_init(dev); } #ifdef ATA_IRQ_TRAP |