]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/pata_oldpiix.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-omap-h63xx.git] / drivers / ata / pata_oldpiix.c
index 45215aa05e72b92a8b2b7d3c7be6804d5e2cbd0c..29c23ddd65504d8256ba44400cb321bd59c28882 100644 (file)
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_oldpiix"
-#define DRV_VERSION    "0.5.3"
+#define DRV_VERSION    "0.5.5"
 
 /**
  *     oldpiix_pre_reset               -       probe begin
  *     @ap: ATA port
+ *     @deadline: deadline jiffies for the operation
  *
  *     Set up cable type and use generic probe init
  */
 
-static int oldpiix_pre_reset(struct ata_port *ap)
+static int oldpiix_pre_reset(struct ata_port *ap, unsigned long deadline)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        static const struct pci_bits oldpiix_enable_bits[] = {
@@ -44,8 +45,8 @@ static int oldpiix_pre_reset(struct ata_port *ap)
 
        if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no]))
                return -ENOENT;
-       ap->cbl = ATA_CBL_PATA40;
-       return ata_std_prereset(ap);
+
+       return ata_std_prereset(ap, deadline);
 }
 
 /**
@@ -65,7 +66,7 @@ static void oldpiix_pata_error_handler(struct ata_port *ap)
 /**
  *     oldpiix_set_piomode - Initialize host controller PATA PIO timings
  *     @ap: Port whose timings we are configuring
- *     @adev: um
+ *     @adev: Device whose timings we are configuring
  *
  *     Set PIO mode for device, in host controller PCI config space.
  *
@@ -209,10 +210,9 @@ static unsigned int oldpiix_qc_issue_prot(struct ata_queued_cmd *qc)
        struct ata_device *adev = qc->dev;
 
        if (adev != ap->private_data) {
+               oldpiix_set_piomode(ap, adev);
                if (adev->dma_mode)
                        oldpiix_set_dmamode(ap, adev);
-               else if (adev->pio_mode)
-                       oldpiix_set_piomode(ap, adev);
        }
        return ata_qc_issue_prot(qc);
 }
@@ -234,8 +234,6 @@ static struct scsi_host_template oldpiix_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-       .resume                 = ata_scsi_device_resume,
-       .suspend                = ata_scsi_device_suspend,
 };
 
 static const struct ata_port_operations oldpiix_pata_ops = {
@@ -254,6 +252,7 @@ static const struct ata_port_operations oldpiix_pata_ops = {
        .thaw                   = ata_bmdma_thaw,
        .error_handler          = oldpiix_pata_error_handler,
        .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+       .cable_detect           = ata_cable_40wire,
 
        .bmdma_setup            = ata_bmdma_setup,
        .bmdma_start            = ata_bmdma_start,
@@ -290,20 +289,20 @@ static const struct ata_port_operations oldpiix_pata_ops = {
 static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
-       static struct ata_port_info info = {
+       static const struct ata_port_info info = {
                .sht            = &oldpiix_sht,
                .flags          = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
                .pio_mask       = 0x1f, /* pio0-4 */
                .mwdma_mask     = 0x07, /* mwdma1-2 */
                .port_ops       = &oldpiix_pata_ops,
        };
-       static struct ata_port_info *port_info[2] = { &info, &info };
+       const struct ata_port_info *ppi[] = { &info, NULL };
 
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev,
                           "version " DRV_VERSION "\n");
 
-       return ata_pci_init_one(pdev, port_info, 2);
+       return ata_pci_init_one(pdev, ppi);
 }
 
 static const struct pci_device_id oldpiix_pci_tbl[] = {
@@ -317,8 +316,10 @@ static struct pci_driver oldpiix_pci_driver = {
        .id_table               = oldpiix_pci_tbl,
        .probe                  = oldpiix_init_one,
        .remove                 = ata_pci_remove_one,
+#ifdef CONFIG_PM
        .suspend                = ata_pci_device_suspend,
        .resume                 = ata_pci_device_resume,
+#endif
 };
 
 static int __init oldpiix_init(void)