V4L/DVB (3658): Kconfig: Fix PCI ID typo in VIDEO_CX88_ALSA help text
[powerpc.git] / drivers / parisc / dino.c
index 45a1a49..6e8ed0c 100644 (file)
@@ -5,6 +5,7 @@
 **     (c) Copyright 1999 SuSE GmbH
 **     (c) Copyright 1999,2000 Hewlett-Packard Company
 **     (c) Copyright 2000 Grant Grundler
+**     (c) Copyright 2006 Helge Deller
 **
 **     This program is free software; you can redistribute it and/or modify
 **     it under the terms of the GNU General Public License as published by
@@ -83,7 +84,8 @@
 ** bus number for each dino.
 */
 
-#define is_card_dino(id) ((id)->hw_type == HPHW_A_DMA)
+#define is_card_dino(id)       ((id)->hw_type == HPHW_A_DMA)
+#define is_cujo(id)            ((id)->hversion == 0x682)
 
 #define DINO_IAR0              0x004
 #define DINO_IODC_ADDR         0x008
@@ -682,7 +684,6 @@ dino_fixup_bus(struct pci_bus *bus)
                        printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev));
 #endif
                } else {
-
                        /* Adjust INT_LINE for that busses region */
                        dino_assign_irq(dino_dev, dev->irq, &dev->irq);
                }
@@ -785,7 +786,7 @@ dino_bridge_init(struct dino_device *dino_dev, const char *name)
                if((io_addr & (1 << i)) == 0)
                        continue;
 
-               start = (unsigned long)(signed int)(0xf0000000 | (i << 23));
+               start = F_EXTEND(0xf0000000UL) | (i << 23);
                end = start + 8 * 1024 * 1024 - 1;
 
                DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count,
@@ -888,7 +889,7 @@ static int __init dino_common_init(struct parisc_device *dev,
 
        /* allocate I/O Port resource region */
        res = &dino_dev->hba.io_space;
-       if (dev->id.hversion == 0x680 || is_card_dino(&dev->id)) {
+       if (!is_cujo(&dev->id)) {
                res->name = "Dino I/O Port";
        } else {
                res->name = "Cujo I/O Port";
@@ -943,7 +944,7 @@ static int __init dino_probe(struct parisc_device *dev)
        if (is_card_dino(&dev->id)) {
                version = "3.x (card mode)";
        } else {
-               if(dev->id.hversion == 0x680) {
+               if (!is_cujo(&dev->id)) {
                        if (dev->id.hversion_rev < 4) {
                                version = dino_vers[dev->id.hversion_rev];
                        }
@@ -989,16 +990,14 @@ static int __init dino_probe(struct parisc_device *dev)
 */
        }
 
-       dino_dev = kmalloc(sizeof(struct dino_device), GFP_KERNEL);
+       dino_dev = kzalloc(sizeof(struct dino_device), GFP_KERNEL);
        if (!dino_dev) {
                printk("dino_init_chip - couldn't alloc dino_device\n");
                return 1;
        }
 
-       memset(dino_dev, 0, sizeof(struct dino_device));
-
        dino_dev->hba.dev = dev;
-       dino_dev->hba.base_addr = ioremap(hpa, 4096);
+       dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096);
        dino_dev->hba.lmmio_space_offset = 0;   /* CPU addrs == bus addrs */
        spin_lock_init(&dino_dev->dinosaur_pen);
        dino_dev->hba.iommu = ccio_get_iommu(dev);