Commit 8d8e7d13 authored by Dan Williams's avatar Dan Williams Committed by James Bottomley

[SCSI] libsas, ipr: cleanup ata_host flags initialization via ata_host_init

libsas and ipr pass flags to ata_host_init that are meant for the port.

ata_host flags:
	ATA_HOST_SIMPLEX	= (1 << 0),	/* Host is simplex, one DMA channel per host only */
	ATA_HOST_STARTED	= (1 << 1),	/* Host started */
	ATA_HOST_PARALLEL_SCAN	= (1 << 2),	/* Ports on this host can be scanned in parallel */
	ATA_HOST_IGNORE_ATA	= (1 << 3),	/* Ignore ATA devices on this host. */

flags passed by libsas:
	ATA_FLAG_SATA		= (1 << 1),
	ATA_FLAG_PIO_DMA	= (1 << 7), /* PIO cmds via DMA */
	ATA_FLAG_NCQ		= (1 << 10), /* host supports NCQ */

The only one that aliases is ATA_HOST_STARTED which is a 'don't care' in
the libsas and ipr cases since ata_hosts from these sources are not
registered with libata.
Reported-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Acked-by: default avatarBrian King <brking@us.ibm.com>
Acked-by: default avatarJeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent e468dc11
...@@ -5960,24 +5960,18 @@ int ata_host_start(struct ata_host *host) ...@@ -5960,24 +5960,18 @@ int ata_host_start(struct ata_host *host)
} }
/** /**
* ata_sas_host_init - Initialize a host struct * ata_sas_host_init - Initialize a host struct for sas (ipr, libsas)
* @host: host to initialize * @host: host to initialize
* @dev: device host is attached to * @dev: device host is attached to
* @flags: host flags
* @ops: port_ops * @ops: port_ops
* *
* LOCKING:
* PCI/etc. bus probe sem.
*
*/ */
/* KILLME - the only user left is ipr */
void ata_host_init(struct ata_host *host, struct device *dev, void ata_host_init(struct ata_host *host, struct device *dev,
unsigned long flags, struct ata_port_operations *ops) struct ata_port_operations *ops)
{ {
spin_lock_init(&host->lock); spin_lock_init(&host->lock);
mutex_init(&host->eh_mutex); mutex_init(&host->eh_mutex);
host->dev = dev; host->dev = dev;
host->flags = flags;
host->ops = ops; host->ops = ops;
} }
......
...@@ -8775,8 +8775,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ...@@ -8775,8 +8775,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
ioa_cfg = (struct ipr_ioa_cfg *)host->hostdata; ioa_cfg = (struct ipr_ioa_cfg *)host->hostdata;
memset(ioa_cfg, 0, sizeof(struct ipr_ioa_cfg)); memset(ioa_cfg, 0, sizeof(struct ipr_ioa_cfg));
ata_host_init(&ioa_cfg->ata_host, &pdev->dev, ata_host_init(&ioa_cfg->ata_host, &pdev->dev, &ipr_sata_ops);
sata_port_info.flags, &ipr_sata_ops);
ioa_cfg->ipr_chip = ipr_get_chip_info(dev_id); ioa_cfg->ipr_chip = ipr_get_chip_info(dev_id);
......
...@@ -580,10 +580,7 @@ int sas_ata_init(struct domain_device *found_dev) ...@@ -580,10 +580,7 @@ int sas_ata_init(struct domain_device *found_dev)
struct ata_port *ap; struct ata_port *ap;
int rc; int rc;
ata_host_init(&found_dev->sata_dev.ata_host, ata_host_init(&found_dev->sata_dev.ata_host, ha->dev, &sas_sata_ops);
ha->dev,
sata_port_info.flags,
&sas_sata_ops);
ap = ata_sas_port_alloc(&found_dev->sata_dev.ata_host, ap = ata_sas_port_alloc(&found_dev->sata_dev.ata_host,
&sata_port_info, &sata_port_info,
shost); shost);
......
...@@ -987,8 +987,7 @@ extern int ata_host_activate(struct ata_host *host, int irq, ...@@ -987,8 +987,7 @@ extern int ata_host_activate(struct ata_host *host, int irq,
irq_handler_t irq_handler, unsigned long irq_flags, irq_handler_t irq_handler, unsigned long irq_flags,
struct scsi_host_template *sht); struct scsi_host_template *sht);
extern void ata_host_detach(struct ata_host *host); extern void ata_host_detach(struct ata_host *host);
extern void ata_host_init(struct ata_host *, struct device *, extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *);
unsigned long, struct ata_port_operations *);
extern int ata_scsi_detect(struct scsi_host_template *sht); extern int ata_scsi_detect(struct scsi_host_template *sht);
extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment