sata_mv: store the board_idx into the host private data

This information will be used in the resume function.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Saeed Bishara 2009-12-17 01:05:00 -05:00 committed by Jeff Garzik
parent 4716eaf20f
commit 1bfeff03f8
1 changed files with 8 additions and 6 deletions

View File

@ -539,6 +539,7 @@ struct mv_port_signal {
struct mv_host_priv { struct mv_host_priv {
u32 hp_flags; u32 hp_flags;
unsigned int board_idx;
u32 main_irq_mask; u32 main_irq_mask;
struct mv_port_signal signal[8]; struct mv_port_signal signal[8];
const struct mv_hw_ops *ops; const struct mv_hw_ops *ops;
@ -3859,7 +3860,6 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
/** /**
* mv_init_host - Perform some early initialization of the host. * mv_init_host - Perform some early initialization of the host.
* @host: ATA host to initialize * @host: ATA host to initialize
* @board_idx: controller index
* *
* If possible, do an early global reset of the host. Then do * If possible, do an early global reset of the host. Then do
* our port init and clear/unmask all/relevant host interrupts. * our port init and clear/unmask all/relevant host interrupts.
@ -3867,13 +3867,13 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
* LOCKING: * LOCKING:
* Inherited from caller. * Inherited from caller.
*/ */
static int mv_init_host(struct ata_host *host, unsigned int board_idx) static int mv_init_host(struct ata_host *host)
{ {
int rc = 0, n_hc, port, hc; int rc = 0, n_hc, port, hc;
struct mv_host_priv *hpriv = host->private_data; struct mv_host_priv *hpriv = host->private_data;
void __iomem *mmio = hpriv->base; void __iomem *mmio = hpriv->base;
rc = mv_chip_id(host, board_idx); rc = mv_chip_id(host, hpriv->board_idx);
if (rc) if (rc)
goto done; goto done;
@ -4032,6 +4032,7 @@ static int mv_platform_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
host->private_data = hpriv; host->private_data = hpriv;
hpriv->n_ports = n_ports; hpriv->n_ports = n_ports;
hpriv->board_idx = chip_soc;
host->iomap = NULL; host->iomap = NULL;
hpriv->base = devm_ioremap(&pdev->dev, res->start, hpriv->base = devm_ioremap(&pdev->dev, res->start,
@ -4057,7 +4058,7 @@ static int mv_platform_probe(struct platform_device *pdev)
goto err; goto err;
/* initialize adapter */ /* initialize adapter */
rc = mv_init_host(host, chip_soc); rc = mv_init_host(host);
if (rc) if (rc)
goto err; goto err;
@ -4130,7 +4131,7 @@ static int mv_platform_resume(struct platform_device *pdev)
mv_conf_mbus_windows(hpriv, mv_platform_data->dram); mv_conf_mbus_windows(hpriv, mv_platform_data->dram);
/* initialize adapter */ /* initialize adapter */
ret = mv_init_host(host, chip_soc); ret = mv_init_host(host);
if (ret) { if (ret) {
printk(KERN_ERR DRV_NAME ": Error during HW init\n"); printk(KERN_ERR DRV_NAME ": Error during HW init\n");
return ret; return ret;
@ -4274,6 +4275,7 @@ static int mv_pci_init_one(struct pci_dev *pdev,
return -ENOMEM; return -ENOMEM;
host->private_data = hpriv; host->private_data = hpriv;
hpriv->n_ports = n_ports; hpriv->n_ports = n_ports;
hpriv->board_idx = board_idx;
/* acquire resources */ /* acquire resources */
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
@ -4306,7 +4308,7 @@ static int mv_pci_init_one(struct pci_dev *pdev,
} }
/* initialize adapter */ /* initialize adapter */
rc = mv_init_host(host, board_idx); rc = mv_init_host(host);
if (rc) if (rc)
return rc; return rc;