Skip to content

Commit

Permalink
ahci: Factor out PCI specifics from ahci_reset_controller()
Browse files Browse the repository at this point in the history
Move PCI stuff into ahci_pci_reset_controller().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Anton Vorontsov authored and Jeff Garzik committed May 14, 2010
1 parent 1d51335 commit 3303040
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,6 @@ static int ahci_deinit_port(struct ata_port *ap, const char **emsg)

static int ahci_reset_controller(struct ata_host *host)
{
struct pci_dev *pdev = to_pci_dev(host->dev);
struct ahci_host_priv *hpriv = host->private_data;
void __iomem *mmio = hpriv->mmio;
u32 tmp;
Expand Down Expand Up @@ -1403,7 +1402,17 @@ static int ahci_reset_controller(struct ata_host *host)
dev_printk(KERN_INFO, host->dev,
"skipping global host reset\n");

return 0;
}

static int ahci_pci_reset_controller(struct ata_host *host)
{
struct pci_dev *pdev = to_pci_dev(host->dev);

ahci_reset_controller(host);

if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
struct ahci_host_priv *hpriv = host->private_data;
u16 tmp16;

/* configure PCS */
Expand Down Expand Up @@ -2697,7 +2706,7 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
return rc;

if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
rc = ahci_reset_controller(host);
rc = ahci_pci_reset_controller(host);
if (rc)
return rc;

Expand Down Expand Up @@ -3437,7 +3446,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;

rc = ahci_reset_controller(host);
rc = ahci_pci_reset_controller(host);
if (rc)
return rc;

Expand Down

0 comments on commit 3303040

Please sign in to comment.