diff options
author | Saeed Bishara <saeed@marvell.com> | 2009-12-17 01:05:00 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-12-17 01:05:00 -0500 |
commit | 1bfeff03f8a52eb896e5aad33d52e2451437bb0b (patch) | |
tree | cb758f22b9638a0e77dda18f3f7cba8bbbe67dd2 /drivers/ata/sata_mv.c | |
parent | 4716eaf20f37d10fd01b0fcacb3e41c1abd362c3 (diff) |
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>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rwxr-xr-x | drivers/ata/sata_mv.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index e1b9568538f3..53a1d97cd9a6 100755 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -539,6 +539,7 @@ struct mv_port_signal { | |||
539 | 539 | ||
540 | struct mv_host_priv { | 540 | struct mv_host_priv { |
541 | u32 hp_flags; | 541 | u32 hp_flags; |
542 | unsigned int board_idx; | ||
542 | u32 main_irq_mask; | 543 | u32 main_irq_mask; |
543 | struct mv_port_signal signal[8]; | 544 | struct mv_port_signal signal[8]; |
544 | const struct mv_hw_ops *ops; | 545 | const struct mv_hw_ops *ops; |
@@ -3859,7 +3860,6 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
3859 | /** | 3860 | /** |
3860 | * mv_init_host - Perform some early initialization of the host. | 3861 | * mv_init_host - Perform some early initialization of the host. |
3861 | * @host: ATA host to initialize | 3862 | * @host: ATA host to initialize |
3862 | * @board_idx: controller index | ||
3863 | * | 3863 | * |
3864 | * If possible, do an early global reset of the host. Then do | 3864 | * If possible, do an early global reset of the host. Then do |
3865 | * our port init and clear/unmask all/relevant host interrupts. | 3865 | * 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) | |||
3867 | * LOCKING: | 3867 | * LOCKING: |
3868 | * Inherited from caller. | 3868 | * Inherited from caller. |
3869 | */ | 3869 | */ |
3870 | static int mv_init_host(struct ata_host *host, unsigned int board_idx) | 3870 | static int mv_init_host(struct ata_host *host) |
3871 | { | 3871 | { |
3872 | int rc = 0, n_hc, port, hc; | 3872 | int rc = 0, n_hc, port, hc; |
3873 | struct mv_host_priv *hpriv = host->private_data; | 3873 | struct mv_host_priv *hpriv = host->private_data; |
3874 | void __iomem *mmio = hpriv->base; | 3874 | void __iomem *mmio = hpriv->base; |
3875 | 3875 | ||
3876 | rc = mv_chip_id(host, board_idx); | 3876 | rc = mv_chip_id(host, hpriv->board_idx); |
3877 | if (rc) | 3877 | if (rc) |
3878 | goto done; | 3878 | goto done; |
3879 | 3879 | ||
@@ -4032,6 +4032,7 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
4032 | return -ENOMEM; | 4032 | return -ENOMEM; |
4033 | host->private_data = hpriv; | 4033 | host->private_data = hpriv; |
4034 | hpriv->n_ports = n_ports; | 4034 | hpriv->n_ports = n_ports; |
4035 | hpriv->board_idx = chip_soc; | ||
4035 | 4036 | ||
4036 | host->iomap = NULL; | 4037 | host->iomap = NULL; |
4037 | hpriv->base = devm_ioremap(&pdev->dev, res->start, | 4038 | hpriv->base = devm_ioremap(&pdev->dev, res->start, |
@@ -4057,7 +4058,7 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
4057 | goto err; | 4058 | goto err; |
4058 | 4059 | ||
4059 | /* initialize adapter */ | 4060 | /* initialize adapter */ |
4060 | rc = mv_init_host(host, chip_soc); | 4061 | rc = mv_init_host(host); |
4061 | if (rc) | 4062 | if (rc) |
4062 | goto err; | 4063 | goto err; |
4063 | 4064 | ||
@@ -4130,7 +4131,7 @@ static int mv_platform_resume(struct platform_device *pdev) | |||
4130 | mv_conf_mbus_windows(hpriv, mv_platform_data->dram); | 4131 | mv_conf_mbus_windows(hpriv, mv_platform_data->dram); |
4131 | 4132 | ||
4132 | /* initialize adapter */ | 4133 | /* initialize adapter */ |
4133 | ret = mv_init_host(host, chip_soc); | 4134 | ret = mv_init_host(host); |
4134 | if (ret) { | 4135 | if (ret) { |
4135 | printk(KERN_ERR DRV_NAME ": Error during HW init\n"); | 4136 | printk(KERN_ERR DRV_NAME ": Error during HW init\n"); |
4136 | return ret; | 4137 | return ret; |
@@ -4274,6 +4275,7 @@ static int mv_pci_init_one(struct pci_dev *pdev, | |||
4274 | return -ENOMEM; | 4275 | return -ENOMEM; |
4275 | host->private_data = hpriv; | 4276 | host->private_data = hpriv; |
4276 | hpriv->n_ports = n_ports; | 4277 | hpriv->n_ports = n_ports; |
4278 | hpriv->board_idx = board_idx; | ||
4277 | 4279 | ||
4278 | /* acquire resources */ | 4280 | /* acquire resources */ |
4279 | rc = pcim_enable_device(pdev); | 4281 | rc = pcim_enable_device(pdev); |
@@ -4306,7 +4308,7 @@ static int mv_pci_init_one(struct pci_dev *pdev, | |||
4306 | } | 4308 | } |
4307 | 4309 | ||
4308 | /* initialize adapter */ | 4310 | /* initialize adapter */ |
4309 | rc = mv_init_host(host, board_idx); | 4311 | rc = mv_init_host(host); |
4310 | if (rc) | 4312 | if (rc) |
4311 | return rc; | 4313 | return rc; |
4312 | 4314 | ||