Skip to content

Commit

Permalink
libata: rename SFF functions
Browse files Browse the repository at this point in the history
SFF functions have confusing names.  Some have sff prefix, some have
bmdma, some std, some pci and some none.  Unify the naming by...

* SFF functions which are common to both BMDMA and non-BMDMA are
  prefixed with ata_sff_.

* SFF functions which are specific to BMDMA are prefixed with
  ata_bmdma_.

* SFF functions which are specific to PCI but apply to both BMDMA and
  non-BMDMA are prefixed with ata_pci_sff_.

* SFF functions which are specific to PCI and BMDMA are prefixed with
  ata_pci_bmdma_.

* Drop generic prefixes from LLD specific routines.  For example,
  bfin_std_dev_select -> bfin_dev_select.

The following renames are noteworthy.

  ata_qc_issue_prot() -> ata_sff_qc_issue()
  ata_pci_default_filter() -> ata_bmdma_mode_filter()
  ata_dev_try_classify() -> ata_sff_dev_classify()

This rename is in preparation of separating SFF support out of libata
core layer.  This patch strictly renames functions and doesn't
introduce any behavior difference.

Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
htejun authored and Jeff Garzik committed Apr 17, 2008
1 parent b67a106 commit 9363c38
Show file tree
Hide file tree
Showing 73 changed files with 599 additions and 596 deletions.
10 changes: 5 additions & 5 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,9 @@ static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);

/* wait a while before checking status */
ata_wait_after_reset(ap, deadline);
ata_sff_wait_after_reset(ap, deadline);

rc = ata_wait_ready(ap, deadline);
rc = ata_sff_wait_ready(ap, deadline);
/* link occupied, -ENODEV too is an error */
if (rc) {
reason = "device not ready";
Expand Down Expand Up @@ -1350,7 +1350,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
tf.command = 0x80;
ata_tf_to_fis(&tf, 0, 0, d2h_fis);

rc = sata_std_hardreset(link, class, deadline);
rc = sata_sff_hardreset(link, class, deadline);

ahci_start_engine(ap);

Expand Down Expand Up @@ -1431,7 +1431,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
* have to be reset again. For most cases, this should
* suffice while making probing snappish enough.
*/
rc = ata_wait_ready(ap, jiffies + 2 * HZ);
rc = ata_sff_wait_ready(ap, jiffies + 2 * HZ);
if (rc)
ahci_kick_engine(ap, 0);

Expand All @@ -1444,7 +1444,7 @@ static void ahci_postreset(struct ata_link *link, unsigned int *class)
void __iomem *port_mmio = ahci_port_base(ap);
u32 new_tmp, tmp;

ata_std_postreset(link, class);
ata_sff_postreset(link, class);

/* Make sure port's ATAPI bit is set appropriately */
new_tmp = tmp = readl(port_mmio + PORT_CMD);
Expand Down
4 changes: 2 additions & 2 deletions drivers/ata/ata_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
return -ENODEV;

if (dev->vendor == PCI_VENDOR_ID_AL)
ata_pci_clear_simplex(dev);
ata_pci_bmdma_clear_simplex(dev);

return ata_pci_init_one(dev, ppi, &generic_sht, NULL);
return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL);
}

static struct pci_device_id ata_generic[] = {
Expand Down
6 changes: 3 additions & 3 deletions drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ static int piix_pata_prereset(struct ata_link *link, unsigned long deadline)

if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
return -ENOENT;
return ata_std_prereset(link, deadline);
return ata_sff_prereset(link, deadline);
}

/**
Expand Down Expand Up @@ -1493,7 +1493,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
hpriv->map = piix_init_sata_map(pdev, port_info,
piix_map_db_table[ent->driver_data]);

rc = ata_pci_prepare_sff_host(pdev, ppi, &host);
rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
if (rc)
return rc;
host->private_data = hpriv;
Expand Down Expand Up @@ -1527,7 +1527,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
}

pci_set_master(pdev);
return ata_pci_activate_sff_host(host, ata_interrupt, &piix_sht);
return ata_pci_sff_activate_host(host, ata_sff_interrupt, &piix_sht);
}

static int __init piix_init(void)
Expand Down
16 changes: 8 additions & 8 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 };

const struct ata_port_operations ata_base_port_ops = {
.irq_clear = ata_noop_irq_clear,
.prereset = ata_std_prereset,
.hardreset = sata_std_hardreset,
.postreset = ata_std_postreset,
.prereset = ata_sff_prereset,
.hardreset = sata_sff_hardreset,
.postreset = ata_sff_postreset,
.error_handler = ata_std_error_handler,
};

Expand Down Expand Up @@ -3425,7 +3425,7 @@ int sata_link_resume(struct ata_link *link, const unsigned long *params,
}

/**
* ata_std_prereset - prepare for reset
* ata_sff_prereset - prepare for reset
* @link: ATA link to be reset
* @deadline: deadline jiffies for the operation
*
Expand All @@ -3441,7 +3441,7 @@ int sata_link_resume(struct ata_link *link, const unsigned long *params,
* RETURNS:
* 0 on success, -errno otherwise.
*/
int ata_std_prereset(struct ata_link *link, unsigned long deadline)
int ata_sff_prereset(struct ata_link *link, unsigned long deadline)
{
struct ata_port *ap = link->ap;
struct ata_eh_context *ehc = &link->eh_context;
Expand All @@ -3463,7 +3463,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)

/* wait for !BSY if we don't know that no device is attached */
if (!ata_link_offline(link)) {
rc = ata_wait_ready(ap, deadline);
rc = ata_sff_wait_ready(ap, deadline);
if (rc && rc != -ENODEV) {
ata_link_printk(link, KERN_WARNING, "device not ready "
"(errno=%d), forcing hardreset\n", rc);
Expand Down Expand Up @@ -3535,7 +3535,7 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
}

/**
* ata_std_postreset - standard postreset callback
* ata_sff_postreset - standard postreset callback
* @link: the target ata_link
* @classes: classes of attached devices
*
Expand All @@ -3546,7 +3546,7 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
* LOCKING:
* Kernel thread context (may sleep)
*/
void ata_std_postreset(struct ata_link *link, unsigned int *classes)
void ata_sff_postreset(struct ata_link *link, unsigned int *classes)
{
struct ata_port *ap = link->ap;
u32 serror;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,7 @@ void ata_std_error_handler(struct ata_port *ap)
* ata_base_port_ops. Ignore it if SCR access is not
* available.
*/
if (hardreset == sata_std_hardreset && !sata_scr_valid(&ap->link))
if (hardreset == sata_sff_hardreset && !sata_scr_valid(&ap->link))
hardreset = NULL;

ata_do_eh(ap, ops->prereset, ops->softreset, hardreset, ops->postreset);
Expand Down
Loading

0 comments on commit 9363c38

Please sign in to comment.