Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=307c6054ad67428ad4e2bd4e5faae54fc4f8bcd2
Commit:     307c6054ad67428ad4e2bd4e5faae54fc4f8bcd2
Parent:     5816fbbf22470b687964462e6c1f18165b291f22
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 16:48:09 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 14:15:56 2007 -0400

    pata_marvell: Cable and reset fixes
    
    There are two changes here. Firstly we switch to a cable detect method,
    secondly the old code forgot to call ata_std_prereset() but somehow
    managed to work anyway. Fix the missing call.
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_marvell.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 6dd7c4e..d9b94a1 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -20,7 +20,7 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_marvell"
-#define DRV_VERSION    "0.1.1"
+#define DRV_VERSION    "0.1.4"
 
 /**
  *     marvell_pre_reset       -       check for 40/80 pin
@@ -52,22 +52,23 @@ static int marvell_pre_reset(struct ata_port *ap)
        if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
            (!(devices & 0x10)))        /* PATA enable ? */
                return -ENOENT;
+       return ata_std_prereset(ap);
+}
 
+static int marvell_cable_detect(struct ata_port *ap)
+{
        /* Cable type */
        switch(ap->port_no)
        {
        case 0:
                if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
-                       ap->cbl = ATA_CBL_PATA40;
-               else
-                       ap->cbl = ATA_CBL_PATA80;
-               break;
-
+                       return ATA_CBL_PATA40;
+               return ATA_CBL_PATA80;
        case 1: /* Legacy SATA port */
-               ap->cbl = ATA_CBL_SATA;
-               break;
+               return ATA_CBL_SATA;
        }
-       return ata_std_prereset(ap);
+       BUG();
+       return 0;       /* Our BUG macro needs the right markup */
 }
 
 /**
@@ -123,6 +124,7 @@ static const struct ata_port_operations marvell_ops = {
        .thaw                   = ata_bmdma_thaw,
        .error_handler          = marvell_error_handler,
        .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+       .cable_detect           = marvell_cable_detect,
 
        /* BMDMA handling is PCI ATA format, use helpers */
        .bmdma_setup            = ata_bmdma_setup,
-
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