diff options
| author | Saeed Bishara <saeed@marvell.com> | 2009-12-06 11:26:20 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@redhat.com> | 2009-12-17 01:01:47 -0500 |
| commit | c4bc7d7310a40c8c0b917e88983dc4a8e6b59e38 (patch) | |
| tree | 990b3761be3fd95a7be0df6109a75c4050b08e42 | |
| parent | 6481f2b52cd5411ea6342b749daf0e4f3b390d7b (diff) | |
sata_mv: move the PCI bar description initialization code
The mv_init_host will be used to initialize the host hw on resume.
The PCI bar description need to be initialized only once when the
device probed.
Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| -rwxr-xr-x | drivers/ata/sata_mv.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 0f7704c0b4cc..e1b9568538f3 100755 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
| @@ -3910,14 +3910,6 @@ static int mv_init_host(struct ata_host *host, unsigned int board_idx) | |||
| 3910 | void __iomem *port_mmio = mv_port_base(mmio, port); | 3910 | void __iomem *port_mmio = mv_port_base(mmio, port); |
| 3911 | 3911 | ||
| 3912 | mv_port_init(&ap->ioaddr, port_mmio); | 3912 | mv_port_init(&ap->ioaddr, port_mmio); |
| 3913 | |||
| 3914 | #ifdef CONFIG_PCI | ||
| 3915 | if (!IS_SOC(hpriv)) { | ||
| 3916 | unsigned int offset = port_mmio - mmio; | ||
| 3917 | ata_port_pbar_desc(ap, MV_PRIMARY_BAR, -1, "mmio"); | ||
| 3918 | ata_port_pbar_desc(ap, MV_PRIMARY_BAR, offset, "port"); | ||
| 3919 | } | ||
| 3920 | #endif | ||
| 3921 | } | 3913 | } |
| 3922 | 3914 | ||
| 3923 | for (hc = 0; hc < n_hc; hc++) { | 3915 | for (hc = 0; hc < n_hc; hc++) { |
| @@ -4268,7 +4260,7 @@ static int mv_pci_init_one(struct pci_dev *pdev, | |||
| 4268 | const struct ata_port_info *ppi[] = { &mv_port_info[board_idx], NULL }; | 4260 | const struct ata_port_info *ppi[] = { &mv_port_info[board_idx], NULL }; |
| 4269 | struct ata_host *host; | 4261 | struct ata_host *host; |
| 4270 | struct mv_host_priv *hpriv; | 4262 | struct mv_host_priv *hpriv; |
| 4271 | int n_ports, rc; | 4263 | int n_ports, port, rc; |
| 4272 | 4264 | ||
| 4273 | if (!printed_version++) | 4265 | if (!printed_version++) |
| 4274 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); | 4266 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); |
| @@ -4304,6 +4296,15 @@ static int mv_pci_init_one(struct pci_dev *pdev, | |||
| 4304 | if (rc) | 4296 | if (rc) |
| 4305 | return rc; | 4297 | return rc; |
| 4306 | 4298 | ||
| 4299 | for (port = 0; port < host->n_ports; port++) { | ||
| 4300 | struct ata_port *ap = host->ports[port]; | ||
| 4301 | void __iomem *port_mmio = mv_port_base(hpriv->base, port); | ||
| 4302 | unsigned int offset = port_mmio - hpriv->base; | ||
| 4303 | |||
| 4304 | ata_port_pbar_desc(ap, MV_PRIMARY_BAR, -1, "mmio"); | ||
| 4305 | ata_port_pbar_desc(ap, MV_PRIMARY_BAR, offset, "port"); | ||
| 4306 | } | ||
| 4307 | |||
| 4307 | /* initialize adapter */ | 4308 | /* initialize adapter */ |
| 4308 | rc = mv_init_host(host, board_idx); | 4309 | rc = mv_init_host(host, board_idx); |
| 4309 | if (rc) | 4310 | if (rc) |
