Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=04351821b43e6c0c91ad50d7e4be54a935f749e1
Commit:     04351821b43e6c0c91ad50d7e4be54a935f749e1
Parent:     fcc2f69a6fad1543b466db9c35aa5a2f364eb3d4
Author:     Alan <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 6 02:37:52 2007 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 14:15:58 2007 -0400

    pata: expose set_mode method so it can be wrapped
    
    This splits set_mode into do_set_mode and the wrapper so that a driver can
    call the standard method inside its own.  This in theory also obsoletes
    ->post_set_mode().
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Cc: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |   37 ++++++++++++++++++++++++++++++-------
 include/linux/libata.h    |    1 +
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 89a77e1..14b469f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2519,12 +2519,13 @@ static int ata_dev_set_mode(struct ata_device *dev)
 }
 
 /**
- *     ata_set_mode - Program timings and issue SET FEATURES - XFER
+ *     ata_do_set_mode - Program timings and issue SET FEATURES - XFER
  *     @ap: port on which timings will be programmed
  *     @r_failed_dev: out paramter for failed device
  *
- *     Set ATA device disk transfer mode (PIO3, UDMA6, etc.).  If
- *     ata_set_mode() fails, pointer to the failing device is
+ *     Standard implementation of the function used to tune and set
+ *     ATA device disk transfer mode (PIO3, UDMA6, etc.).  If
+ *     ata_dev_set_mode() fails, pointer to the failing device is
  *     returned in @r_failed_dev.
  *
  *     LOCKING:
@@ -2533,14 +2534,12 @@ static int ata_dev_set_mode(struct ata_device *dev)
  *     RETURNS:
  *     0 on success, negative errno otherwise
  */
-int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
+
+int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
 {
        struct ata_device *dev;
        int i, rc = 0, used_dma = 0, found = 0;
 
-       /* has private set_mode? */
-       if (ap->ops->set_mode)
-               return ap->ops->set_mode(ap, r_failed_dev);
 
        /* step 1: calculate xfer_mask */
        for (i = 0; i < ATA_MAX_DEVICES; i++) {
@@ -2625,6 +2624,29 @@ int ata_set_mode(struct ata_port *ap, struct ata_device 
**r_failed_dev)
 }
 
 /**
+ *     ata_set_mode - Program timings and issue SET FEATURES - XFER
+ *     @ap: port on which timings will be programmed
+ *     @r_failed_dev: out paramter for failed device
+ *
+ *     Set ATA device disk transfer mode (PIO3, UDMA6, etc.).  If
+ *     ata_set_mode() fails, pointer to the failing device is
+ *     returned in @r_failed_dev.
+ *
+ *     LOCKING:
+ *     PCI/etc. bus probe sem.
+ *
+ *     RETURNS:
+ *     0 on success, negative errno otherwise
+ */
+int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
+{
+       /* has private set_mode? */
+       if (ap->ops->set_mode)
+               return ap->ops->set_mode(ap, r_failed_dev);
+       return ata_do_set_mode(ap, r_failed_dev);
+}
+
+/**
  *     ata_tf_to_host - issue ATA taskfile to host controller
  *     @ap: port to which command is being issued
  *     @tf: ATA taskfile register set
@@ -6413,6 +6435,7 @@ EXPORT_SYMBOL_GPL(ata_altstatus);
 EXPORT_SYMBOL_GPL(ata_exec_command);
 EXPORT_SYMBOL_GPL(ata_port_start);
 EXPORT_SYMBOL_GPL(ata_interrupt);
+EXPORT_SYMBOL_GPL(ata_do_set_mode);
 EXPORT_SYMBOL_GPL(ata_data_xfer);
 EXPORT_SYMBOL_GPL(ata_data_xfer_noirq);
 EXPORT_SYMBOL_GPL(ata_qc_prep);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3451ef9..c145d9d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -831,6 +831,7 @@ extern void ata_scsi_slave_destroy(struct scsi_device 
*sdev);
 extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
                                       int queue_depth);
 extern struct ata_device *ata_dev_pair(struct ata_device *adev);
+extern int ata_do_set_mode(struct ata_port *ap, struct ata_device 
**r_failed_dev);
 extern u8 ata_irq_on(struct ata_port *ap);
 extern u8 ata_dummy_irq_on(struct ata_port *ap);
 extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to