X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/6cfe1b25df744e44a399681abe92b8ca15f08549..adde7768a2eab2950a7628319ec832c63a00ff03:/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c diff --git a/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c b/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c index 011323439..b0caef24f 100644 --- a/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c +++ b/target/linux/adm5120/files/arch/mips/pci/pci-adm5120.c @@ -3,37 +3,32 @@ * * ADM5120 PCI Host Controller driver * - * Copyright (C) ADMtek Incorporated. - * Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org) - * Copyright (C) 2007 Gabor Juhos * Copyright (C) 2007 OpenWrt.org + * Copyright (C) 2007 Gabor Juhos * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This code was based on the ADM5120 specific port of the Linux 2.6.10 kernel + * done by Jeroen Vreeken + * Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org) * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jeroen's code was based on the Linux 2.4.xx source codes found in various + * tarballs released by Edimax for it's ADM5120 based devices + * Copyright (C) ADMtek Incorporated * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. * */ #include #include #include #include +#include #include #include #include -#include #include #include @@ -45,7 +40,7 @@ #undef DEBUG #ifdef DEBUG -#define DBG(f, a...) printk(KERN_DEBUG f, ## a ) +#define DBG(f, a...) printk(KERN_DEBUG f, ## a) #else #define DBG(f, a...) do {} while (0) #endif @@ -54,8 +49,8 @@ /* -------------------------------------------------------------------------*/ -static unsigned int adm5120_pci_nr_irqs __initdata = 0; -static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata = NULL; +static unsigned int adm5120_pci_nr_irqs __initdata; +static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata; static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED; @@ -93,7 +88,7 @@ static int pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, spin_lock_irqsave(&pci_lock, flags); - write_cfgaddr(mkaddr(bus,devfn,where)); + write_cfgaddr(mkaddr(bus, devfn, where)); data = read_cfgdata(); DBG("PCI: cfg_read %02u.%02u.%01u/%02X:%01d, cfg:0x%08X", @@ -132,7 +127,7 @@ static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, spin_lock_irqsave(&pci_lock, flags); - write_cfgaddr(mkaddr(bus,devfn,where)); + write_cfgaddr(mkaddr(bus, devfn, where)); data = read_cfgdata(); DBG("PCI: cfg_write %02u.%02u.%01u/%02X:%01d, cfg:0x%08X", @@ -199,7 +194,7 @@ void __init adm5120_pci_set_irq_map(unsigned int nr_irqs, adm5120_pci_irq_map = map; } -int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) +int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) { int irq = -1; int i; @@ -226,10 +221,10 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) if (irq < 0) { printk(KERN_ALERT "PCI: no irq found for %s pin:%u\n", - pci_name(dev), pin); + pci_name((struct pci_dev *)dev), pin); } else { printk(KERN_INFO "PCI: mapping irq for %s pin:%u, irq:%d\n", - pci_name(dev), pin, irq); + pci_name((struct pci_dev *)dev), pin, irq); } out: