]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ppc/pmac.c
ide: make void and rename ide_dma_lostirq() method
[linux-2.6-omap-h63xx.git] / drivers / ide / ppc / pmac.c
index 395d35253d5d0084bb9cd823eb2cb1658abb10b4..ca72ad202ebc4233d4db397e14dde5ba7e169d0c 100644 (file)
@@ -48,7 +48,7 @@
 #include <asm/mediabay.h>
 #endif
 
-#include "ide-timing.h"
+#include "../ide-timing.h"
 
 #undef IDE_PMAC_DEBUG
 
@@ -1157,32 +1157,32 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
 
        pmif->cable_80 = 0;
        pmif->broken_dma = pmif->broken_dma_warn = 0;
-       if (device_is_compatible(np, "shasta-ata"))
+       if (of_device_is_compatible(np, "shasta-ata"))
                pmif->kind = controller_sh_ata6;
-       else if (device_is_compatible(np, "kauai-ata"))
+       else if (of_device_is_compatible(np, "kauai-ata"))
                pmif->kind = controller_un_ata6;
-       else if (device_is_compatible(np, "K2-UATA"))
+       else if (of_device_is_compatible(np, "K2-UATA"))
                pmif->kind = controller_k2_ata6;
-       else if (device_is_compatible(np, "keylargo-ata")) {
+       else if (of_device_is_compatible(np, "keylargo-ata")) {
                if (strcmp(np->name, "ata-4") == 0)
                        pmif->kind = controller_kl_ata4;
                else
                        pmif->kind = controller_kl_ata3;
-       } else if (device_is_compatible(np, "heathrow-ata"))
+       } else if (of_device_is_compatible(np, "heathrow-ata"))
                pmif->kind = controller_heathrow;
        else {
                pmif->kind = controller_ohare;
                pmif->broken_dma = 1;
        }
 
-       bidp = get_property(np, "AAPL,bus-id", NULL);
+       bidp = of_get_property(np, "AAPL,bus-id", NULL);
        pmif->aapl_bus_id =  bidp ? *bidp : 0;
 
        /* Get cable type from device-tree */
        if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6
            || pmif->kind == controller_k2_ata6
            || pmif->kind == controller_sh_ata6) {
-               const char* cable = get_property(np, "cable-type", NULL);
+               const char* cable = of_get_property(np, "cable-type", NULL);
                if (cable && !strncmp(cable, "80-", 3))
                        pmif->cable_80 = 1;
        }
@@ -1190,8 +1190,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
         * they have a 80 conductor cable, this seem to be always the case unless
         * the user mucked around
         */
-       if (device_is_compatible(np, "K2-UATA") ||
-           device_is_compatible(np, "shasta-ata"))
+       if (of_device_is_compatible(np, "K2-UATA") ||
+           of_device_is_compatible(np, "shasta-ata"))
                pmif->cable_80 = 1;
 
        /* On Kauai-type controllers, we make sure the FCR is correct */
@@ -1276,6 +1276,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        /* We probe the hwif now */
        probe_hwif_init(hwif);
 
+       ide_proc_register_port(hwif);
+
        return 0;
 }
 
@@ -1551,19 +1553,34 @@ static struct pci_driver pmac_ide_pci_driver = {
 };
 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match);
 
-void __init
-pmac_ide_probe(void)
+int __init pmac_ide_probe(void)
 {
+       int error;
+
        if (!machine_is(powermac))
-               return;
+               return -ENODEV;
 
 #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST
-       pci_register_driver(&pmac_ide_pci_driver);
-       macio_register_driver(&pmac_ide_macio_driver);
+       error = pci_register_driver(&pmac_ide_pci_driver);
+       if (error)
+               goto out;
+       error = macio_register_driver(&pmac_ide_macio_driver);
+       if (error) {
+               pci_unregister_driver(&pmac_ide_pci_driver);
+               goto out;
+       }
 #else
-       macio_register_driver(&pmac_ide_macio_driver);
-       pci_register_driver(&pmac_ide_pci_driver);
+       error = macio_register_driver(&pmac_ide_macio_driver);
+       if (error)
+               goto out;
+       error = pci_register_driver(&pmac_ide_pci_driver);
+       if (error) {
+               macio_unregister_driver(&pmac_ide_macio_driver);
+               goto out;
+       }
 #endif
+out:
+       return error;
 }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
@@ -1983,24 +2000,23 @@ static void pmac_ide_dma_host_off(ide_drive_t *drive)
 {
 }
 
-static int pmac_ide_dma_host_on(ide_drive_t *drive)
+static void pmac_ide_dma_host_on(ide_drive_t *drive)
 {
 }
 
-static int
-pmac_ide_dma_lostirq (ide_drive_t *drive)
+static void
+pmac_ide_dma_lost_irq (ide_drive_t *drive)
 {
        pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
        volatile struct dbdma_regs __iomem *dma;
        unsigned long status;
 
        if (pmif == NULL)
-               return 0;
+               return;
        dma = pmif->dma_regs;
 
        status = readl(&dma->status);
        printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status);
-       return 0;
 }
 
 /*
@@ -2041,7 +2057,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        hwif->dma_host_off = &pmac_ide_dma_host_off;
        hwif->dma_host_on = &pmac_ide_dma_host_on;
        hwif->ide_dma_timeout = &__ide_dma_timeout;
-       hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
+       hwif->dma_lost_irq = &pmac_ide_dma_lost_irq;
 
        hwif->atapi_dma = 1;
        switch(pmif->kind) {