diff options
Diffstat (limited to 'drivers')
1128 files changed, 3771 insertions, 4873 deletions
diff --git a/drivers/acorn/block/Kconfig b/drivers/acorn/block/Kconfig index 073add3..a0ff25e 100644 --- a/drivers/acorn/block/Kconfig +++ b/drivers/acorn/block/Kconfig @@ -3,7 +3,7 @@ # menu "Acorn-specific block devices" - depends on ARCH_ACORN + depends on ARCH_ARC || ARCH_A5K config BLK_DEV_FD1772 tristate "Old Archimedes floppy (1772) support" diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c index ce074f6..d9c9a35 100644 --- a/drivers/acorn/block/mfmhd.c +++ b/drivers/acorn/block/mfmhd.c @@ -99,7 +99,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/sched.h> #include <linux/fs.h> #include <linux/interrupt.h> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 2c626e8..84a6896 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -248,7 +248,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) num_enabled++; } if (!num_enabled) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); + printk(KERN_ERR PREFIX "add_memory failed\n"); mem_device->state = MEMORY_INVALID_STATE; return -EINVAL; } diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 13d6d5bd..4d62298 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -23,7 +23,6 @@ * */ #include <linux/module.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c68b1bb..d4bd314 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -25,7 +25,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index fb96e3b..feda034 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -24,7 +24,6 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index a05b3df..5fcb50c 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1433,7 +1433,7 @@ static int acpi_device_resume(struct device * dev) } -struct bus_type acpi_bus_type = { +static struct bus_type acpi_bus_type = { .name = "acpi", .suspend = acpi_device_suspend, .resume = acpi_device_resume, diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ed5e881..bfb3bfc 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c index d1387cf..6cc93de 100644 --- a/drivers/atm/adummy.c +++ b/drivers/atm/adummy.c @@ -2,7 +2,6 @@ * adummy.c: a dummy ATM driver */ -#include <linux/config.h> #include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h> diff --git a/drivers/atm/ambassador.h b/drivers/atm/ambassador.h index 84a9306..8296420 100644 --- a/drivers/atm/ambassador.h +++ b/drivers/atm/ambassador.h @@ -23,7 +23,6 @@ #ifndef AMBASSADOR_H #define AMBASSADOR_H -#include <linux/config.h> #ifdef CONFIG_ATM_AMBASSADOR_DEBUG #define DEBUG_AMBASSADOR diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index c13c4d7..976ced1 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -4,7 +4,6 @@ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/pci.h> diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 92923bf..9be9a40 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -25,7 +25,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/init.h> diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h index 2558eb8..f9abfda 100644 --- a/drivers/atm/fore200e.h +++ b/drivers/atm/fore200e.h @@ -3,7 +3,6 @@ #define _FORE200E_H #ifdef __KERNEL__ -#include <linux/config.h> /* rx buffer sizes */ diff --git a/drivers/atm/he.c b/drivers/atm/he.c index fde9334..a5cbd3d 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c @@ -55,7 +55,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> @@ -1018,7 +1017,7 @@ he_init_irq(struct he_dev *he_dev) return 0; } -static int __init +static int __devinit he_start(struct atm_dev *dev) { struct he_dev *he_dev; diff --git a/drivers/atm/horizon.h b/drivers/atm/horizon.h index e2cc702..4461229 100644 --- a/drivers/atm/horizon.h +++ b/drivers/atm/horizon.h @@ -30,7 +30,6 @@ #ifndef DRIVER_ATM_HORIZON_H #define DRIVER_ATM_HORIZON_H -#include <linux/config.h> #ifdef CONFIG_ATM_HORIZON_DEBUG #define DEBUG_HORIZON diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index 0aabfc2..325325a 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -358,7 +358,7 @@ static const struct atmphy_ops idt77105_ops = { }; -int idt77105_init(struct atm_dev *dev) +int __devinit idt77105_init(struct atm_dev *dev) { dev->phy = &idt77105_ops; return 0; diff --git a/drivers/atm/idt77105.h b/drivers/atm/idt77105.h index 8ba8218..3fd2bc8 100644 --- a/drivers/atm/idt77105.h +++ b/drivers/atm/idt77105.h @@ -76,7 +76,7 @@ #define IDT77105_CTRSEL_RHEC 0x01 /* W, Rx HEC Error Counter */ #ifdef __KERNEL__ -int idt77105_init(struct atm_dev *dev) __init; +int idt77105_init(struct atm_dev *dev); #endif /* diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index b4a76ca..8fdb301 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -34,7 +34,6 @@ static char const rcsid[] = #include <linux/module.h> -#include <linux/config.h> #include <linux/pci.h> #include <linux/skbuff.h> #include <linux/kernel.h> diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 2e2e50e..333a7bc 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -2284,7 +2284,7 @@ static int reset_sar(struct atm_dev *dev) } -static int __init ia_init(struct atm_dev *dev) +static int __devinit ia_init(struct atm_dev *dev) { IADEV *iadev; unsigned long real_base; @@ -2480,7 +2480,7 @@ static void ia_free_rx(IADEV *iadev) iadev->rx_dle_dma); } -static int __init ia_start(struct atm_dev *dev) +static int __devinit ia_start(struct atm_dev *dev) { IADEV *iadev; int error; diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h index b8d0bd4..133eefc 100644 --- a/drivers/atm/iphase.h +++ b/drivers/atm/iphase.h @@ -43,7 +43,6 @@ #ifndef IPHASE_H #define IPHASE_H -#include <linux/config.h> /************************ IADBG DEFINE *********************************/ /* IADebugFlag Bit Map */ diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 074abc8..b78612d 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -36,7 +36,6 @@ /* Header files ***************************************************************/ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/atmdev.h> diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c index b1d063c..f04f39c 100644 --- a/drivers/atm/suni.c +++ b/drivers/atm/suni.c @@ -289,7 +289,7 @@ static const struct atmphy_ops suni_ops = { }; -int suni_init(struct atm_dev *dev) +int __devinit suni_init(struct atm_dev *dev) { unsigned char mri; diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index f484747..1699c93 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -3,7 +3,6 @@ /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/kernel.h> diff --git a/drivers/atm/zatm.h b/drivers/atm/zatm.h index 416fe0f..ae9165c 100644 --- a/drivers/atm/zatm.h +++ b/drivers/atm/zatm.h @@ -6,7 +6,6 @@ #ifndef DRIVER_ATM_ZATM_H #define DRIVER_ATM_ZATM_H -#include <linux/config.h> #include <linux/skbuff.h> #include <linux/atm.h> #include <linux/atmdev.h> diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 050d86d..83fa8b2 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/base/class.c b/drivers/base/class.c index 9aa1274..de89083 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -10,7 +10,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/base/core.c b/drivers/base/core.c index 27c2176..b21f864 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/err.h> #include <linux/init.h> diff --git a/drivers/base/driver.c b/drivers/base/driver.c index b400314..562600d 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/base/node.c b/drivers/base/node.c index eae2bdc..d7de1753 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -40,24 +40,13 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) int n; int nid = dev->id; struct sysinfo i; - struct page_state ps; unsigned long inactive; unsigned long active; unsigned long free; si_meminfo_node(&i, nid); - get_page_state_node(&ps, nid); __get_zone_counts(&active, &inactive, &free, NODE_DATA(nid)); - /* Check for negative values in these approximate counters */ - if ((long)ps.nr_dirty < 0) - ps.nr_dirty = 0; - if ((long)ps.nr_writeback < 0) - ps.nr_writeback = 0; - if ((long)ps.nr_mapped < 0) - ps.nr_mapped = 0; - if ((long)ps.nr_slab < 0) - ps.nr_slab = 0; n = sprintf(buf, "\n" "Node %d MemTotal: %8lu kB\n" @@ -71,7 +60,12 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) "Node %d LowFree: %8lu kB\n" "Node %d Dirty: %8lu kB\n" "Node %d Writeback: %8lu kB\n" + "Node %d FilePages: %8lu kB\n" "Node %d Mapped: %8lu kB\n" + "Node %d AnonPages: %8lu kB\n" + "Node %d PageTables: %8lu kB\n" + "Node %d NFS Unstable: %8lu kB\n" + "Node %d Bounce: %8lu kB\n" "Node %d Slab: %8lu kB\n", nid, K(i.totalram), nid, K(i.freeram), @@ -82,10 +76,15 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) nid, K(i.freehigh), nid, K(i.totalram - i.totalhigh), nid, K(i.freeram - i.freehigh), - nid, K(ps.nr_dirty), - nid, K(ps.nr_writeback), - nid, K(ps.nr_mapped), - nid, K(ps.nr_slab)); + nid, K(node_page_state(nid, NR_FILE_DIRTY)), + nid, K(node_page_state(nid, NR_WRITEBACK)), + nid, K(node_page_state(nid, NR_FILE_PAGES)), + nid, K(node_page_state(nid, NR_FILE_MAPPED)), + nid, K(node_page_state(nid, NR_ANON_PAGES)), + nid, K(node_page_state(nid, NR_PAGETABLE)), + nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), + nid, K(node_page_state(nid, NR_BOUNCE)), + nid, K(node_page_state(nid, NR_SLAB))); n += hugetlb_report_node_meminfo(nid, buf + n); return n; } @@ -95,28 +94,6 @@ static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); static ssize_t node_read_numastat(struct sys_device * dev, char * buf) { - unsigned long numa_hit, numa_miss, interleave_hit, numa_foreign; - unsigned long local_node, other_node; - int i, cpu; - pg_data_t *pg = NODE_DATA(dev->id); - numa_hit = 0; - numa_miss = 0; - interleave_hit = 0; - numa_foreign = 0; - local_node = 0; - other_node = 0; - for (i = 0; i < MAX_NR_ZONES; i++) { - struct zone *z = &pg->node_zones[i]; - for_each_online_cpu(cpu) { - struct per_cpu_pageset *ps = zone_pcp(z,cpu); - numa_hit += ps->numa_hit; - numa_miss += ps->numa_miss; - numa_foreign += ps->numa_foreign; - interleave_hit += ps->interleave_hit; - local_node += ps->local_node; - other_node += ps->other_node; - } - } return sprintf(buf, "numa_hit %lu\n" "numa_miss %lu\n" @@ -124,12 +101,12 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf) "interleave_hit %lu\n" "local_node %lu\n" "other_node %lu\n", - numa_hit, - numa_miss, - numa_foreign, - interleave_hit, - local_node, - other_node); + node_page_state(dev->id, NUMA_HIT), + node_page_state(dev->id, NUMA_MISS), + node_page_state(dev->id, NUMA_FOREIGN), + node_page_state(dev->id, NUMA_INTERLEAVE_HIT), + node_page_state(dev->id, NUMA_LOCAL), + node_page_state(dev->id, NUMA_OTHER)); } static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 0d2e101..fdfa3d0 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -19,7 +19,6 @@ * ancestral dependencies that the subsystem list maintains. */ -#include <linux/config.h> #include <linux/device.h> #include "power.h" diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c index 8826a5b..3483ae4 100644 --- a/drivers/base/power/shutdown.c +++ b/drivers/base/power/shutdown.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <asm/semaphore.h> diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 6858178..04e5db4 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -12,7 +12,6 @@ * add themselves as children of the system bus. */ -#include <linux/config.h> #include <linux/sysdev.h> #include <linux/err.h> #include <linux/module.h> diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c index a317e43..0b80fbb 100644 --- a/drivers/block/acsi.c +++ b/drivers/block/acsi.c @@ -43,7 +43,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 013c5da..7b3b94d 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -50,7 +50,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/sched.h> diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index ce94aa1..4b258f7 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -21,7 +21,6 @@ #define PI_VERSION "1.06" #include <linux/module.h> -#include <linux/config.h> #include <linux/kmod.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 3e4cce5..bde2c64 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -44,7 +44,6 @@ *************************************************************************/ #include <linux/pktcdvd.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c index a729013..aef5a0c 100644 --- a/drivers/block/ps2esdi.c +++ b/drivers/block/ps2esdi.c @@ -29,7 +29,6 @@ #define DEVICE_NAME "PS/2 ESDI" -#include <linux/config.h> #include <linux/major.h> #include <linux/errno.h> #include <linux/wait.h> diff --git a/drivers/block/rd.c b/drivers/block/rd.c index a9e1c25..3cf246a 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -42,7 +42,6 @@ * and set blk_size for -ENOSPC, Werner Fink <werner@suse.de>, Apr '99 */ -#include <linux/config.h> #include <linux/string.h> #include <linux/slab.h> #include <asm/atomic.h> diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 6288779..3721e12 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -16,7 +16,6 @@ * handle GCR disks */ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 585197b..f675f97 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -35,7 +35,6 @@ */ //#define DEBUG /* uncomment if you want debugging info (pr_debug) */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/fs.h> #include <linux/bio.h> diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 3e7a067..6f67141 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 8947c88..23f9621 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 473a13b..2830f58 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c @@ -20,7 +20,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 9446960..e0231dc 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index b94ac2f..c9dba55 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 9ce4c93..c889bf8 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c @@ -20,7 +20,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index ed8dca8..be6eed1 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c @@ -20,7 +20,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 7bd4ef9..d0cface 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index 4804d47..ad62abb 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 613673b..1994270 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 92382e8..a7d9d7e 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c @@ -31,7 +31,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 8573822..ea58900 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -23,7 +23,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 3170eaa..ca27ee8 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -263,7 +263,6 @@ /* #define ERRLOGMASK (CD_WARNING|CD_OPEN|CD_COUNT_TRACKS|CD_CLOSE) */ /* #define ERRLOGMASK (CD_WARNING|CD_REG_UNREG|CD_DO_IOCTL|CD_OPEN|CD_CLOSE|CD_COUNT_TRACKS) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/buffer_head.h> diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index 4ee2886..9b05ddd 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -914,7 +914,7 @@ static void seek(int lba) cd->dsb = wait_dsb(); } -uch bcdbin(unsigned char bcd) +static uch bcdbin(unsigned char bcd) { /* stolen from mcd.c! */ return (bcd >> 4) * 10 + (bcd & 0xf); } @@ -1532,7 +1532,7 @@ static void __init parse_options(void) } } -static int __cm206_init(void) +static int __init __cm206_init(void) { parse_options(); #if !defined(AUTO_PROBE_MODULE) @@ -1593,8 +1593,3 @@ __setup("cm206=", cm206_setup); #endif /* !MODULE */ MODULE_ALIAS_BLOCKDEV_MAJOR(CM206_CDROM_MAJOR); -/* - * Local variables: - * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h -c -o cm206.o cm206.c" - * End: - */ diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 2fc966c..ba50e5a 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -381,7 +381,6 @@ #include <asm/io.h> #include <asm/uaccess.h> #include <stdarg.h> -#include <linux/config.h> #include "sbpcd.h" #define MAJOR_NR MATSUSHITA_CDROM_MAJOR diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index f74eeeb..8cd5298 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -8,7 +8,6 @@ * work is done in the northbridge(s). */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index a92ab53..cc5ea34 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -27,7 +27,6 @@ * TODO: * - Allocate more than order 0 pages to avoid too much linear map splitting. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 6602b31..3e7dc7c 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -31,7 +31,6 @@ * ever possible. */ -#include <linux/config.h> #include <linux/delay.h> #undef SERIAL_PARANOIA_CHECK diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index c85a4fa..04a1202 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c @@ -11,7 +11,6 @@ * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kd.h> #include <linux/errno.h> diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 2657eeb..1f61a67 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -633,7 +633,6 @@ static char rcsid[] = /* * Include section */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/char/decserial.c b/drivers/char/decserial.c index aa14409..85f404e 100644 --- a/drivers/char/decserial.c +++ b/drivers/char/decserial.c @@ -16,7 +16,6 @@ * console device I strongly recommend to use only one. */ -#include <linux/config.h> #include <linux/init.h> #include <asm/dec/machtype.h> diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h index 9da0ddb..5642ac4 100644 --- a/drivers/char/drm/drm.h +++ b/drivers/char/drm/drm.h @@ -38,7 +38,6 @@ #if defined(__linux__) #if defined(__KERNEL__) -#include <linux/config.h> #endif #include <asm/ioctl.h> /* For _IO* macros */ #define DRM_IOCTL_NR(n) _IOC_NR(n) diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index cb76e5c..d2a5618 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h @@ -44,7 +44,6 @@ * can build the DRM (part of PI DRI). 4/21/2000 S + B */ #include <asm/current.h> #endif /* __alpha__ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/miscdevice.h> diff --git a/drivers/char/drm/drm_memory.c b/drivers/char/drm/drm_memory.c index 7e3318e..5681cae 100644 --- a/drivers/char/drm/drm_memory.c +++ b/drivers/char/drm/drm_memory.c @@ -33,7 +33,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include <linux/highmem.h> #include "drmP.h" diff --git a/drivers/char/drm/drm_memory.h b/drivers/char/drm/drm_memory.h index 714d9ae..f1b97af 100644 --- a/drivers/char/drm/drm_memory.h +++ b/drivers/char/drm/drm_memory.h @@ -33,7 +33,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include <linux/highmem.h> #include <linux/vmalloc.h> #include "drmP.h" diff --git a/drivers/char/drm/drm_memory_debug.h b/drivers/char/drm/drm_memory_debug.h index d117cc9..74581af 100644 --- a/drivers/char/drm/drm_memory_debug.h +++ b/drivers/char/drm/drm_memory_debug.h @@ -31,7 +31,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include "drmP.h" typedef struct drm_mem_stats { diff --git a/drivers/char/drm/drm_scatter.c b/drivers/char/drm/drm_scatter.c index ce81bf2..06ef7dd 100644 --- a/drivers/char/drm/drm_scatter.c +++ b/drivers/char/drm/drm_scatter.c @@ -31,7 +31,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include <linux/vmalloc.h> #include "drmP.h" diff --git a/drivers/char/drm/drm_sysfs.c b/drivers/char/drm/drm_sysfs.c index 0b9f98a..51ad98c 100644 --- a/drivers/char/drm/drm_sysfs.c +++ b/drivers/char/drm/drm_sysfs.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/kdev_t.h> #include <linux/err.h> diff --git a/drivers/char/drm/ffb_drv.c b/drivers/char/drm/ffb_drv.c index c13f9ab..dd45111 100644 --- a/drivers/char/drm/ffb_drv.c +++ b/drivers/char/drm/ffb_drv.c @@ -4,7 +4,6 @@ * Copyright (C) 2000 David S. Miller (davem@redhat.com) */ -#include <linux/config.h> #include "ffb.h" #include "drmP.h" diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c index dfe6ad2..fabb9a8 100644 --- a/drivers/char/drm/i810_drv.c +++ b/drivers/char/drm/i810_drv.c @@ -30,7 +30,6 @@ * Gareth Hughes <gareth@valinux.com> */ -#include <linux/config.h> #include "drmP.h" #include "drm.h" #include "i810_drm.h" diff --git a/drivers/char/drm/i830_drv.c b/drivers/char/drm/i830_drv.c index 7226581..389597e 100644 --- a/drivers/char/drm/i830_drv.c +++ b/drivers/char/drm/i830_drv.c @@ -32,7 +32,6 @@ * Keith Whitwell <keith@tungstengraphics.com> */ -#include <linux/config.h> #include "drmP.h" #include "drm.h" #include "i830_drm.h" diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c index 9f7ed0e..e30f556 100644 --- a/drivers/char/drm/mga_drv.c +++ b/drivers/char/drm/mga_drv.c @@ -29,7 +29,6 @@ * Gareth Hughes <gareth@valinux.com> */ -#include <linux/config.h> #include "drmP.h" #include "drm.h" #include "mga_drm.h" diff --git a/drivers/char/drm/r128_drv.c b/drivers/char/drm/r128_drv.c index e20450a..6108e75 100644 --- a/drivers/char/drm/r128_drv.c +++ b/drivers/char/drm/r128_drv.c @@ -29,7 +29,6 @@ * Gareth Hughes <gareth@valinux.com> */ -#include <linux/config.h> #include "drmP.h" #include "drm.h" #include "r128_drm.h" diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c index b04ed1b..eb985c2 100644 --- a/drivers/char/drm/radeon_drv.c +++ b/drivers/char/drm/radeon_drv.c @@ -29,7 +29,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include "drmP.h" #include "drm.h" #include "radeon_drm.h" diff --git a/drivers/char/drm/savage_drv.c b/drivers/char/drm/savage_drv.c index aa6c0d1..eee52aa 100644 --- a/drivers/char/drm/savage_drv.c +++ b/drivers/char/drm/savage_drv.c @@ -23,7 +23,6 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include "drmP.h" #include "savage_drm.h" #include "savage_drv.h" diff --git a/drivers/char/drm/sis_drv.c b/drivers/char/drm/sis_drv.c index 6f6d7d6..5e9dc86 100644 --- a/drivers/char/drm/sis_drv.c +++ b/drivers/char/drm/sis_drv.c @@ -25,7 +25,6 @@ * */ -#include <linux/config.h> #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/char/drm/tdfx_drv.c index baa4416..012ff2e 100644 --- a/drivers/char/drm/tdfx_drv.c +++ b/drivers/char/drm/tdfx_drv.c @@ -30,7 +30,6 @@ * Gareth Hughes <gareth@valinux.com> */ -#include <linux/config.h> #include "drmP.h" #include "tdfx_drv.h" diff --git a/drivers/char/drm/via_drv.c b/drivers/char/drm/via_drv.c index 3f01225..b3d364d 100644 --- a/drivers/char/drm/via_drv.c +++ b/drivers/char/drm/via_drv.c @@ -22,7 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include <linux/config.h> #include "drmP.h" #include "via_drm.h" #include "via_drv.h" diff --git a/drivers/char/ds1302.c b/drivers/char/ds1302.c index a75e860..625e8b5 100644 --- a/drivers/char/ds1302.c +++ b/drivers/char/ds1302.c @@ -12,7 +12,6 @@ *! *!***************************************************************************/ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index 62cda25..953e670 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c @@ -2,7 +2,6 @@ * linux/drivers/char/ds1620.c: Dallas Semiconductors DS1620 * thermometer driver (as used in the Rebel.com NetWinder) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/miscdevice.h> diff --git a/drivers/char/ec3104_keyb.c b/drivers/char/ec3104_keyb.c index 4aed669..abac18b 100644 --- a/drivers/char/ec3104_keyb.c +++ b/drivers/char/ec3104_keyb.c @@ -26,7 +26,6 @@ * (prumpf@tux.org). */ -#include <linux/config.h> #include <linux/spinlock.h> #include <linux/sched.h> diff --git a/drivers/char/epca.c b/drivers/char/epca.c index d0b3890..86d290e 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -30,7 +30,6 @@ /* See README.epca for change history --DAT*/ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/char/ftape/lowlevel/ftape-calibr.c b/drivers/char/ftape/lowlevel/ftape-calibr.c index 956b258..8e50bfd 100644 --- a/drivers/char/ftape/lowlevel/ftape-calibr.c +++ b/drivers/char/ftape/lowlevel/ftape-calibr.c @@ -24,7 +24,6 @@ * functions. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/jiffies.h> #include <asm/system.h> diff --git a/drivers/char/ftape/lowlevel/ftape-ctl.c b/drivers/char/ftape/lowlevel/ftape-ctl.c index 32e0439..5d7c1ce 100644 --- a/drivers/char/ftape/lowlevel/ftape-ctl.c +++ b/drivers/char/ftape/lowlevel/ftape-ctl.c @@ -25,7 +25,6 @@ * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/mm.h> #include <linux/mman.h> diff --git a/drivers/char/ftape/lowlevel/ftape-init.c b/drivers/char/ftape/lowlevel/ftape-init.c index b54260d..4998132 100644 --- a/drivers/char/ftape/lowlevel/ftape-init.c +++ b/drivers/char/ftape/lowlevel/ftape-init.c @@ -21,7 +21,6 @@ * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/drivers/char/ftape/lowlevel/ftape-proc.c b/drivers/char/ftape/lowlevel/ftape-proc.c index c66251e9..e805b15 100644 --- a/drivers/char/ftape/lowlevel/ftape-proc.c +++ b/drivers/char/ftape/lowlevel/ftape-proc.c @@ -26,7 +26,6 @@ * Old code removed, switched to dynamic proc entry. */ -#include <linux/config.h> #if defined(CONFIG_PROC_FS) && defined(CONFIG_FT_PROC_FS) diff --git a/drivers/char/ftape/lowlevel/ftape-setup.c b/drivers/char/ftape/lowlevel/ftape-setup.c index 280a1a5..678340a 100644 --- a/drivers/char/ftape/lowlevel/ftape-setup.c +++ b/drivers/char/ftape/lowlevel/ftape-setup.c @@ -25,7 +25,6 @@ * "ftape" for Linux. */ -#include <linux/config.h> #include <linux/string.h> #include <linux/errno.h> #include <linux/mm.h> diff --git a/drivers/char/ftape/lowlevel/ftape-tracing.h b/drivers/char/ftape/lowlevel/ftape-tracing.h index fa7cd20..2950810 100644 --- a/drivers/char/ftape/lowlevel/ftape-tracing.h +++ b/drivers/char/ftape/lowlevel/ftape-tracing.h @@ -28,7 +28,6 @@ * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux. */ -#include <linux/config.h> #include <linux/kernel.h> /* diff --git a/drivers/char/ftape/lowlevel/ftape_syms.c b/drivers/char/ftape/lowlevel/ftape_syms.c index 5dc3a38..8e0dc4a 100644 --- a/drivers/char/ftape/lowlevel/ftape_syms.c +++ b/drivers/char/ftape/lowlevel/ftape_syms.c @@ -25,7 +25,6 @@ * exports to its high level clients */ -#include <linux/config.h> #include <linux/module.h> #include <linux/ftape.h> diff --git a/drivers/char/ftape/zftape/zftape-ctl.c b/drivers/char/ftape/zftape/zftape-ctl.c index 6c7874e5..22ba0f5 100644 --- a/drivers/char/ftape/zftape/zftape-ctl.c +++ b/drivers/char/ftape/zftape/zftape-ctl.c @@ -24,7 +24,6 @@ * for the QIC-40/80/3010/3020 floppy-tape driver for Linux. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/mm.h> #include <linux/module.h> diff --git a/drivers/char/ftape/zftape/zftape-ctl.h b/drivers/char/ftape/zftape/zftape-ctl.h index 4141598..8e6f2d7 100644 --- a/drivers/char/ftape/zftape/zftape-ctl.h +++ b/drivers/char/ftape/zftape/zftape-ctl.h @@ -27,7 +27,6 @@ * for the QIC-40/80 floppy-tape driver for Linux. */ -#include <linux/config.h> #include <linux/ioctl.h> #include <linux/mtio.h> diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c index 3eeb869..5527256 100644 --- a/drivers/char/ftape/zftape/zftape-init.c +++ b/drivers/char/ftape/zftape/zftape-init.c @@ -20,7 +20,6 @@ * to the ftape floppy tape driver for Linux */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 588fca5..bebd7e3 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c @@ -43,7 +43,6 @@ #define RTC_VERSION "1.07" #include <linux/module.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/miscdevice.h> #include <linux/fcntl.h> diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 07473cd..8b6c76f 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 6e380ae..859e500 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/console.h> #include <linux/cpumask.h> #include <linux/init.h> diff --git a/drivers/char/ip2/i2ellis.h b/drivers/char/ip2/i2ellis.h index 510b026..5eabe47 100644 --- a/drivers/char/ip2/i2ellis.h +++ b/drivers/char/ip2/i2ellis.h @@ -47,7 +47,6 @@ //---------------------- // Mandatory Includes: //---------------------- -#include <linux/config.h> #include "ip2types.h" #include "i2hw.h" // The hardware definitions diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 8619542..f9aa53c 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c @@ -82,7 +82,6 @@ /************/ /* Includes */ /************/ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/string.h> diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index da637ad..2fc894f 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c @@ -31,7 +31,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/errno.h> diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index ad26f4b..0aa5d60 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -31,7 +31,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <asm/system.h> diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index d0b5c08..8d941db 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c @@ -31,7 +31,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/proc_fs.h> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index bd4f224..c7f3e5c 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -38,7 +38,6 @@ * and drives the real SMI state machine. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <asm/system.h> diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 1a0a19c..74a889c 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -31,7 +31,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/ipmi.h> diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 478bf4d..c105b95 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -245,7 +245,7 @@ static int lock_card(struct isi_board *card) printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", card->base); - return 0; /* Failed to aquire the card! */ + return 0; /* Failed to acquire the card! */ } static int lock_card_at_interrupt(struct isi_board *card) @@ -262,7 +262,7 @@ static int lock_card_at_interrupt(struct isi_board *card) spin_unlock_irqrestore(&card->card_lock, card->flags); } /* Failing in interrupt is an acceptable event */ - return 0; /* Failed to aquire the card! */ + return 0; /* Failed to acquire the card! */ } static void unlock_card(struct isi_board *card) diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index c74e566..fbce2f0 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -26,7 +26,6 @@ /*****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/interrupt.h> @@ -282,7 +281,6 @@ static char *stli_brdnames[] = { /*****************************************************************************/ -#ifdef MODULE /* * Define some string labels for arguments passed from the module * load line. These allow for easy board definitions, and easy @@ -381,8 +379,6 @@ MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]"); module_param_array(board3, charp, NULL, 0); MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]"); -#endif - /* * Set up a default memory address table for EISA board probing. * The default addresses are all bellow 1Mbyte, which has to be the @@ -643,14 +639,8 @@ static unsigned int stli_baudrates[] = { * Prototype all functions in this driver! */ -#ifdef MODULE -static void stli_argbrds(void); static int stli_parsebrd(stlconf_t *confp, char **argp); - -static unsigned long stli_atol(char *str); -#endif - -int stli_init(void); +static int stli_init(void); static int stli_open(struct tty_struct *tty, struct file *filp); static void stli_close(struct tty_struct *tty, struct file *filp); static int stli_write(struct tty_struct *tty, const unsigned char *buf, int count); @@ -786,8 +776,6 @@ static int stli_timeron; static struct class *istallion_class; -#ifdef MODULE - /* * Loadable module initialization stuff. */ @@ -954,8 +942,6 @@ static int stli_parsebrd(stlconf_t *confp, char **argp) return(1); } -#endif - /*****************************************************************************/ static int stli_open(struct tty_struct *tty, struct file *filp) @@ -4694,7 +4680,7 @@ static struct tty_operations stli_ops = { /*****************************************************************************/ -int __init stli_init(void) +static int __init stli_init(void) { int i; printk(KERN_INFO "%s: version %s\n", stli_drvtitle, stli_drvversion); diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 4bb3d22..056ebe8 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -24,7 +24,6 @@ * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/tty.h> diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c index 29963d8..7d49b24 100644 --- a/drivers/char/lcd.c +++ b/drivers/char/lcd.c @@ -14,7 +14,6 @@ #define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/miscdevice.h> diff --git a/drivers/char/lp.c b/drivers/char/lp.c index b11a390..582cdbd 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -114,7 +114,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/major.h> diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index c268ee0..bb07c27 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -10,7 +10,6 @@ * MOATB Core Services driver. */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 6fe7b6c..70f3954 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -8,7 +8,6 @@ * Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> */ -#include <linux/config.h> #include <linux/mm.h> #include <linux/miscdevice.h> #include <linux/slab.h> diff --git a/drivers/char/misc.c b/drivers/char/misc.c index dfe1ced..d5fa19d 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -34,7 +34,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/fs.h> #include <linux/errno.h> diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 52ef61f5..4ea7bd5 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -29,7 +29,6 @@ * version : 5.1 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/mm.h> diff --git a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c index d1fe05e..4e4865e 100644 --- a/drivers/char/mwave/3780i.c +++ b/drivers/char/mwave/3780i.c @@ -46,7 +46,6 @@ * First release to the public */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/unistd.h> #include <linux/delay.h> diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 72cfd09..eb1559f 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -36,7 +36,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/autoconf.h> #include <linux/errno.h> diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index 9f54733..337a87f 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -81,7 +81,6 @@ #define HDLC_MAGIC 0x239e #define HDLC_VERSION "$Revision: 4.8 $" -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 3556ccd..8c5f102 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -37,7 +37,6 @@ #define NVRAM_VERSION "1.2" #include <linux/module.h> -#include <linux/config.h> #include <linux/sched.h> #include <linux/smp_lock.h> #include <linux/nvram.h> diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c index 4083b78..94845dd 100644 --- a/drivers/char/nwbutton.c +++ b/drivers/char/nwbutton.c @@ -4,7 +4,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c index 1c706cc..c860de6 100644 --- a/drivers/char/pc8736x_gpio.c +++ b/drivers/char/pc8736x_gpio.c @@ -319,9 +319,10 @@ static int __init pc8736x_gpio_init(void) return 0; undo_platform_dev_add: - platform_device_put(pdev); + platform_device_del(pdev); undo_platform_dev_alloc: - kfree(pdev); + platform_device_put(pdev); + return rc; } diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index eab5394..31c8a21 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -149,12 +149,7 @@ struct cm4000_dev { #define ZERO_DEV(dev) \ memset(&dev->atr_csum,0, \ sizeof(struct cm4000_dev) - \ - /*link*/ sizeof(struct pcmcia_device *) - \ - /*node*/ sizeof(dev_node_t) - \ - /*atr*/ MAX_ATR*sizeof(char) - \ - /*rbuf*/ 512*sizeof(char) - \ - /*sbuf*/ 512*sizeof(char) - \ - /*queue*/ 4*sizeof(wait_queue_head_t)) + offsetof(struct cm4000_dev, atr_csum)) static struct pcmcia_device *dev_table[CM4000_MAX_DEV]; static struct class *cmm_class; diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 9491e43..34dd4c3 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> /* For EXPORT_SYMBOL */ #include <linux/errno.h> diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c index 601d09b..1087530 100644 --- a/drivers/char/qtronix.c +++ b/drivers/char/qtronix.c @@ -33,7 +33,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> /* * NOTE: diff --git a/drivers/char/random.c b/drivers/char/random.c index 58f3512..164bdda 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -224,7 +224,6 @@ */ #include <linux/utsname.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/major.h> diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index aa43436..5332d1d 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -33,7 +33,6 @@ * */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kdev_t.h> #include <asm/io.h> #include <linux/kernel.h> diff --git a/drivers/char/rio/rio_linux.h b/drivers/char/rio/rio_linux.h index 55b9c97..dc3f005 100644 --- a/drivers/char/rio/rio_linux.h +++ b/drivers/char/rio/rio_linux.h @@ -23,7 +23,6 @@ * Version 1.0 -- July, 1999. * */ -#include <linux/config.h> #define RIO_NBOARDS 4 #define RIO_PORTSPERBOARD 128 diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c index 12e34bc..99f3df0 100644 --- a/drivers/char/rio/rioinit.c +++ b/drivers/char/rio/rioinit.c @@ -33,7 +33,6 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; #endif -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/errno.h> diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 0897b0c..37dc2ed 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -61,7 +61,6 @@ * this driver.) */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c index 5a280a3..45083e5 100644 --- a/drivers/char/scx200_gpio.c +++ b/drivers/char/scx200_gpio.c @@ -126,9 +126,10 @@ static int __init scx200_gpio_init(void) undo_chrdev_region: unregister_chrdev_region(dev, num_pins); undo_platform_device_add: - platform_device_put(pdev); + platform_device_del(pdev); undo_malloc: - kfree(pdev); + platform_device_put(pdev); + return rc; } @@ -136,7 +137,6 @@ static void __exit scx200_gpio_cleanup(void) { kfree(scx200_devices); unregister_chrdev_region(MKDEV(major, 0), num_pins); - platform_device_put(pdev); platform_device_unregister(pdev); /* kfree(pdev); */ } diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index c851eea..21a710c 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -44,7 +44,6 @@ * - replace bottom half handler with task queue handler */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/signal.h> #include <linux/sched.h> diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 43dfd86..e19d485 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -33,7 +33,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/input.h> #include <linux/pci.h> diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index d2d6b01..d4243fb 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -75,7 +75,6 @@ * Documentation/specialix.txt */ -#include <linux/config.h> #include <linux/module.h> #include <asm/io.h> diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 0f7a542..f15df0e 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -26,7 +26,6 @@ /*****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/interrupt.h> diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 4e35d41..03edccc 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c @@ -46,7 +46,6 @@ //#define DBGRBUF(info) dump_rbufs(info) -#include <linux/config.h> #include <linux/module.h> #include <linux/version.h> #include <linux/errno.h> diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 21bf15a..ba54df3 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -34,7 +34,6 @@ #define MAX_DEVICES 12 -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 35082dc..a064ee9 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -12,7 +12,6 @@ * based upon discusions in irc://irc.openprojects.net/#kernelnewbies */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/mm.h> diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c index f7802e5..e0633a11 100644 --- a/drivers/char/tipar.c +++ b/drivers/char/tipar.c @@ -42,7 +42,6 @@ */ #undef DEBUG /* change to #define to get debugging * output - for pr_debug() */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index ef68d15..dfc4437 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c @@ -27,7 +27,6 @@ * MPCBL0010 ATCA computer. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/sched.h> diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index a114323..615e934 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -65,7 +65,6 @@ * alloc_tty_struct() always uses kmalloc() -- Andrew Morton <andrewm@uow.edu.eu> 17Mar01 */ -#include <linux/config.h> #include <linux/types.h> #include <linux/major.h> #include <linux/errno.h> diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c index 234d7f3..45e9bd8 100644 --- a/drivers/char/vc_screen.c +++ b/drivers/char/vc_screen.c @@ -21,7 +21,6 @@ * - making it shorter - scr_readw are macros which expand in PRETTY long code */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/major.h> #include <linux/errno.h> diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 07f5ce4..766f786 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -25,7 +25,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/proc_fs.h> #include <linux/errno.h> diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 198f150..7d42c8e 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c @@ -31,7 +31,6 @@ * the OS/400 partition. The format of the messages is defined in * iseries/vio.h */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index fe99fc1..b17a6e2 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -14,7 +14,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kdev_t.h> #include <asm/io.h> #include <linux/kernel.h> diff --git a/drivers/char/vt.c b/drivers/char/vt.c index d6f6503..3ef823d 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -86,7 +86,6 @@ #include <linux/consolemap.h> #include <linux/timer.h> #include <linux/interrupt.h> -#include <linux/config.h> #include <linux/workqueue.h> #include <linux/bootmem.h> #include <linux/pm.h> diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 24011e7..eccffaf 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c @@ -10,7 +10,6 @@ * Check put/get_user, cleanups - acme@conectiva.com.br - Jun 2001 */ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/sched.h> diff --git a/drivers/char/watchdog/at91_wdt.c b/drivers/char/watchdog/at91_wdt.c index 0008065..f61dedc 100644 --- a/drivers/char/watchdog/at91_wdt.c +++ b/drivers/char/watchdog/at91_wdt.c @@ -9,7 +9,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/fs.h> #include <linux/init.h> diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c index b664060..537f5c6 100644 --- a/drivers/char/watchdog/booke_wdt.c +++ b/drivers/char/watchdog/booke_wdt.c @@ -14,7 +14,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c index 25c2f25..e89cda0 100644 --- a/drivers/char/watchdog/eurotechwdt.c +++ b/drivers/char/watchdog/eurotechwdt.c @@ -40,7 +40,6 @@ * Added Matt Domsch's nowayout module option. */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c index cf60329..a2e53c7 100644 --- a/drivers/char/watchdog/ib700wdt.c +++ b/drivers/char/watchdog/ib700wdt.c @@ -31,7 +31,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/ibmasr.c b/drivers/char/watchdog/ibmasr.c index 294c474..b0741cb 100644 --- a/drivers/char/watchdog/ibmasr.c +++ b/drivers/char/watchdog/ibmasr.c @@ -10,7 +10,6 @@ * of the GNU Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c index b4b94da..d387979 100644 --- a/drivers/char/watchdog/indydog.c +++ b/drivers/char/watchdog/indydog.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/fs.h> diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index 0cfb9b9..aa29a7d 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c @@ -16,7 +16,6 @@ * warranty of any kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c index 3800835..e6a3fe8 100644 --- a/drivers/char/watchdog/ixp4xx_wdt.c +++ b/drivers/char/watchdog/ixp4xx_wdt.c @@ -13,7 +13,6 @@ * warranty of any kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index a9a20aa..b67b487 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c @@ -28,7 +28,6 @@ * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c index d8dede5..433c27f 100644 --- a/drivers/char/watchdog/mixcomwd.c +++ b/drivers/char/watchdog/mixcomwd.c @@ -37,7 +37,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/miscdevice.h> #include <linux/ioport.h> diff --git a/drivers/char/watchdog/mpc83xx_wdt.c b/drivers/char/watchdog/mpc83xx_wdt.c index 5d6f506..dac1381 100644 --- a/drivers/char/watchdog/mpc83xx_wdt.c +++ b/drivers/char/watchdog/mpc83xx_wdt.c @@ -15,7 +15,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/char/watchdog/mpc8xx_wdt.c b/drivers/char/watchdog/mpc8xx_wdt.c index b2fc71e..11f0ccd 100644 --- a/drivers/char/watchdog/mpc8xx_wdt.c +++ b/drivers/char/watchdog/mpc8xx_wdt.c @@ -9,7 +9,6 @@ * or implied. */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index 2c2c517..9c11d92 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c @@ -21,7 +21,6 @@ */ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/miscdevice.h> #include <linux/watchdog.h> diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index f1b9cf8..20a6cbb 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c @@ -15,7 +15,6 @@ * or implied. */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 0d072be..92bf8c1 100644 --- a/drivers/char/watchdog/pcwd_usb.c +++ b/drivers/char/watchdog/pcwd_usb.c @@ -24,7 +24,6 @@ * http://www.berkprod.com/ or http://www.pcwatchdog.com/ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 1ea04e9..f267dad 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c @@ -37,7 +37,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/timer.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c index 522a937..b22e95c 100644 --- a/drivers/char/watchdog/sa1100_wdt.c +++ b/drivers/char/watchdog/sa1100_wdt.c @@ -17,7 +17,6 @@ * * 27/11/2000 Initial release */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/char/watchdog/sbc8360.c b/drivers/char/watchdog/sbc8360.c index c6cbf80..6562aa9 100644 --- a/drivers/char/watchdog/sbc8360.c +++ b/drivers/char/watchdog/sbc8360.c @@ -36,7 +36,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/sbc_epx_c3.c b/drivers/char/watchdog/sbc_epx_c3.c index 837b1ec3..09867fa 100644 --- a/drivers/char/watchdog/sbc_epx_c3.c +++ b/drivers/char/watchdog/sbc_epx_c3.c @@ -15,7 +15,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/fs.h> diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c index 20b88f9..78ef633 100644 --- a/drivers/char/watchdog/sc1200wdt.c +++ b/drivers/char/watchdog/sc1200wdt.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c index b4a102a..c0b4754 100644 --- a/drivers/char/watchdog/scx200_wdt.c +++ b/drivers/char/watchdog/scx200_wdt.c @@ -17,7 +17,6 @@ of any nature resulting due to the use of this software. This software is provided AS-IS with no warranties. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c index 1f4cab5..803701b 100644 --- a/drivers/char/watchdog/shwdt.c +++ b/drivers/char/watchdog/shwdt.c @@ -17,7 +17,6 @@ * Added expect close support, made emulated timeout runtime changeable * general cleanups, add some ioctls */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c index a91edaf..79ce5c6 100644 --- a/drivers/char/watchdog/softdog.c +++ b/drivers/char/watchdog/softdog.c @@ -38,7 +38,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/timer.h> #include <linux/miscdevice.h> diff --git a/drivers/char/watchdog/w83977f_wdt.c b/drivers/char/watchdog/w83977f_wdt.c index a7ff64c..c31849e 100644 --- a/drivers/char/watchdog/w83977f_wdt.c +++ b/drivers/char/watchdog/w83977f_wdt.c @@ -17,7 +17,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/fs.h> diff --git a/drivers/char/watchdog/wd501p.h b/drivers/char/watchdog/wd501p.h index 84e60eb..a4504f4 100644 --- a/drivers/char/watchdog/wd501p.h +++ b/drivers/char/watchdog/wd501p.h @@ -19,7 +19,6 @@ * */ -#include <linux/config.h> #define WDT_COUNT0 (io+0) #define WDT_COUNT1 (io+1) diff --git a/drivers/char/watchdog/wdrtas.c b/drivers/char/watchdog/wdrtas.c index dacfe31..3a462c3 100644 --- a/drivers/char/watchdog/wdrtas.c +++ b/drivers/char/watchdog/wdrtas.c @@ -26,7 +26,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c index ec7e4012..2586e9e 100644 --- a/drivers/char/watchdog/wdt.c +++ b/drivers/char/watchdog/wdt.c @@ -31,7 +31,6 @@ * Matt Domsch : Added nowayout module option */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c index 3843900..3cde2b9 100644 --- a/drivers/char/watchdog/wdt977.c +++ b/drivers/char/watchdog/wdt977.c @@ -24,7 +24,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/fs.h> diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c index 4b33119..c79cc95 100644 --- a/drivers/char/watchdog/wdt_pci.c +++ b/drivers/char/watchdog/wdt_pci.c @@ -35,7 +35,6 @@ * Matt Domsch : nowayout module option */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 35e0b9c..1ba4039 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -15,7 +15,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 145061b..25eee53 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -9,7 +9,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sysdev.h> #include <linux/cpu.h> diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 071ee4f..44ae5e5 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/smp.h> diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c index 53423ad..d75864e 100644 --- a/drivers/edac/amd76x_edac.c +++ b/drivers/edac/amd76x_edac.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -20,6 +19,9 @@ #include <linux/slab.h> #include "edac_mc.h" +#define AMD76X_REVISION " Ver: 2.0.0 " __DATE__ + + #define amd76x_printk(level, fmt, arg...) \ edac_printk(level, "amd76x", fmt, ##arg) @@ -102,15 +104,18 @@ static const struct amd76x_dev_info amd76x_devs[] = { static void amd76x_get_error_info(struct mem_ctl_info *mci, struct amd76x_error_info *info) { - pci_read_config_dword(mci->pdev, AMD76X_ECC_MODE_STATUS, + struct pci_dev *pdev; + + pdev = to_pci_dev(mci->dev); + pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &info->ecc_mode_status); if (info->ecc_mode_status & BIT(8)) - pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS, + pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS, (u32) BIT(8), (u32) BIT(8)); if (info->ecc_mode_status & BIT(9)) - pci_write_bits32(mci->pdev, AMD76X_ECC_MODE_STATUS, + pci_write_bits32(pdev, AMD76X_ECC_MODE_STATUS, (u32) BIT(9), (u32) BIT(9)); } @@ -176,6 +181,38 @@ static void amd76x_check(struct mem_ctl_info *mci) amd76x_process_error_info(mci, &info, 1); } +static void amd76x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, + enum edac_type edac_mode) +{ + struct csrow_info *csrow; + u32 mba, mba_base, mba_mask, dms; + int index; + + for (index = 0; index < mci->nr_csrows; index++) { + csrow = &mci->csrows[index]; + + /* find the DRAM Chip Select Base address and mask */ + pci_read_config_dword(pdev, + AMD76X_MEM_BASE_ADDR + (index * 4), + &mba); + + if (!(mba & BIT(0))) + continue; + + mba_base = mba & 0xff800000UL; + mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL; + pci_read_config_dword(pdev, AMD76X_DRAM_MODE_STATUS, &dms); + csrow->first_page = mba_base >> PAGE_SHIFT; + csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT; + csrow->last_page = csrow->first_page + csrow->nr_pages - 1; + csrow->page_mask = mba_mask >> PAGE_SHIFT; + csrow->grain = csrow->nr_pages << PAGE_SHIFT; + csrow->mtype = MEM_RDDR; + csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN; + csrow->edac_mode = edac_mode; + } +} + /** * amd76x_probe1 - Perform set up for detected device * @pdev; PCI device detected @@ -187,15 +224,13 @@ static void amd76x_check(struct mem_ctl_info *mci) */ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) { - int rc = -ENODEV; - int index; - struct mem_ctl_info *mci = NULL; - enum edac_type ems_modes[] = { + static const enum edac_type ems_modes[] = { EDAC_NONE, EDAC_EC, EDAC_SECDED, EDAC_SECDED }; + struct mem_ctl_info *mci = NULL; u32 ems; u32 ems_mode; struct amd76x_error_info discard; @@ -206,53 +241,28 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) mci = edac_mc_alloc(0, AMD76X_NR_CSROWS, AMD76X_NR_CHANS); if (mci == NULL) { - rc = -ENOMEM; - goto fail; + return -ENOMEM; } debugf0("%s(): mci = %p\n", __func__, mci); - mci->pdev = pdev; + mci->dev = &pdev->dev; mci->mtype_cap = MEM_FLAG_RDDR; mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; mci->edac_cap = ems_mode ? (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE; mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.4.2.5 $"; + mci->mod_ver = AMD76X_REVISION; mci->ctl_name = amd76x_devs[dev_idx].ctl_name; mci->edac_check = amd76x_check; mci->ctl_page_to_phys = NULL; - for (index = 0; index < mci->nr_csrows; index++) { - struct csrow_info *csrow = &mci->csrows[index]; - u32 mba; - u32 mba_base; - u32 mba_mask; - u32 dms; - - /* find the DRAM Chip Select Base address and mask */ - pci_read_config_dword(mci->pdev, - AMD76X_MEM_BASE_ADDR + (index * 4), &mba); - - if (!(mba & BIT(0))) - continue; - - mba_base = mba & 0xff800000UL; - mba_mask = ((mba & 0xff80) << 16) | 0x7fffffUL; - pci_read_config_dword(mci->pdev, AMD76X_DRAM_MODE_STATUS, - &dms); - csrow->first_page = mba_base >> PAGE_SHIFT; - csrow->nr_pages = (mba_mask + 1) >> PAGE_SHIFT; - csrow->last_page = csrow->first_page + csrow->nr_pages - 1; - csrow->page_mask = mba_mask >> PAGE_SHIFT; - csrow->grain = csrow->nr_pages << PAGE_SHIFT; - csrow->mtype = MEM_RDDR; - csrow->dtype = ((dms >> index) & 0x1) ? DEV_X4 : DEV_UNKNOWN; - csrow->edac_mode = ems_modes[ems_mode]; - } - + amd76x_init_csrows(mci, pdev, ems_modes[ems_mode]); amd76x_get_error_info(mci, &discard); /* clear counters */ - if (edac_mc_add_mc(mci)) { + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. + */ + if (edac_mc_add_mc(mci,0)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } @@ -262,9 +272,8 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) return 0; fail: - if (mci != NULL) - edac_mc_free(mci); - return rc; + edac_mc_free(mci); + return -ENODEV; } /* returns count (>= 0), or negative on error */ @@ -291,7 +300,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; edac_mc_free(mci); diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index fce3193..815c3eb 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c @@ -17,7 +17,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -25,6 +24,8 @@ #include <linux/slab.h> #include "edac_mc.h" +#define E752X_REVISION " Ver: 2.0.0 " __DATE__ + static int force_function_unhide; #define e752x_printk(level, fmt, arg...) \ @@ -763,22 +764,174 @@ static void e752x_check(struct mem_ctl_info *mci) e752x_process_error_info(mci, &info, 1); } -static int e752x_probe1(struct pci_dev *pdev, int dev_idx) +/* Return 1 if dual channel mode is active. Else return 0. */ +static inline int dual_channel_active(u16 ddrcsr) +{ + return (((ddrcsr >> 12) & 3) == 3); +} + +static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, + u16 ddrcsr) +{ + struct csrow_info *csrow; + unsigned long last_cumul_size; + int index, mem_dev, drc_chan; + int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ + int drc_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ + u8 value; + u32 dra, drc, cumul_size; + + pci_read_config_dword(pdev, E752X_DRA, &dra); + pci_read_config_dword(pdev, E752X_DRC, &drc); + drc_chan = dual_channel_active(ddrcsr); + drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ + drc_ddim = (drc >> 20) & 0x3; + + /* The dram row boundary (DRB) reg values are boundary address for + * each DRAM row with a granularity of 64 or 128MB (single/dual + * channel operation). DRB regs are cumulative; therefore DRB7 will + * contain the total memory contained in all eight rows. + */ + for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { + /* mem_dev 0=x8, 1=x4 */ + mem_dev = (dra >> (index * 4 + 2)) & 0x3; + csrow = &mci->csrows[index]; + + mem_dev = (mem_dev == 2); + pci_read_config_byte(pdev, E752X_DRB + index, &value); + /* convert a 128 or 64 MiB DRB to a page size. */ + cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); + debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, + cumul_size); + if (cumul_size == last_cumul_size) + continue; /* not populated */ + + csrow->first_page = last_cumul_size; + csrow->last_page = cumul_size - 1; + csrow->nr_pages = cumul_size - last_cumul_size; + last_cumul_size = cumul_size; + csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ + csrow->mtype = MEM_RDDR; /* only one type supported */ + csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; + + /* + * if single channel or x8 devices then SECDED + * if dual channel and x4 then S4ECD4ED + */ + if (drc_ddim) { + if (drc_chan && mem_dev) { + csrow->edac_mode = EDAC_S4ECD4ED; + mci->edac_cap |= EDAC_FLAG_S4ECD4ED; + } else { + csrow->edac_mode = EDAC_SECDED; + mci->edac_cap |= EDAC_FLAG_SECDED; + } + } else + csrow->edac_mode = EDAC_NONE; + } +} + +static void e752x_init_mem_map_table(struct pci_dev *pdev, + struct e752x_pvt *pvt) { - int rc = -ENODEV; int index; + u8 value, last, row, stat8; + + last = 0; + row = 0; + + for (index = 0; index < 8; index += 2) { + pci_read_config_byte(pdev, E752X_DRB + index, &value); + /* test if there is a dimm in this slot */ + if (value == last) { + /* no dimm in the slot, so flag it as empty */ + pvt->map[index] = 0xff; + pvt->map[index + 1] = 0xff; + } else { /* there is a dimm in the slot */ + pvt->map[index] = row; + row++; + last = value; + /* test the next value to see if the dimm is double + * sided + */ + pci_read_config_byte(pdev, E752X_DRB + index + 1, + &value); + pvt->map[index + 1] = (value == last) ? + 0xff : /* the dimm is single sided, + so flag as empty */ + row; /* this is a double sided dimm + to save the next row # */ + row++; + last = value; + } + } + + /* set the map type. 1 = normal, 0 = reversed */ + pci_read_config_byte(pdev, E752X_DRM, &stat8); + pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f)); +} + +/* Return 0 on success or 1 on failure. */ +static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, + struct e752x_pvt *pvt) +{ + struct pci_dev *dev; + + pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, + pvt->dev_info->err_dev, + pvt->bridge_ck); + + if (pvt->bridge_ck == NULL) + pvt->bridge_ck = pci_scan_single_device(pdev->bus, + PCI_DEVFN(0, 1)); + + if (pvt->bridge_ck == NULL) { + e752x_printk(KERN_ERR, "error reporting device not found:" + "vendor %x device 0x%x (broken BIOS?)\n", + PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); + return 1; + } + + dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, + NULL); + + if (dev == NULL) + goto fail; + + pvt->dev_d0f0 = dev; + pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); + + return 0; + +fail: + pci_dev_put(pvt->bridge_ck); + return 1; +} + +static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt) +{ + struct pci_dev *dev; + + dev = pvt->dev_d0f1; + /* Turn off error disable & SMI in case the BIOS turned it on */ + pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00); + pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00); + pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00); + pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00); + pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00); + pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00); +} + +static int e752x_probe1(struct pci_dev *pdev, int dev_idx) +{ u16 pci_data; u8 stat8; - struct mem_ctl_info *mci = NULL; - struct e752x_pvt *pvt = NULL; + struct mem_ctl_info *mci; + struct e752x_pvt *pvt; u16 ddrcsr; - u32 drc; int drc_chan; /* Number of channels 0=1chan,1=2chan */ - int drc_drbg; /* DRB granularity 0=64mb, 1=128mb */ - int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ - u32 dra; - unsigned long last_cumul_size; - struct pci_dev *dev = NULL; struct e752x_error_info discard; debugf0("%s(): mci\n", __func__); @@ -792,25 +945,20 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) if (!force_function_unhide && !(stat8 & (1 << 5))) { printk(KERN_INFO "Contact your BIOS vendor to see if the " "E752x error registers can be safely un-hidden\n"); - goto fail; + return -ENOMEM; } stat8 |= (1 << 5); pci_write_config_byte(pdev, E752X_DEVPRES1, stat8); - /* need to find out the number of channels */ - pci_read_config_dword(pdev, E752X_DRC, &drc); pci_read_config_word(pdev, E752X_DDRCSR, &ddrcsr); /* FIXME: should check >>12 or 0xf, true for all? */ /* Dual channel = 1, Single channel = 0 */ - drc_chan = (((ddrcsr >> 12) & 3) == 3); - drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ - drc_ddim = (drc >> 20) & 0x3; + drc_chan = dual_channel_active(ddrcsr); mci = edac_mc_alloc(sizeof(*pvt), E752X_NR_CSROWS, drc_chan + 1); if (mci == NULL) { - rc = -ENOMEM; - goto fail; + return -ENOMEM; } debugf3("%s(): init mci\n", __func__); @@ -819,159 +967,54 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) EDAC_FLAG_S4ECD4ED; /* FIXME - what if different memory types are in different csrows? */ mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.5.2.11 $"; - mci->pdev = pdev; + mci->mod_ver = E752X_REVISION; + mci->dev = &pdev->dev; debugf3("%s(): init pvt\n", __func__); pvt = (struct e752x_pvt *) mci->pvt_info; pvt->dev_info = &e752x_devs[dev_idx]; - pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, - pvt->dev_info->err_dev, - pvt->bridge_ck); - - if (pvt->bridge_ck == NULL) - pvt->bridge_ck = pci_scan_single_device(pdev->bus, - PCI_DEVFN(0, 1)); + pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); - if (pvt->bridge_ck == NULL) { - e752x_printk(KERN_ERR, "error reporting device not found:" - "vendor %x device 0x%x (broken BIOS?)\n", - PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); - goto fail; + if (e752x_get_devs(pdev, dev_idx, pvt)) { + edac_mc_free(mci); + return -ENODEV; } - pvt->mc_symmetric = ((ddrcsr & 0x10) != 0); debugf3("%s(): more mci init\n", __func__); mci->ctl_name = pvt->dev_info->ctl_name; mci->edac_check = e752x_check; mci->ctl_page_to_phys = ctl_page_to_phys; - /* find out the device types */ - pci_read_config_dword(pdev, E752X_DRA, &dra); - - /* - * The dram row boundary (DRB) reg values are boundary address for - * each DRAM row with a granularity of 64 or 128MB (single/dual - * channel operation). DRB regs are cumulative; therefore DRB7 will - * contain the total memory contained in all eight rows. - */ - for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { - u8 value; - u32 cumul_size; - - /* mem_dev 0=x8, 1=x4 */ - int mem_dev = (dra >> (index * 4 + 2)) & 0x3; - struct csrow_info *csrow = &mci->csrows[index]; - - mem_dev = (mem_dev == 2); - pci_read_config_byte(mci->pdev, E752X_DRB + index, &value); - /* convert a 128 or 64 MiB DRB to a page size. */ - cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); - debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, - cumul_size); - - if (cumul_size == last_cumul_size) - continue; /* not populated */ - - csrow->first_page = last_cumul_size; - csrow->last_page = cumul_size - 1; - csrow->nr_pages = cumul_size - last_cumul_size; - last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ - csrow->mtype = MEM_RDDR; /* only one type supported */ - csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; - - /* - * if single channel or x8 devices then SECDED - * if dual channel and x4 then S4ECD4ED - */ - if (drc_ddim) { - if (drc_chan && mem_dev) { - csrow->edac_mode = EDAC_S4ECD4ED; - mci->edac_cap |= EDAC_FLAG_S4ECD4ED; - } else { - csrow->edac_mode = EDAC_SECDED; - mci->edac_cap |= EDAC_FLAG_SECDED; - } - } else - csrow->edac_mode = EDAC_NONE; - } - - /* Fill in the memory map table */ - { - u8 value; - u8 last = 0; - u8 row = 0; - - for (index = 0; index < 8; index += 2) { - pci_read_config_byte(mci->pdev, E752X_DRB + index, - &value); - - /* test if there is a dimm in this slot */ - if (value == last) { - /* no dimm in the slot, so flag it as empty */ - pvt->map[index] = 0xff; - pvt->map[index + 1] = 0xff; - } else { /* there is a dimm in the slot */ - pvt->map[index] = row; - row++; - last = value; - /* test the next value to see if the dimm is - double sided */ - pci_read_config_byte(mci->pdev, - E752X_DRB + index + 1, - &value); - pvt->map[index + 1] = (value == last) ? - 0xff : /* the dimm is single sided, - * so flag as empty - */ - row; /* this is a double sided dimm - * to save the next row # - */ - row++; - last = value; - } - } - } + e752x_init_csrows(mci, pdev, ddrcsr); + e752x_init_mem_map_table(pdev, pvt); /* set the map type. 1 = normal, 0 = reversed */ - pci_read_config_byte(mci->pdev, E752X_DRM, &stat8); + pci_read_config_byte(pdev, E752X_DRM, &stat8); pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f)); mci->edac_cap |= EDAC_FLAG_NONE; debugf3("%s(): tolm, remapbase, remaplimit\n", __func__); /* load the top of low memory, remap base, and remap limit vars */ - pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data); + pci_read_config_word(pdev, E752X_TOLM, &pci_data); pvt->tolm = ((u32) pci_data) << 4; - pci_read_config_word(mci->pdev, E752X_REMAPBASE, &pci_data); + pci_read_config_word(pdev, E752X_REMAPBASE, &pci_data); pvt->remapbase = ((u32) pci_data) << 14; - pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data); + pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data); pvt->remaplimit = ((u32) pci_data) << 14; e752x_printk(KERN_INFO, "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, pvt->remapbase, pvt->remaplimit); - if (edac_mc_add_mc(mci)) { + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. + */ + if (edac_mc_add_mc(mci,0)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } - dev = pci_get_device(PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].ctl_dev, - NULL); - pvt->dev_d0f0 = dev; - /* find the error reporting device and clear errors */ - dev = pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); - /* Turn off error disable & SMI in case the BIOS turned it on */ - pci_write_config_byte(dev, E752X_HI_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_HI_SMICMD, 0x00); - pci_write_config_word(dev, E752X_SYSBUS_ERRMASK, 0x00); - pci_write_config_word(dev, E752X_SYSBUS_SMICMD, 0x00); - pci_write_config_byte(dev, E752X_BUF_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_BUF_SMICMD, 0x00); - pci_write_config_byte(dev, E752X_DRAM_ERRMASK, 0x00); - pci_write_config_byte(dev, E752X_DRAM_SMICMD, 0x00); - + e752x_init_error_reporting_regs(pvt); e752x_get_error_info(mci, &discard); /* clear other MCH errors */ /* get this far and it's successful */ @@ -979,20 +1022,12 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) return 0; fail: - if (mci) { - if (pvt->dev_d0f0) - pci_dev_put(pvt->dev_d0f0); - - if (pvt->dev_d0f1) - pci_dev_put(pvt->dev_d0f1); - - if (pvt->bridge_ck) - pci_dev_put(pvt->bridge_ck); - - edac_mc_free(mci); - } + pci_dev_put(pvt->dev_d0f0); + pci_dev_put(pvt->dev_d0f1); + pci_dev_put(pvt->bridge_ck); + edac_mc_free(mci); - return rc; + return -ENODEV; } /* returns count (>= 0), or negative on error */ @@ -1015,7 +1050,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; pvt = (struct e752x_pvt *) mci->pvt_info; diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c index a9518d3..5a5ecd5 100644 --- a/drivers/edac/e7xxx_edac.c +++ b/drivers/edac/e7xxx_edac.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -30,6 +29,8 @@ #include <linux/slab.h> #include "edac_mc.h" +#define E7XXX_REVISION " Ver: 2.0.0 " __DATE__ + #define e7xxx_printk(level, fmt, arg...) \ edac_printk(level, "e7xxx", fmt, ##arg) @@ -333,99 +334,61 @@ static void e7xxx_check(struct mem_ctl_info *mci) e7xxx_process_error_info(mci, &info, 1); } -static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) +/* Return 1 if dual channel mode is active. Else return 0. */ +static inline int dual_channel_active(u32 drc, int dev_idx) { - int rc = -ENODEV; - int index; - u16 pci_data; - struct mem_ctl_info *mci = NULL; - struct e7xxx_pvt *pvt = NULL; - u32 drc; - int drc_chan = 1; /* Number of channels 0=1chan,1=2chan */ - int drc_drbg = 1; /* DRB granularity 0=32mb,1=64mb */ - int drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ - u32 dra; - unsigned long last_cumul_size; - struct e7xxx_error_info discard; - - debugf0("%s(): mci\n", __func__); + return (dev_idx == E7501) ? ((drc >> 22) & 0x1) : 1; +} - /* need to find out the number of channels */ - pci_read_config_dword(pdev, E7XXX_DRC, &drc); +/* Return DRB granularity (0=32mb, 1=64mb). */ +static inline int drb_granularity(u32 drc, int dev_idx) +{ /* only e7501 can be single channel */ - if (dev_idx == E7501) { - drc_chan = ((drc >> 22) & 0x1); - drc_drbg = (drc >> 18) & 0x3; - } - - drc_ddim = (drc >> 20) & 0x3; - mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1); - - if (mci == NULL) { - rc = -ENOMEM; - goto fail; - } - - debugf3("%s(): init mci\n", __func__); - mci->mtype_cap = MEM_FLAG_RDDR; - mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | - EDAC_FLAG_S4ECD4ED; - /* FIXME - what if different memory types are in different csrows? */ - mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.5.2.9 $"; - mci->pdev = pdev; + return (dev_idx == E7501) ? ((drc >> 18) & 0x3) : 1; +} - debugf3("%s(): init pvt\n", __func__); - pvt = (struct e7xxx_pvt *) mci->pvt_info; - pvt->dev_info = &e7xxx_devs[dev_idx]; - pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, - pvt->dev_info->err_dev, - pvt->bridge_ck); - if (!pvt->bridge_ck) { - e7xxx_printk(KERN_ERR, "error reporting device not found:" - "vendor %x device 0x%x (broken BIOS?)\n", - PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); - goto fail; - } - - debugf3("%s(): more mci init\n", __func__); - mci->ctl_name = pvt->dev_info->ctl_name; - mci->edac_check = e7xxx_check; - mci->ctl_page_to_phys = ctl_page_to_phys; +static void e7xxx_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, + int dev_idx, u32 drc) +{ + unsigned long last_cumul_size; + int index; + u8 value; + u32 dra, cumul_size; + int drc_chan, drc_drbg, drc_ddim, mem_dev; + struct csrow_info *csrow; - /* find out the device types */ pci_read_config_dword(pdev, E7XXX_DRA, &dra); + drc_chan = dual_channel_active(drc, dev_idx); + drc_drbg = drb_granularity(drc, dev_idx); + drc_ddim = (drc >> 20) & 0x3; + last_cumul_size = 0; - /* - * The dram row boundary (DRB) reg values are boundary address + /* The dram row boundary (DRB) reg values are boundary address * for each DRAM row with a granularity of 32 or 64MB (single/dual * channel operation). DRB regs are cumulative; therefore DRB7 will * contain the total memory contained in all eight rows. */ - for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { - u8 value; - u32 cumul_size; + for (index = 0; index < mci->nr_csrows; index++) { /* mem_dev 0=x8, 1=x4 */ - int mem_dev = (dra >> (index * 4 + 3)) & 0x1; - struct csrow_info *csrow = &mci->csrows[index]; + mem_dev = (dra >> (index * 4 + 3)) & 0x1; + csrow = &mci->csrows[index]; - pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value); + pci_read_config_byte(pdev, E7XXX_DRB + index, &value); /* convert a 64 or 32 MiB DRB to a page size. */ cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, cumul_size); - if (cumul_size == last_cumul_size) - continue; /* not populated */ + continue; /* not populated */ csrow->first_page = last_cumul_size; csrow->last_page = cumul_size - 1; csrow->nr_pages = cumul_size - last_cumul_size; last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ - csrow->mtype = MEM_RDDR; /* only one type supported */ + csrow->grain = 1 << 12; /* 4KiB - resolution of CELOG */ + csrow->mtype = MEM_RDDR; /* only one type supported */ csrow->dtype = mem_dev ? DEV_X4 : DEV_X8; /* @@ -443,16 +406,61 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) } else csrow->edac_mode = EDAC_NONE; } +} - mci->edac_cap |= EDAC_FLAG_NONE; +static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) +{ + u16 pci_data; + struct mem_ctl_info *mci = NULL; + struct e7xxx_pvt *pvt = NULL; + u32 drc; + int drc_chan; + struct e7xxx_error_info discard; + + debugf0("%s(): mci\n", __func__); + pci_read_config_dword(pdev, E7XXX_DRC, &drc); + + drc_chan = dual_channel_active(drc, dev_idx); + mci = edac_mc_alloc(sizeof(*pvt), E7XXX_NR_CSROWS, drc_chan + 1); + + if (mci == NULL) + return -ENOMEM; + + debugf3("%s(): init mci\n", __func__); + mci->mtype_cap = MEM_FLAG_RDDR; + mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED | + EDAC_FLAG_S4ECD4ED; + /* FIXME - what if different memory types are in different csrows? */ + mci->mod_name = EDAC_MOD_STR; + mci->mod_ver = E7XXX_REVISION; + mci->dev = &pdev->dev; + debugf3("%s(): init pvt\n", __func__); + pvt = (struct e7xxx_pvt *) mci->pvt_info; + pvt->dev_info = &e7xxx_devs[dev_idx]; + pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, + pvt->dev_info->err_dev, + pvt->bridge_ck); + if (!pvt->bridge_ck) { + e7xxx_printk(KERN_ERR, "error reporting device not found:" + "vendor %x device 0x%x (broken BIOS?)\n", + PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev); + goto fail0; + } + + debugf3("%s(): more mci init\n", __func__); + mci->ctl_name = pvt->dev_info->ctl_name; + mci->edac_check = e7xxx_check; + mci->ctl_page_to_phys = ctl_page_to_phys; + e7xxx_init_csrows(mci, pdev, dev_idx, drc); + mci->edac_cap |= EDAC_FLAG_NONE; debugf3("%s(): tolm, remapbase, remaplimit\n", __func__); /* load the top of low memory, remap base, and remap limit vars */ - pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data); + pci_read_config_word(pdev, E7XXX_TOLM, &pci_data); pvt->tolm = ((u32) pci_data) << 4; - pci_read_config_word(mci->pdev, E7XXX_REMAPBASE, &pci_data); + pci_read_config_word(pdev, E7XXX_REMAPBASE, &pci_data); pvt->remapbase = ((u32) pci_data) << 14; - pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data); + pci_read_config_word(pdev, E7XXX_REMAPLIMIT, &pci_data); pvt->remaplimit = ((u32) pci_data) << 14; e7xxx_printk(KERN_INFO, "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, @@ -461,23 +469,25 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) /* clear any pending errors, or initial state bits */ e7xxx_get_error_info(mci, &discard); - if (edac_mc_add_mc(mci) != 0) { + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. + */ + if (edac_mc_add_mc(mci,0)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - goto fail; + goto fail1; } /* get this far and it's successful */ debugf3("%s(): success\n", __func__); return 0; -fail: - if (mci != NULL) { - if(pvt != NULL && pvt->bridge_ck) - pci_dev_put(pvt->bridge_ck); - edac_mc_free(mci); - } +fail1: + pci_dev_put(pvt->bridge_ck); + +fail0: + edac_mc_free(mci); - return rc; + return -ENODEV; } /* returns count (>= 0), or negative on error */ @@ -498,7 +508,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; pvt = (struct e7xxx_pvt *) mci->pvt_info; diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index ea06e3a..3a7cfe8 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/kernel.h> @@ -54,16 +53,17 @@ static int log_ce = 1; static int panic_on_ue; static int poll_msec = 1000; -static int check_pci_parity = 0; /* default YES check PCI parity */ -static int panic_on_pci_parity; /* default no panic on PCI Parity */ -static atomic_t pci_parity_count = ATOMIC_INIT(0); - /* lock to memory controller's control array */ static DECLARE_MUTEX(mem_ctls_mutex); static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices); static struct task_struct *edac_thread; +#ifdef CONFIG_PCI +static int check_pci_parity = 0; /* default YES check PCI parity */ +static int panic_on_pci_parity; /* default no panic on PCI Parity */ +static atomic_t pci_parity_count = ATOMIC_INIT(0); + /* Structure of the whitelist and blacklist arrays */ struct edac_pci_device_list { unsigned int vendor; /* Vendor ID */ @@ -80,6 +80,12 @@ static int pci_blacklist_count; static struct edac_pci_device_list pci_whitelist[MAX_LISTED_PCI_DEVICES]; static int pci_whitelist_count ; +#ifndef DISABLE_EDAC_SYSFS +static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ +static struct completion edac_pci_kobj_complete; +#endif /* DISABLE_EDAC_SYSFS */ +#endif /* CONFIG_PCI */ + /* START sysfs data and methods */ #ifndef DISABLE_EDAC_SYSFS @@ -127,18 +133,15 @@ static struct sysdev_class edac_class = { set_kset_name("edac"), }; -/* sysfs objects: +/* sysfs object: * /sys/devices/system/edac/mc - * /sys/devices/system/edac/pci */ static struct kobject edac_memctrl_kobj; -static struct kobject edac_pci_kobj; /* We use these to wait for the reference counts on edac_memctrl_kobj and * edac_pci_kobj to reach 0. */ static struct completion edac_memctrl_kobj_complete; -static struct completion edac_pci_kobj_complete; /* * /sys/devices/system/edac/mc; @@ -324,6 +327,8 @@ static void edac_sysfs_memctrl_teardown(void) #endif /* DISABLE_EDAC_SYSFS */ } +#ifdef CONFIG_PCI + #ifndef DISABLE_EDAC_SYSFS /* @@ -624,6 +629,252 @@ static void edac_sysfs_pci_teardown(void) #endif } + +static u16 get_pci_parity_status(struct pci_dev *dev, int secondary) +{ + int where; + u16 status; + + where = secondary ? PCI_SEC_STATUS : PCI_STATUS; + pci_read_config_word(dev, where, &status); + + /* If we get back 0xFFFF then we must suspect that the card has been + * pulled but the Linux PCI layer has not yet finished cleaning up. + * We don't want to report on such devices + */ + + if (status == 0xFFFF) { + u32 sanity; + + pci_read_config_dword(dev, 0, &sanity); + + if (sanity == 0xFFFFFFFF) + return 0; + } + + status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | + PCI_STATUS_PARITY; + + if (status) + /* reset only the bits we are interested in */ + pci_write_config_word(dev, where, status); + + return status; +} + +typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev); + +/* Clear any PCI parity errors logged by this device. */ +static void edac_pci_dev_parity_clear(struct pci_dev *dev) +{ + u8 header_type; + + get_pci_parity_status(dev, 0); + + /* read the device TYPE, looking for bridges */ + pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); + + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) + get_pci_parity_status(dev, 1); +} + +/* + * PCI Parity polling + * + */ +static void edac_pci_dev_parity_test(struct pci_dev *dev) +{ + u16 status; + u8 header_type; + + /* read the STATUS register on this device + */ + status = get_pci_parity_status(dev, 0); + + debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id ); + + /* check the status reg for errors */ + if (status) { + if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) + edac_printk(KERN_CRIT, EDAC_PCI, + "Signaled System Error on %s\n", + pci_name(dev)); + + if (status & (PCI_STATUS_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, + "Master Data Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + + if (status & (PCI_STATUS_DETECTED_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, + "Detected Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + } + + /* read the device TYPE, looking for bridges */ + pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); + + debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id ); + + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { + /* On bridges, need to examine secondary status register */ + status = get_pci_parity_status(dev, 1); + + debugf2("PCI SEC_STATUS= 0x%04x %s\n", + status, dev->dev.bus_id ); + + /* check the secondary status reg for errors */ + if (status) { + if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Signaled System Error on %s\n", + pci_name(dev)); + + if (status & (PCI_STATUS_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Master Data Parity Error on " + "%s\n", pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + + if (status & (PCI_STATUS_DETECTED_PARITY)) { + edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " + "Detected Parity Error on %s\n", + pci_name(dev)); + + atomic_inc(&pci_parity_count); + } + } + } +} + +/* + * check_dev_on_list: Scan for a PCI device on a white/black list + * @list: an EDAC &edac_pci_device_list white/black list pointer + * @free_index: index of next free entry on the list + * @pci_dev: PCI Device pointer + * + * see if list contains the device. + * + * Returns: 0 not found + * 1 found on list + */ +static int check_dev_on_list(struct edac_pci_device_list *list, + int free_index, struct pci_dev *dev) +{ + int i; + int rc = 0; /* Assume not found */ + unsigned short vendor=dev->vendor; + unsigned short device=dev->device; + + /* Scan the list, looking for a vendor/device match */ + for (i = 0; i < free_index; i++, list++ ) { + if ((list->vendor == vendor ) && (list->device == device )) { + rc = 1; + break; + } + } + + return rc; +} + +/* + * pci_dev parity list iterator + * Scan the PCI device list for one iteration, looking for SERRORs + * Master Parity ERRORS or Parity ERRORs on primary or secondary devices + */ +static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn) +{ + struct pci_dev *dev = NULL; + + /* request for kernel access to the next PCI device, if any, + * and while we are looking at it have its reference count + * bumped until we are done with it + */ + while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + /* if whitelist exists then it has priority, so only scan + * those devices on the whitelist + */ + if (pci_whitelist_count > 0 ) { + if (check_dev_on_list(pci_whitelist, + pci_whitelist_count, dev)) + fn(dev); + } else { + /* + * if no whitelist, then check if this devices is + * blacklisted + */ + if (!check_dev_on_list(pci_blacklist, + pci_blacklist_count, dev)) + fn(dev); + } + } +} + +static void do_pci_parity_check(void) +{ + unsigned long flags; + int before_count; + + debugf3("%s()\n", __func__); + + if (!check_pci_parity) + return; + + before_count = atomic_read(&pci_parity_count); + + /* scan all PCI devices looking for a Parity Error on devices and + * bridges + */ + local_irq_save(flags); + edac_pci_dev_parity_iterator(edac_pci_dev_parity_test); + local_irq_restore(flags); + + /* Only if operator has selected panic on PCI Error */ + if (panic_on_pci_parity) { + /* If the count is different 'after' from 'before' */ + if (before_count != atomic_read(&pci_parity_count)) + panic("EDAC: PCI Parity Error"); + } +} + +static inline void clear_pci_parity_errors(void) +{ + /* Clear any PCI bus parity errors that devices initially have logged + * in their registers. + */ + edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear); +} + +#else /* CONFIG_PCI */ + +static inline void do_pci_parity_check(void) +{ + /* no-op */ +} + +static inline void clear_pci_parity_errors(void) +{ + /* no-op */ +} + +static void edac_sysfs_pci_teardown(void) +{ +} + +static int edac_sysfs_pci_setup(void) +{ + return 0; +} +#endif /* CONFIG_PCI */ + #ifndef DISABLE_EDAC_SYSFS /* EDAC sysfs CSROW data structures and methods */ @@ -1132,7 +1383,7 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) return err; /* create a symlink for the device */ - err = sysfs_create_link(edac_mci_kobj, &mci->pdev->dev.kobj, + err = sysfs_create_link(edac_mci_kobj, &mci->dev->kobj, EDAC_DEVICE_SYMLINK); if (err) @@ -1238,7 +1489,7 @@ void edac_mc_dump_mci(struct mem_ctl_info *mci) debugf4("\tmci->edac_check = %p\n", mci->edac_check); debugf3("\tmci->nr_csrows = %d, csrows = %p\n", mci->nr_csrows, mci->csrows); - debugf3("\tpdev = %p\n", mci->pdev); + debugf3("\tdev = %p\n", mci->dev); debugf3("\tmod_name:ctl_name = %s:%s\n", mci->mod_name, mci->ctl_name); debugf3("\tpvt_info = %p\n\n", mci->pvt_info); @@ -1363,7 +1614,7 @@ void edac_mc_free(struct mem_ctl_info *mci) } EXPORT_SYMBOL_GPL(edac_mc_free); -static struct mem_ctl_info *find_mci_by_pdev(struct pci_dev *pdev) +static struct mem_ctl_info *find_mci_by_dev(struct device *dev) { struct mem_ctl_info *mci; struct list_head *item; @@ -1373,54 +1624,53 @@ static struct mem_ctl_info *find_mci_by_pdev(struct pci_dev *pdev) list_for_each(item, &mc_devices) { mci = list_entry(item, struct mem_ctl_info, link); - if (mci->pdev == pdev) + if (mci->dev == dev) return mci; } return NULL; } -static int add_mc_to_global_list(struct mem_ctl_info *mci) +/* Return 0 on success, 1 on failure. + * Before calling this function, caller must + * assign a unique value to mci->mc_idx. + */ +static int add_mc_to_global_list (struct mem_ctl_info *mci) { struct list_head *item, *insert_before; struct mem_ctl_info *p; - int i; - if (list_empty(&mc_devices)) { - mci->mc_idx = 0; - insert_before = &mc_devices; - } else { - if (find_mci_by_pdev(mci->pdev)) { - edac_printk(KERN_WARNING, EDAC_MC, - "%s (%s) %s %s already assigned %d\n", - mci->pdev->dev.bus_id, - pci_name(mci->pdev), mci->mod_name, - mci->ctl_name, mci->mc_idx); - return 1; - } + insert_before = &mc_devices; - insert_before = NULL; - i = 0; + if (unlikely((p = find_mci_by_dev(mci->dev)) != NULL)) + goto fail0; - list_for_each(item, &mc_devices) { - p = list_entry(item, struct mem_ctl_info, link); + list_for_each(item, &mc_devices) { + p = list_entry(item, struct mem_ctl_info, link); - if (p->mc_idx != i) { - insert_before = item; - break; - } + if (p->mc_idx >= mci->mc_idx) { + if (unlikely(p->mc_idx == mci->mc_idx)) + goto fail1; - i++; + insert_before = item; + break; } - - mci->mc_idx = i; - - if (insert_before == NULL) - insert_before = &mc_devices; } list_add_tail_rcu(&mci->link, insert_before); return 0; + +fail0: + edac_printk(KERN_WARNING, EDAC_MC, + "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, + dev_name(p->dev), p->mod_name, p->ctl_name, p->mc_idx); + return 1; + +fail1: + edac_printk(KERN_WARNING, EDAC_MC, + "bug in low-level driver: attempt to assign\n" + " duplicate mc_idx %d in %s()\n", p->mc_idx, __func__); + return 1; } static void complete_mc_list_del(struct rcu_head *head) @@ -1444,6 +1694,7 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci) * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and * create sysfs entries associated with mci structure * @mci: pointer to the mci structure to be added to the list + * @mc_idx: A unique numeric identifier to be assigned to the 'mci' structure. * * Return: * 0 Success @@ -1451,9 +1702,10 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci) */ /* FIXME - should a warning be printed if no error detection? correction? */ -int edac_mc_add_mc(struct mem_ctl_info *mci) +int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx) { debugf0("%s()\n", __func__); + mci->mc_idx = mc_idx; #ifdef CONFIG_EDAC_DEBUG if (edac_debug_level >= 3) edac_mc_dump_mci(mci); @@ -1486,8 +1738,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) } /* Report action taken */ - edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: PCI %s\n", - mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); + edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n", + mci->mod_name, mci->ctl_name, dev_name(mci->dev)); up(&mem_ctls_mutex); return 0; @@ -1504,18 +1756,18 @@ EXPORT_SYMBOL_GPL(edac_mc_add_mc); /** * edac_mc_del_mc: Remove sysfs entries for specified mci structure and * remove mci structure from global list - * @pdev: Pointer to 'struct pci_dev' representing mci structure to remove. + * @pdev: Pointer to 'struct device' representing mci structure to remove. * * Return pointer to removed mci structure, or NULL if device not found. */ -struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev) +struct mem_ctl_info * edac_mc_del_mc(struct device *dev) { struct mem_ctl_info *mci; debugf0("MC: %s()\n", __func__); down(&mem_ctls_mutex); - if ((mci = find_mci_by_pdev(pdev)) == NULL) { + if ((mci = find_mci_by_dev(dev)) == NULL) { up(&mem_ctls_mutex); return NULL; } @@ -1524,8 +1776,8 @@ struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev) del_mc_from_global_list(mci); up(&mem_ctls_mutex); edac_printk(KERN_INFO, EDAC_MC, - "Removed device %d for %s %s: PCI %s\n", mci->mc_idx, - mci->mod_name, mci->ctl_name, pci_name(mci->pdev)); + "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, + mci->mod_name, mci->ctl_name, dev_name(mci->dev)); return mci; } EXPORT_SYMBOL_GPL(edac_mc_del_mc); @@ -1739,244 +1991,6 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg) } EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info); -#ifdef CONFIG_PCI - -static u16 get_pci_parity_status(struct pci_dev *dev, int secondary) -{ - int where; - u16 status; - - where = secondary ? PCI_SEC_STATUS : PCI_STATUS; - pci_read_config_word(dev, where, &status); - - /* If we get back 0xFFFF then we must suspect that the card has been - * pulled but the Linux PCI layer has not yet finished cleaning up. - * We don't want to report on such devices - */ - - if (status == 0xFFFF) { - u32 sanity; - - pci_read_config_dword(dev, 0, &sanity); - - if (sanity == 0xFFFFFFFF) - return 0; - } - - status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | - PCI_STATUS_PARITY; - - if (status) - /* reset only the bits we are interested in */ - pci_write_config_word(dev, where, status); - - return status; -} - -typedef void (*pci_parity_check_fn_t) (struct pci_dev *dev); - -/* Clear any PCI parity errors logged by this device. */ -static void edac_pci_dev_parity_clear(struct pci_dev *dev) -{ - u8 header_type; - - get_pci_parity_status(dev, 0); - - /* read the device TYPE, looking for bridges */ - pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); - - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) - get_pci_parity_status(dev, 1); -} - -/* - * PCI Parity polling - * - */ -static void edac_pci_dev_parity_test(struct pci_dev *dev) -{ - u16 status; - u8 header_type; - - /* read the STATUS register on this device - */ - status = get_pci_parity_status(dev, 0); - - debugf2("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id ); - - /* check the status reg for errors */ - if (status) { - if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) - edac_printk(KERN_CRIT, EDAC_PCI, - "Signaled System Error on %s\n", - pci_name(dev)); - - if (status & (PCI_STATUS_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, - "Master Data Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - - if (status & (PCI_STATUS_DETECTED_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, - "Detected Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - } - - /* read the device TYPE, looking for bridges */ - pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); - - debugf2("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id ); - - if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { - /* On bridges, need to examine secondary status register */ - status = get_pci_parity_status(dev, 1); - - debugf2("PCI SEC_STATUS= 0x%04x %s\n", - status, dev->dev.bus_id ); - - /* check the secondary status reg for errors */ - if (status) { - if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Signaled System Error on %s\n", - pci_name(dev)); - - if (status & (PCI_STATUS_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Master Data Parity Error on " - "%s\n", pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - - if (status & (PCI_STATUS_DETECTED_PARITY)) { - edac_printk(KERN_CRIT, EDAC_PCI, "Bridge " - "Detected Parity Error on %s\n", - pci_name(dev)); - - atomic_inc(&pci_parity_count); - } - } - } -} - -/* - * check_dev_on_list: Scan for a PCI device on a white/black list - * @list: an EDAC &edac_pci_device_list white/black list pointer - * @free_index: index of next free entry on the list - * @pci_dev: PCI Device pointer - * - * see if list contains the device. - * - * Returns: 0 not found - * 1 found on list - */ -static int check_dev_on_list(struct edac_pci_device_list *list, - int free_index, struct pci_dev *dev) -{ - int i; - int rc = 0; /* Assume not found */ - unsigned short vendor=dev->vendor; - unsigned short device=dev->device; - - /* Scan the list, looking for a vendor/device match */ - for (i = 0; i < free_index; i++, list++ ) { - if ((list->vendor == vendor ) && (list->device == device )) { - rc = 1; - break; - } - } - - return rc; -} - -/* - * pci_dev parity list iterator - * Scan the PCI device list for one iteration, looking for SERRORs - * Master Parity ERRORS or Parity ERRORs on primary or secondary devices - */ -static inline void edac_pci_dev_parity_iterator(pci_parity_check_fn_t fn) -{ - struct pci_dev *dev = NULL; - - /* request for kernel access to the next PCI device, if any, - * and while we are looking at it have its reference count - * bumped until we are done with it - */ - while((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { - /* if whitelist exists then it has priority, so only scan - * those devices on the whitelist - */ - if (pci_whitelist_count > 0 ) { - if (check_dev_on_list(pci_whitelist, - pci_whitelist_count, dev)) - fn(dev); - } else { - /* - * if no whitelist, then check if this devices is - * blacklisted - */ - if (!check_dev_on_list(pci_blacklist, - pci_blacklist_count, dev)) - fn(dev); - } - } -} - -static void do_pci_parity_check(void) -{ - unsigned long flags; - int before_count; - - debugf3("%s()\n", __func__); - - if (!check_pci_parity) - return; - - before_count = atomic_read(&pci_parity_count); - - /* scan all PCI devices looking for a Parity Error on devices and - * bridges - */ - local_irq_save(flags); - edac_pci_dev_parity_iterator(edac_pci_dev_parity_test); - local_irq_restore(flags); - - /* Only if operator has selected panic on PCI Error */ - if (panic_on_pci_parity) { - /* If the count is different 'after' from 'before' */ - if (before_count != atomic_read(&pci_parity_count)) - panic("EDAC: PCI Parity Error"); - } -} - -static inline void clear_pci_parity_errors(void) -{ - /* Clear any PCI bus parity errors that devices initially have logged - * in their registers. - */ - edac_pci_dev_parity_iterator(edac_pci_dev_parity_clear); -} - -#else /* CONFIG_PCI */ - -static inline void do_pci_parity_check(void) -{ - /* no-op */ -} - -static inline void clear_pci_parity_errors(void) -{ - /* no-op */ -} - -#endif /* CONFIG_PCI */ /* * Iterate over all MC instances and check for ECC, et al, errors @@ -2096,10 +2110,12 @@ MODULE_DESCRIPTION("Core library routines for MC reporting"); module_param(panic_on_ue, int, 0644); MODULE_PARM_DESC(panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); +#ifdef CONFIG_PCI module_param(check_pci_parity, int, 0644); MODULE_PARM_DESC(check_pci_parity, "Check for PCI bus parity errors: 0=off 1=on"); module_param(panic_on_pci_parity, int, 0644); MODULE_PARM_DESC(panic_on_pci_parity, "Panic on PCI Bus Parity error: 0=off 1=on"); +#endif module_param(log_ue, int, 0644); MODULE_PARM_DESC(log_ue, "Log uncorrectable error to console: 0=off 1=on"); module_param(log_ce, int, 0644); diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h index 8d9e839..1be4947 100644 --- a/drivers/edac/edac_mc.h +++ b/drivers/edac/edac_mc.h @@ -18,7 +18,6 @@ #ifndef _EDAC_MC_H_ #define _EDAC_MC_H_ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/module.h> @@ -88,6 +87,12 @@ extern int edac_debug_level; #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ PCI_DEVICE_ID_ ## vend ## _ ## dev +#if defined(CONFIG_X86) && defined(CONFIG_PCI) +#define dev_name(dev) pci_name(to_pci_dev(dev)) +#else +#define dev_name(dev) to_platform_device(dev)->name +#endif + /* memory devices */ enum dev_type { DEV_UNKNOWN = 0, @@ -327,10 +332,10 @@ struct mem_ctl_info { struct csrow_info *csrows; /* * FIXME - what about controllers on other busses? - IDs must be - * unique. pdev pointer should be sufficiently unique, but + * unique. dev pointer should be sufficiently unique, but * BUS:SLOT.FUNC numbers may not be unique. */ - struct pci_dev *pdev; + struct device *dev; const char *mod_name; const char *mod_ver; const char *ctl_name; @@ -353,6 +358,8 @@ struct mem_ctl_info { struct completion kobj_complete; }; +#ifdef CONFIG_PCI + /* write all or some bits in a byte-register*/ static inline void pci_write_bits8(struct pci_dev *pdev, int offset, u8 value, u8 mask) @@ -401,14 +408,16 @@ static inline void pci_write_bits32(struct pci_dev *pdev, int offset, pci_write_config_dword(pdev, offset, value); } +#endif /* CONFIG_PCI */ + #ifdef CONFIG_EDAC_DEBUG void edac_mc_dump_channel(struct channel_info *chan); void edac_mc_dump_mci(struct mem_ctl_info *mci); void edac_mc_dump_csrow(struct csrow_info *csrow); #endif /* CONFIG_EDAC_DEBUG */ -extern int edac_mc_add_mc(struct mem_ctl_info *mci); -extern struct mem_ctl_info * edac_mc_del_mc(struct pci_dev *pdev); +extern int edac_mc_add_mc(struct mem_ctl_info *mci,int mc_idx); +extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev); extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page); extern void edac_mc_scrub_block(unsigned long page, unsigned long offset, diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c index fd34216..e30a4a2 100644 --- a/drivers/edac/i82860_edac.c +++ b/drivers/edac/i82860_edac.c @@ -9,7 +9,6 @@ * by Thayne Harbaugh of Linux Networx. (http://lnxi.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -17,6 +16,8 @@ #include <linux/slab.h> #include "edac_mc.h" +#define I82860_REVISION " Ver: 2.0.0 " __DATE__ + #define i82860_printk(level, fmt, arg...) \ edac_printk(level, "i82860", fmt, ##arg) @@ -63,17 +64,21 @@ static struct pci_dev *mci_pdev = NULL; /* init dev: in case that AGP code static void i82860_get_error_info(struct mem_ctl_info *mci, struct i82860_error_info *info) { + struct pci_dev *pdev; + + pdev = to_pci_dev(mci->dev); + /* * This is a mess because there is no atomic way to read all the * registers at once and the registers can transition from CE being * overwritten by UE. */ - pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts); - pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap); - pci_read_config_word(mci->pdev, I82860_DERRCTL_STS, &info->derrsyn); - pci_read_config_word(mci->pdev, I82860_ERRSTS, &info->errsts2); + pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts); + pci_read_config_dword(pdev, I82860_EAP, &info->eap); + pci_read_config_word(pdev, I82860_DERRCTL_STS, &info->derrsyn); + pci_read_config_word(pdev, I82860_ERRSTS, &info->errsts2); - pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003); + pci_write_bits16(pdev, I82860_ERRSTS, 0x0003, 0x0003); /* * If the error is the same for both reads then the first set of reads @@ -84,8 +89,8 @@ static void i82860_get_error_info(struct mem_ctl_info *mci, return; if ((info->errsts ^ info->errsts2) & 0x0003) { - pci_read_config_dword(mci->pdev, I82860_EAP, &info->eap); - pci_read_config_word(mci->pdev, I82860_DERRCTL_STS, + pci_read_config_dword(pdev, I82860_EAP, &info->eap); + pci_read_config_word(pdev, I82860_DERRCTL_STS, &info->derrsyn); } } @@ -127,15 +132,50 @@ static void i82860_check(struct mem_ctl_info *mci) i82860_process_error_info(mci, &info, 1); } -static int i82860_probe1(struct pci_dev *pdev, int dev_idx) +static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev) { - int rc = -ENODEV; - int index; - struct mem_ctl_info *mci = NULL; unsigned long last_cumul_size; - struct i82860_error_info discard; + u16 mchcfg_ddim; /* DRAM Data Integrity Mode 0=none, 2=edac */ + u16 value; + u32 cumul_size; + struct csrow_info *csrow; + int index; + + pci_read_config_word(pdev, I82860_MCHCFG, &mchcfg_ddim); + mchcfg_ddim = mchcfg_ddim & 0x180; + last_cumul_size = 0; + + /* The group row boundary (GRA) reg values are boundary address + * for each DRAM row with a granularity of 16MB. GRA regs are + * cumulative; therefore GRA15 will contain the total memory contained + * in all eight rows. + */ + for (index = 0; index < mci->nr_csrows; index++) { + csrow = &mci->csrows[index]; + pci_read_config_word(pdev, I82860_GBA + index * 2, &value); + cumul_size = (value & I82860_GBA_MASK) << + (I82860_GBA_SHIFT - PAGE_SHIFT); + debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, + cumul_size); - u16 mchcfg_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + if (cumul_size == last_cumul_size) + continue; /* not populated */ + + csrow->first_page = last_cumul_size; + csrow->last_page = cumul_size - 1; + csrow->nr_pages = cumul_size - last_cumul_size; + last_cumul_size = cumul_size; + csrow->grain = 1 << 12; /* I82860_EAP has 4KiB reolution */ + csrow->mtype = MEM_RMBS; + csrow->dtype = DEV_UNKNOWN; + csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE; + } +} + +static int i82860_probe1(struct pci_dev *pdev, int dev_idx) +{ + struct mem_ctl_info *mci; + struct i82860_error_info discard; /* RDRAM has channels but these don't map onto the abstractions that edac uses. @@ -151,67 +191,35 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx) return -ENOMEM; debugf3("%s(): init mci\n", __func__); - mci->pdev = pdev; + mci->dev = &pdev->dev; mci->mtype_cap = MEM_FLAG_DDR; - mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; /* I"m not sure about this but I think that all RDRAM is SECDED */ mci->edac_cap = EDAC_FLAG_SECDED; - /* adjust FLAGS */ - mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.1.2.6 $"; + mci->mod_ver = I82860_REVISION; mci->ctl_name = i82860_devs[dev_idx].ctl_name; mci->edac_check = i82860_check; mci->ctl_page_to_phys = NULL; + i82860_init_csrows(mci, pdev); + i82860_get_error_info(mci, &discard); /* clear counters */ - pci_read_config_word(mci->pdev, I82860_MCHCFG, &mchcfg_ddim); - mchcfg_ddim = mchcfg_ddim & 0x180; - - /* - * The group row boundary (GRA) reg values are boundary address - * for each DRAM row with a granularity of 16MB. GRA regs are - * cumulative; therefore GRA15 will contain the total memory contained - * in all eight rows. + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. */ - for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { - u16 value; - u32 cumul_size; - struct csrow_info *csrow = &mci->csrows[index]; - - pci_read_config_word(mci->pdev, I82860_GBA + index * 2, - &value); - - cumul_size = (value & I82860_GBA_MASK) << - (I82860_GBA_SHIFT - PAGE_SHIFT); - debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, - cumul_size); - - if (cumul_size == last_cumul_size) - continue; /* not populated */ - - csrow->first_page = last_cumul_size; - csrow->last_page = cumul_size - 1; - csrow->nr_pages = cumul_size - last_cumul_size; - last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* I82860_EAP has 4KiB reolution */ - csrow->mtype = MEM_RMBS; - csrow->dtype = DEV_UNKNOWN; - csrow->edac_mode = mchcfg_ddim ? EDAC_SECDED : EDAC_NONE; + if (edac_mc_add_mc(mci,0)) { + debugf3("%s(): failed edac_mc_add_mc()\n", __func__); + goto fail; } - i82860_get_error_info(mci, &discard); /* clear counters */ + /* get this far and it's successful */ + debugf3("%s(): success\n", __func__); - if (edac_mc_add_mc(mci)) { - debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - edac_mc_free(mci); - } else { - /* get this far and it's successful */ - debugf3("%s(): success\n", __func__); - rc = 0; - } + return 0; - return rc; +fail: + edac_mc_free(mci); + return -ENODEV; } /* returns count (>= 0), or negative on error */ @@ -240,7 +248,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; edac_mc_free(mci); diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c index 0aec926..9423ee5 100644 --- a/drivers/edac/i82875p_edac.c +++ b/drivers/edac/i82875p_edac.c @@ -13,7 +13,6 @@ * Note: E7210 appears same as D82875P - zhenyu.z.wang at intel.com */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -21,6 +20,8 @@ #include <linux/slab.h> #include "edac_mc.h" +#define I82875P_REVISION " Ver: 2.0.0 " __DATE__ + #define i82875p_printk(level, fmt, arg...) \ edac_printk(level, "i82875p", fmt, ##arg) @@ -185,18 +186,22 @@ static int i82875p_registered = 1; static void i82875p_get_error_info(struct mem_ctl_info *mci, struct i82875p_error_info *info) { + struct pci_dev *pdev; + + pdev = to_pci_dev(mci->dev); + /* * This is a mess because there is no atomic way to read all the * registers at once and the registers can transition from CE being * overwritten by UE. */ - pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts); - pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); - pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); - pci_read_config_byte(mci->pdev, I82875P_DERRSYN, &info->derrsyn); - pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts2); + pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts); + pci_read_config_dword(pdev, I82875P_EAP, &info->eap); + pci_read_config_byte(pdev, I82875P_DES, &info->des); + pci_read_config_byte(pdev, I82875P_DERRSYN, &info->derrsyn); + pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts2); - pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081); + pci_write_bits16(pdev, I82875P_ERRSTS, 0x0081, 0x0081); /* * If the error is the same then we can for both reads then @@ -208,9 +213,9 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci, return; if ((info->errsts ^ info->errsts2) & 0x0081) { - pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); - pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); - pci_read_config_byte(mci->pdev, I82875P_DERRSYN, + pci_read_config_dword(pdev, I82875P_EAP, &info->eap); + pci_read_config_byte(pdev, I82875P_DES, &info->des); + pci_read_config_byte(pdev, I82875P_DERRSYN, &info->derrsyn); } } @@ -259,116 +264,109 @@ static void i82875p_check(struct mem_ctl_info *mci) extern int pci_proc_attach_device(struct pci_dev *); #endif -static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) +/* Return 0 on success or 1 on failure. */ +static int i82875p_setup_overfl_dev(struct pci_dev *pdev, + struct pci_dev **ovrfl_pdev, void __iomem **ovrfl_window) { - int rc = -ENODEV; - int index; - struct mem_ctl_info *mci = NULL; - struct i82875p_pvt *pvt = NULL; - unsigned long last_cumul_size; - struct pci_dev *ovrfl_pdev; - void __iomem *ovrfl_window = NULL; - u32 drc; - u32 drc_chan; /* Number of channels 0=1chan,1=2chan */ - u32 nr_chans; - u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ - struct i82875p_error_info discard; + struct pci_dev *dev; + void __iomem *window; - debugf0("%s()\n", __func__); - ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); + *ovrfl_pdev = NULL; + *ovrfl_window = NULL; + dev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); - if (!ovrfl_pdev) { - /* - * Intel tells BIOS developers to hide device 6 which + if (dev == NULL) { + /* Intel tells BIOS developers to hide device 6 which * configures the overflow device access containing * the DRBs - this is where we expose device 6. * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm */ pci_write_bits8(pdev, 0xf4, 0x2, 0x2); - ovrfl_pdev = - pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0)); + dev = pci_scan_single_device(pdev->bus, PCI_DEVFN(6, 0)); - if (!ovrfl_pdev) - return -ENODEV; + if (dev == NULL) + return 1; } + *ovrfl_pdev = dev; + #ifdef CONFIG_PROC_FS - if (!ovrfl_pdev->procent && pci_proc_attach_device(ovrfl_pdev)) { - i82875p_printk(KERN_ERR, - "%s(): Failed to attach overflow device\n", __func__); - return -ENODEV; + if ((dev->procent == NULL) && pci_proc_attach_device(dev)) { + i82875p_printk(KERN_ERR, "%s(): Failed to attach overflow " + "device\n", __func__); + return 1; } -#endif - /* CONFIG_PROC_FS */ - if (pci_enable_device(ovrfl_pdev)) { - i82875p_printk(KERN_ERR, - "%s(): Failed to enable overflow device\n", __func__); - return -ENODEV; +#endif /* CONFIG_PROC_FS */ + if (pci_enable_device(dev)) { + i82875p_printk(KERN_ERR, "%s(): Failed to enable overflow " + "device\n", __func__); + return 1; } - if (pci_request_regions(ovrfl_pdev, pci_name(ovrfl_pdev))) { + if (pci_request_regions(dev, pci_name(dev))) { #ifdef CORRECT_BIOS goto fail0; #endif } /* cache is irrelevant for PCI bus reads/writes */ - ovrfl_window = ioremap_nocache(pci_resource_start(ovrfl_pdev, 0), - pci_resource_len(ovrfl_pdev, 0)); + window = ioremap_nocache(pci_resource_start(dev, 0), + pci_resource_len(dev, 0)); - if (!ovrfl_window) { + if (window == NULL) { i82875p_printk(KERN_ERR, "%s(): Failed to ioremap bar6\n", - __func__); + __func__); goto fail1; } - /* need to find out the number of channels */ - drc = readl(ovrfl_window + I82875P_DRC); - drc_chan = ((drc >> 21) & 0x1); - nr_chans = drc_chan + 1; + *ovrfl_window = window; + return 0; - drc_ddim = (drc >> 18) & 0x1; - mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans), - nr_chans); +fail1: + pci_release_regions(dev); - if (!mci) { - rc = -ENOMEM; - goto fail2; - } +#ifdef CORRECT_BIOS +fail0: + pci_disable_device(dev); +#endif + /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */ + return 1; +} - debugf3("%s(): init mci\n", __func__); - mci->pdev = pdev; - mci->mtype_cap = MEM_FLAG_DDR; - mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; - mci->edac_cap = EDAC_FLAG_UNKNOWN; - /* adjust FLAGS */ - mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.5.2.11 $"; - mci->ctl_name = i82875p_devs[dev_idx].ctl_name; - mci->edac_check = i82875p_check; - mci->ctl_page_to_phys = NULL; - debugf3("%s(): init pvt\n", __func__); - pvt = (struct i82875p_pvt *) mci->pvt_info; - pvt->ovrfl_pdev = ovrfl_pdev; - pvt->ovrfl_window = ovrfl_window; +/* Return 1 if dual channel mode is active. Else return 0. */ +static inline int dual_channel_active(u32 drc) +{ + return (drc >> 21) & 0x1; +} - /* - * The dram row boundary (DRB) reg values are boundary address + +static void i82875p_init_csrows(struct mem_ctl_info *mci, + struct pci_dev *pdev, void __iomem *ovrfl_window, u32 drc) +{ + struct csrow_info *csrow; + unsigned long last_cumul_size; + u8 value; + u32 drc_ddim; /* DRAM Data Integrity Mode 0=none,2=edac */ + u32 cumul_size; + int index; + + drc_ddim = (drc >> 18) & 0x1; + last_cumul_size = 0; + + /* The dram row boundary (DRB) reg values are boundary address * for each DRAM row with a granularity of 32 or 64MB (single/dual * channel operation). DRB regs are cumulative; therefore DRB7 will * contain the total memory contained in all eight rows. */ - for (last_cumul_size = index = 0; index < mci->nr_csrows; index++) { - u8 value; - u32 cumul_size; - struct csrow_info *csrow = &mci->csrows[index]; + + for (index = 0; index < mci->nr_csrows; index++) { + csrow = &mci->csrows[index]; value = readb(ovrfl_window + I82875P_DRB + index); cumul_size = value << (I82875P_DRB_SHIFT - PAGE_SHIFT); debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, cumul_size); - if (cumul_size == last_cumul_size) continue; /* not populated */ @@ -376,35 +374,75 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) csrow->last_page = cumul_size - 1; csrow->nr_pages = cumul_size - last_cumul_size; last_cumul_size = cumul_size; - csrow->grain = 1 << 12; /* I82875P_EAP has 4KiB reolution */ + csrow->grain = 1 << 12; /* I82875P_EAP has 4KiB reolution */ csrow->mtype = MEM_DDR; csrow->dtype = DEV_UNKNOWN; csrow->edac_mode = drc_ddim ? EDAC_SECDED : EDAC_NONE; } +} + +static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) +{ + int rc = -ENODEV; + struct mem_ctl_info *mci; + struct i82875p_pvt *pvt; + struct pci_dev *ovrfl_pdev; + void __iomem *ovrfl_window; + u32 drc; + u32 nr_chans; + struct i82875p_error_info discard; + + debugf0("%s()\n", __func__); + ovrfl_pdev = pci_get_device(PCI_VEND_DEV(INTEL, 82875_6), NULL); + + if (i82875p_setup_overfl_dev(pdev, &ovrfl_pdev, &ovrfl_window)) + return -ENODEV; + drc = readl(ovrfl_window + I82875P_DRC); + nr_chans = dual_channel_active(drc) + 1; + mci = edac_mc_alloc(sizeof(*pvt), I82875P_NR_CSROWS(nr_chans), + nr_chans); + + if (!mci) { + rc = -ENOMEM; + goto fail0; + } + debugf3("%s(): init mci\n", __func__); + mci->dev = &pdev->dev; + mci->mtype_cap = MEM_FLAG_DDR; + mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; + mci->edac_cap = EDAC_FLAG_UNKNOWN; + mci->mod_name = EDAC_MOD_STR; + mci->mod_ver = I82875P_REVISION; + mci->ctl_name = i82875p_devs[dev_idx].ctl_name; + mci->edac_check = i82875p_check; + mci->ctl_page_to_phys = NULL; + debugf3("%s(): init pvt\n", __func__); + pvt = (struct i82875p_pvt *) mci->pvt_info; + pvt->ovrfl_pdev = ovrfl_pdev; + pvt->ovrfl_window = ovrfl_window; + i82875p_init_csrows(mci, pdev, ovrfl_window, drc); i82875p_get_error_info(mci, &discard); /* clear counters */ - if (edac_mc_add_mc(mci)) { + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. + */ + if (edac_mc_add_mc(mci,0)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); - goto fail3; + goto fail1; } /* get this far and it's successful */ debugf3("%s(): success\n", __func__); return 0; -fail3: +fail1: edac_mc_free(mci); -fail2: +fail0: iounmap(ovrfl_window); - -fail1: pci_release_regions(ovrfl_pdev); -#ifdef CORRECT_BIOS -fail0: -#endif pci_disable_device(ovrfl_pdev); /* NOTE: the ovrfl proc entry and pci_dev are intentionally left */ return rc; @@ -437,7 +475,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; pvt = (struct i82875p_pvt *) mci->pvt_info; diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c index 2c29faf..a0e248d 100644 --- a/drivers/edac/r82600_edac.c +++ b/drivers/edac/r82600_edac.c @@ -15,7 +15,6 @@ * references to this document given in [] */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> @@ -23,6 +22,8 @@ #include <linux/slab.h> #include "edac_mc.h" +#define R82600_REVISION " Ver: 2.0.0 " __DATE__ + #define r82600_printk(level, fmt, arg...) \ edac_printk(level, "r82600", fmt, ##arg) @@ -134,17 +135,20 @@ static unsigned int disable_hardware_scrub = 0; static void r82600_get_error_info (struct mem_ctl_info *mci, struct r82600_error_info *info) { - pci_read_config_dword(mci->pdev, R82600_EAP, &info->eapr); + struct pci_dev *pdev; + + pdev = to_pci_dev(mci->dev); + pci_read_config_dword(pdev, R82600_EAP, &info->eapr); if (info->eapr & BIT(0)) /* Clear error to allow next error to be reported [p.62] */ - pci_write_bits32(mci->pdev, R82600_EAP, + pci_write_bits32(pdev, R82600_EAP, ((u32) BIT(0) & (u32) BIT(1)), ((u32) BIT(0) & (u32) BIT(1))); if (info->eapr & BIT(1)) /* Clear error to allow next error to be reported [p.62] */ - pci_write_bits32(mci->pdev, R82600_EAP, + pci_write_bits32(pdev, R82600_EAP, ((u32) BIT(0) & (u32) BIT(1)), ((u32) BIT(0) & (u32) BIT(1))); } @@ -200,25 +204,72 @@ static void r82600_check(struct mem_ctl_info *mci) r82600_process_error_info(mci, &info, 1); } -static int r82600_probe1(struct pci_dev *pdev, int dev_idx) +static inline int ecc_enabled(u8 dramcr) +{ + return dramcr & BIT(5); +} + +static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, + u8 dramcr) { - int rc = -ENODEV; + struct csrow_info *csrow; int index; - struct mem_ctl_info *mci = NULL; + u8 drbar; /* SDRAM Row Boundry Address Register */ + u32 row_high_limit, row_high_limit_last; + u32 reg_sdram, ecc_on, row_base; + + ecc_on = ecc_enabled(dramcr); + reg_sdram = dramcr & BIT(4); + row_high_limit_last = 0; + + for (index = 0; index < mci->nr_csrows; index++) { + csrow = &mci->csrows[index]; + + /* find the DRAM Chip Select Base address and mask */ + pci_read_config_byte(pdev, R82600_DRBA + index, &drbar); + + debugf1("%s() Row=%d DRBA = %#0x\n", __func__, index, drbar); + + row_high_limit = ((u32) drbar << 24); +/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ + + debugf1("%s() Row=%d, Boundry Address=%#0x, Last = %#0x\n", + __func__, index, row_high_limit, row_high_limit_last); + + /* Empty row [p.57] */ + if (row_high_limit == row_high_limit_last) + continue; + + row_base = row_high_limit_last; + + csrow->first_page = row_base >> PAGE_SHIFT; + csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1; + csrow->nr_pages = csrow->last_page - csrow->first_page + 1; + /* Error address is top 19 bits - so granularity is * + * 14 bits */ + csrow->grain = 1 << 14; + csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR; + /* FIXME - check that this is unknowable with this chipset */ + csrow->dtype = DEV_UNKNOWN; + + /* Mode is global on 82600 */ + csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE; + row_high_limit_last = row_high_limit; + } +} + +static int r82600_probe1(struct pci_dev *pdev, int dev_idx) +{ + struct mem_ctl_info *mci; u8 dramcr; - u32 ecc_on; - u32 reg_sdram; u32 eapr; u32 scrub_disabled; u32 sdram_refresh_rate; - u32 row_high_limit_last = 0; struct r82600_error_info discard; debugf0("%s()\n", __func__); pci_read_config_byte(pdev, R82600_DRAMC, &dramcr); pci_read_config_dword(pdev, R82600_EAP, &eapr); - ecc_on = dramcr & BIT(5); - reg_sdram = dramcr & BIT(4); scrub_disabled = eapr & BIT(31); sdram_refresh_rate = dramcr & (BIT(0) | BIT(1)); debugf2("%s(): sdram refresh rate = %#0x\n", __func__, @@ -226,13 +277,11 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) debugf2("%s(): DRAMC register = %#0x\n", __func__, dramcr); mci = edac_mc_alloc(0, R82600_NR_CSROWS, R82600_NR_CHANS); - if (mci == NULL) { - rc = -ENOMEM; - goto fail; - } + if (mci == NULL) + return -ENOMEM; debugf0("%s(): mci = %p\n", __func__, mci); - mci->pdev = pdev; + mci->dev = &pdev->dev; mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR; mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; /* FIXME try to work out if the chip leads have been used for COM2 @@ -245,7 +294,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) * is possible. */ mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; - if (ecc_on) { + if (ecc_enabled(dramcr)) { if (scrub_disabled) debugf3("%s(): mci = %p - Scrubbing disabled! EAP: " "%#0x\n", __func__, mci, eapr); @@ -253,53 +302,17 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) mci->edac_cap = EDAC_FLAG_NONE; mci->mod_name = EDAC_MOD_STR; - mci->mod_ver = "$Revision: 1.1.2.6 $"; + mci->mod_ver = R82600_REVISION; mci->ctl_name = "R82600"; mci->edac_check = r82600_check; mci->ctl_page_to_phys = NULL; - - for (index = 0; index < mci->nr_csrows; index++) { - struct csrow_info *csrow = &mci->csrows[index]; - u8 drbar; /* sDram Row Boundry Address Register */ - u32 row_high_limit; - u32 row_base; - - /* find the DRAM Chip Select Base address and mask */ - pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar); - - debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx, - __func__, index, drbar); - - row_high_limit = ((u32) drbar << 24); -/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ - - debugf1("MC%d: %s() Row=%d, Boundry Address=%#0x, Last = " - "%#0x \n", mci->mc_idx, __func__, index, - row_high_limit, row_high_limit_last); - - /* Empty row [p.57] */ - if (row_high_limit == row_high_limit_last) - continue; - - row_base = row_high_limit_last; - csrow->first_page = row_base >> PAGE_SHIFT; - csrow->last_page = (row_high_limit >> PAGE_SHIFT) - 1; - csrow->nr_pages = csrow->last_page - csrow->first_page + 1; - /* Error address is top 19 bits - so granularity is * - * 14 bits */ - csrow->grain = 1 << 14; - csrow->mtype = reg_sdram ? MEM_RDDR : MEM_DDR; - /* FIXME - check that this is unknowable with this chipset */ - csrow->dtype = DEV_UNKNOWN; - - /* Mode is global on 82600 */ - csrow->edac_mode = ecc_on ? EDAC_SECDED : EDAC_NONE; - row_high_limit_last = row_high_limit; - } - + r82600_init_csrows(mci, pdev, dramcr); r82600_get_error_info(mci, &discard); /* clear counters */ - if (edac_mc_add_mc(mci)) { + /* Here we assume that we will never see multiple instances of this + * type of memory controller. The ID is therefore hardcoded to 0. + */ + if (edac_mc_add_mc(mci,0)) { debugf3("%s(): failed edac_mc_add_mc()\n", __func__); goto fail; } @@ -309,17 +322,15 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) if (disable_hardware_scrub) { debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n", __func__); - pci_write_bits32(mci->pdev, R82600_EAP, BIT(31), BIT(31)); + pci_write_bits32(pdev, R82600_EAP, BIT(31), BIT(31)); } debugf3("%s(): success\n", __func__); return 0; fail: - if (mci) - edac_mc_free(mci); - - return rc; + edac_mc_free(mci); + return -ENODEV; } /* returns count (>= 0), or negative on error */ @@ -338,7 +349,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev) debugf0("%s()\n", __func__); - if ((mci = edac_mc_del_mc(pdev)) == NULL) + if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL) return; edac_mc_free(mci); diff --git a/drivers/eisa/virtual_root.c b/drivers/eisa/virtual_root.c index 0f97a0c..9b4fcac 100644 --- a/drivers/eisa/virtual_root.c +++ b/drivers/eisa/virtual_root.c @@ -7,7 +7,6 @@ * This code is released under the GPL version 2. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/eisa.h> diff --git a/drivers/fc4/fc_syms.c b/drivers/fc4/fc_syms.c index ed85dfc..8700a80 100644 --- a/drivers/fc4/fc_syms.c +++ b/drivers/fc4/fc_syms.c @@ -2,7 +2,6 @@ * We should not even be trying to compile this if we are not doing * a module. */ -#include <linux/config.h> #include <linux/module.h> #ifdef CONFIG_MODULES diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index fdb8b04..23b0866 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c @@ -34,7 +34,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/string.h> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 9b7e4d5..8ebce1c03 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -66,7 +66,6 @@ */ #include <linux/capability.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c index c37baf9..c2ad72f 100644 --- a/drivers/firmware/pcdp.c +++ b/drivers/firmware/pcdp.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/acpi.h> #include <linux/console.h> #include <linux/efi.h> diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index a6764ff..9d67320 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c @@ -22,7 +22,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/hwmon-vid.h> diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index e407c74..7576ec9 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c @@ -35,7 +35,6 @@ w83792d 9 7 7 3 0x7a 0x5ca3 yes no */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 8b46ef7..7be1d0a 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -494,8 +494,8 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id err = pci_request_region(dev, SMBBAR, i801_driver.name); if (err) { dev_err(&dev->dev, "Failed to request SMBus region " - "0x%lx-0x%lx\n", i801_smba, - pci_resource_end(dev, SMBBAR)); + "0x%lx-0x%Lx\n", i801_smba, + (unsigned long long)pci_resource_end(dev, SMBBAR)); goto exit; } diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 87fae93..0599bbd 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -28,7 +28,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index d00a02f..aca7e16 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c @@ -26,7 +26,6 @@ * the Free Software Foundation, version 2. */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 2721e4c..de93601 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -13,7 +13,6 @@ * warranty of any kind, whether express or implied. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/sched.h> diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index df786eb..2a0b3be 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -20,7 +20,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index f7d40f8..512b879 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -20,7 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/i2c/busses/scx200_i2c.c b/drivers/i2c/busses/scx200_i2c.c index 27fbfec..cb3ef5a 100644 --- a/drivers/i2c/busses/scx200_i2c.c +++ b/drivers/i2c/busses/scx200_i2c.c @@ -21,7 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index e6f1ab7..b638ac6 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c @@ -21,7 +21,6 @@ #undef DEBUG #undef VERBOSE -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 179b1e0..e27ee12 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c @@ -19,7 +19,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 308897e5..8a1c27f 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -6,7 +6,6 @@ * Please note that this platform does not support 32-bit IDE IO. */ -#include <linux/config.h> #include <linux/string.h> #include <linux/module.h> #include <linux/ioport.h> diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index cd15e62..5797e0b 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c @@ -19,7 +19,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/timer.h> diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c index fb91cb8..1595599 100644 --- a/drivers/ide/h8300/ide-h8300.c +++ b/drivers/ide/h8300/ide-h8300.c @@ -5,7 +5,6 @@ #include <linux/init.h> #include <linux/ide.h> -#include <linux/config.h> #include <asm/io.h> #include <asm/irq.h> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index bfafd48..654d4cd 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -301,7 +301,6 @@ #define IDECD_VERSION "4.61" -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index d0227c3..f712e4c 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -47,7 +47,6 @@ //#define DEBUG -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 783a247..98918fb 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -74,7 +74,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 6862832..6ca3476 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -82,7 +82,6 @@ #define IDEFLOPPY_VERSION "0.99.newide" -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 26ceab1..7dba999 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -24,7 +24,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 32117f0..6571652 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 7ddb118..1feff23 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 0d5038a..c5f71ac 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -33,7 +33,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 84665e2..c12f1b7 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <asm/uaccess.h> diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 4b91101..7067ab9 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -424,7 +424,6 @@ #define IDETAPE_VERSION "1.19" -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index a839b2a..04547eb 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -27,7 +27,6 @@ * request. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 1cdf442..05fbd92 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -130,7 +130,6 @@ #define _IDE_C /* Tell ide.h it's really us */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index fb88711..9c54446 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c @@ -40,7 +40,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 20eb5b8..3b1d33b 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c @@ -7,7 +7,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index 3fac3e9..64d4261 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/interrupt.h> diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index a77fb24..c48e87e 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -39,7 +39,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 602797a..b7e459e 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c @@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link) kfree(link->priv); } /* ide_detach */ -static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) +static void idecs_mmio_fixup(ide_hwif_t *hwif) +{ + default_hwif_mmiops(hwif); + hwif->mmio = 2; + + ide_undecoded_slave(hwif); +} + +static int idecs_register(unsigned long io, unsigned long ctl, + unsigned long irq, struct pcmcia_device *handle, int is_mmio) { hw_regs_t hw; memset(&hw, 0, sizeof(hw)); @@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq hw.irq = irq; hw.chipset = ide_pci; hw.dev = &handle->dev; - return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); + + if(is_mmio) + return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup); + else + return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); +} + +void outb_io(unsigned char value, unsigned long port) { + outb(value, port); +} + +void outb_mem(unsigned char value, unsigned long port) { + writeb(value, (void __iomem *) port); } /*====================================================================== @@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link) } *stk = NULL; cistpl_cftable_entry_t *cfg; int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; - unsigned long io_base, ctl_base; + unsigned long io_base, ctl_base, is_mmio, try_slave; + void (*my_outb)(unsigned char, unsigned long); DEBUG(0, "ide_config(0x%p)\n", link); @@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link) /* Not sure if this is right... look up the current Vcc */ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); - pass = io_base = ctl_base = 0; + pass = io_base = ctl_base = is_mmio = try_slave = 0; tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); @@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link) goto next_entry; io_base = link->io.BasePort1; ctl_base = link->io.BasePort1 + 0x0e; + + if (io->win[0].len >= 0x20) + try_slave = 1; + } else goto next_entry; /* If we've got this far, we're done */ break; } + if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) { + win_req_t req; + memreq_t map; + cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem; + + if (mem->win[0].len < 16) + goto next_entry; + + req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM; + req.Attributes |= WIN_ENABLE; + req.Base = mem->win[0].host_addr; + req.Size = 0; + + req.AccessSpeed = 0; + if (pcmcia_request_window(&link, &req, &link->win) != 0) + goto next_entry; + map.Page = 0; map.CardOffset = mem->win[0].card_addr; + if (pcmcia_map_mem_page(link->win, &map) != 0) + goto next_entry; + + io_base = (unsigned long) ioremap(req.Base, req.Size); + ctl_base = io_base + 0x0e; + is_mmio = 1; + + if (mem->win[0].len >= 0x20) + try_slave = 1; + + break; + } + next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); @@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link) CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); + if(is_mmio) + my_outb = outb_mem; + else + my_outb = outb_io; + /* disable drive interrupts during IDE probe */ - outb(0x02, ctl_base); + my_outb(0x02, ctl_base); /* special setup for KXLC005 card */ if (is_kme) - outb(0x81, ctl_base+1); + my_outb(0x81, ctl_base+1); /* retry registration in case device is still spinning up */ for (hd = -1, i = 0; i < 10; i++) { - hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); + hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio); if (hd >= 0) break; - if (link->io.NumPorts1 == 0x20) { - outb(0x02, ctl_base + 0x10); + if (try_slave) { + my_outb(0x02, ctl_base + 0x10); hd = idecs_register(io_base + 0x10, ctl_base + 0x10, - link->irq.AssignedIRQ, link); + link->irq.AssignedIRQ, link, is_mmio); if (hd >= 0) { io_base += 0x10; ctl_base += 0x10; diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 90cac609..d655da7 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c @@ -11,7 +11,6 @@ * more details. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/interrupt.h> diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 563fab0..d3c3bc2 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c @@ -28,7 +28,6 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index cdbdb2f..6e2c58c 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c @@ -40,7 +40,6 @@ #define REALLY_SLOW_IO /* some systems can safely undef this */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index 3edd706..a7c725f 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -6,7 +6,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/pci.h> #include <linux/delay.h> diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 8b24b4f..351dab2 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 85007cb..2b0ea8b 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c @@ -16,7 +16,6 @@ * the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 900efd1..a574de5 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index 11d035f..61b5f9c 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c @@ -103,7 +103,6 @@ //#define CMD640_DUMP_REGS -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 92b7b15..20c3271 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -14,7 +14,6 @@ * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/pci.h> diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index ea3c52c..079f7c8 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -32,7 +32,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 09269e5..380bb28 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c @@ -14,7 +14,6 @@ * CS5530 documentation available from National Semiconductor. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index 6eb3051..5c5aec2 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -23,7 +23,6 @@ * CS5535 documentation available from AMD */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/ide.h> diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 9f41ecd..120929f 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c @@ -44,7 +44,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/pci.h> diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 7da5502..b46cb04 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -24,7 +24,6 @@ * Non-bootable card or HPT343 :: pcicmd == 0x05 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 940bdd4..e993a51 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -55,7 +55,6 @@ */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c index 9346292..0fc89fa 100644 --- a/drivers/ide/pci/it8172.c +++ b/drivers/ide/pci/it8172.c @@ -28,7 +28,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 38f41b3..7fb3635 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c @@ -62,7 +62,6 @@ * - Move to libata once it grows up */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index fcd5142..d95714b 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c @@ -9,7 +9,6 @@ * Inspired by an earlier effort from David S. Miller <davem@redhat.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 5a8334d..6c097e8 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -14,7 +14,6 @@ * Released under terms of General Public License */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 1e209d8..b46022a 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -28,7 +28,6 @@ * Released under terms of General Public License */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 7fac6f5..50332dd 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -90,7 +90,6 @@ * ICH3 errata #18 - Don't use native mode */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index 778b82a..fc2b549 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c @@ -11,7 +11,6 @@ * Available from National Semiconductor */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index 5100b82..03677bf 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -29,7 +29,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 72dade1..25ceb4a 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -27,7 +27,6 @@ * if neccessary */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 8e9d877..8a6c23a 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -44,7 +44,6 @@ * 962/963. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 900301e..0b4b604 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c @@ -13,7 +13,6 @@ * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 0968f6b..4a1853a 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index f96b568..56d8493 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -27,7 +27,6 @@ * Not publically available. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index fe80295..2a28252 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c @@ -128,7 +128,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 3e677c4..afdaee3 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -26,7 +26,6 @@ * the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index b80c613..0ac9da3 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c @@ -11,7 +11,6 @@ * by Mathew Locke <mattl@mvista.com> */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/kernel.h> diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index e8ef345..ebf961f 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -22,7 +22,6 @@ * big table * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index c11e3b2..eb09452 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -18,7 +18,6 @@ * configuration of all PCI IDE interfaces present in a system. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c index 1017fd7..e2de6fa 100644 --- a/drivers/ieee1394/config_roms.c +++ b/drivers/ieee1394/config_roms.c @@ -9,7 +9,6 @@ * directory of the kernel sources for details. */ -#include <linux/config.h> #include <linux/types.h> #include "csr1212.h" diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 85c2d4c..87532dd 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c @@ -83,7 +83,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/slab.h> diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c index 25b2260..694da82 100644 --- a/drivers/ieee1394/highlevel.c +++ b/drivers/ieee1394/highlevel.c @@ -17,7 +17,6 @@ * */ -#include <linux/config.h> #include <linux/slab.h> #include <linux/list.h> #include <linux/bitops.h> diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index ad49c04..2c66928 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c @@ -10,7 +10,6 @@ * directory of the kernel sources for details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/list.h> diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index 49354de..f43739c 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -20,7 +20,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/string.h> diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 50c71e1..d541b50 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -10,7 +10,6 @@ #include <linux/bitmap.h> #include <linux/kernel.h> -#include <linux/config.h> #include <linux/list.h> #include <linux/slab.h> #include <linux/smp_lock.h> diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 800c8d5..8de81ec 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c @@ -82,7 +82,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/slab.h> diff --git a/drivers/ieee1394/oui2c.sh b/drivers/ieee1394/oui2c.sh index d50dc7a..b9d0e8f 100644 --- a/drivers/ieee1394/oui2c.sh +++ b/drivers/ieee1394/oui2c.sh @@ -3,7 +3,6 @@ cat <<EOF /* Generated file for OUI database */ -#include <linux/config.h> #ifdef CONFIG_IEEE1394_OUI_DB struct oui_list_struct { diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c index e29dfd2..5b48f6a 100644 --- a/drivers/ieee1394/pcilynx.c +++ b/drivers/ieee1394/pcilynx.c @@ -30,7 +30,6 @@ * Enhancements in async and iso send code */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/interrupt.h> diff --git a/drivers/ieee1394/pcilynx.h b/drivers/ieee1394/pcilynx.h index d631aa8..ec27321 100644 --- a/drivers/ieee1394/pcilynx.h +++ b/drivers/ieee1394/pcilynx.h @@ -1,7 +1,6 @@ #ifndef __PCILYNX_H__ #define __PCILYNX_H__ -#include <linux/config.h> #define PCILYNX_DRIVER_NAME "pcilynx" #define PCILYNX_MAJOR 177 diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 1d5ceb7..aaa74f2 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -38,7 +38,6 @@ * but the code needs additional debugging. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/string.h> diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c index 295d0f8..c6e3f02 100644 --- a/drivers/ieee1394/video1394.c +++ b/drivers/ieee1394/video1394.c @@ -28,7 +28,6 @@ * ENOTTY for unsupported ioctl request * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/slab.h> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 450adfe..3f6705f 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3152,6 +3152,7 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv, } if (cm_id_priv->alt_av.ah_attr.dlid) { *qp_attr_mask |= IB_QP_ALT_PATH; + qp_attr->alt_port_num = cm_id_priv->alt_av.port->port_num; qp_attr->alt_ah_attr = cm_id_priv->alt_av.ah_attr; } ret = 0; diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index a908a7b..bdf5d50 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1963,7 +1963,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file, if (!obj) return -ENOMEM; - init_uobj(&obj->uobject, 0, file->ucontext); + init_uobj(&obj->uobject, cmd.user_handle, file->ucontext); down_write(&obj->uobject.mutex); pd = idr_read_pd(cmd.pd_handle, file->ucontext); diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index 63de304..97f142c 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c @@ -31,7 +31,6 @@ */ #include <linux/version.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/mount.h> diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c index 3e72a1f..5e31d0d 100644 --- a/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/drivers/infiniband/hw/ipath/ipath_intr.c @@ -397,7 +397,7 @@ static void handle_errors(struct ipath_devdata *dd, ipath_err_t errs) if ((dd->ipath_maskederrs & ~dd->ipath_ignorederrs) & ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL)) ipath_dev_err(dd, "Disabling error(s) %llx because " - "occuring too frequently (%s)\n", + "occurring too frequently (%s)\n", (unsigned long long) (dd->ipath_maskederrs & ~dd->ipath_ignorederrs), msg); diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index 465fd22..557cde3 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c @@ -34,7 +34,6 @@ * $Id: mthca_main.c 1396 2004-12-28 04:10:27Z roland $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c index f4fddd5..91934f2 100644 --- a/drivers/infiniband/hw/mthca/mthca_reset.c +++ b/drivers/infiniband/hw/mthca/mthca_reset.c @@ -32,7 +32,6 @@ * $Id: mthca_reset.c 1349 2004-12-16 21:09:43Z roland $ */ -#include <linux/config.h> #include <linux/init.h> #include <linux/errno.h> #include <linux/pci.h> diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 491d2af..3f89f5e1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -42,7 +42,6 @@ #include <linux/netdevice.h> #include <linux/workqueue.h> #include <linux/pci.h> -#include <linux/config.h> #include <linux/kref.h> #include <linux/if_infiniband.h> #include <linux/mutex.h> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 4c3f2de..b2c033e 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -54,7 +54,6 @@ #include <linux/blkdev.h> #include <linux/init.h> #include <linux/ioctl.h> -#include <linux/devfs_fs_kernel.h> #include <linux/cdev.h> #include <linux/in.h> #include <linux/net.h> diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c index 462f8d3..9793ac3 100644 --- a/drivers/input/gameport/emu10k1-gp.c +++ b/drivers/input/gameport/emu10k1-gp.c @@ -32,7 +32,6 @@ #include <linux/module.h> #include <linux/ioport.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/gameport.h> #include <linux/slab.h> diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index 3e2d28f..f68dbe6 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c @@ -33,7 +33,6 @@ #include <linux/module.h> #include <linux/ioport.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/gameport.h> diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index 01dc0b1..e9a02db 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -28,7 +28,6 @@ * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h index 668f245..e9924d6 100644 --- a/drivers/input/joystick/iforce/iforce.h +++ b/drivers/input/joystick/iforce/iforce.h @@ -35,7 +35,6 @@ #include <linux/spinlock.h> #include <linux/usb.h> #include <linux/serio.h> -#include <linux/config.h> #include <linux/circ_buf.h> #include <linux/mutex.h> diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 33edd03..d22c7c6 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -18,7 +18,6 @@ #include <linux/pci_ids.h> #include <linux/ioport.h> #include <linux/module.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/input.h> #include <linux/init.h> diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index 2c51088..83906f8 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -25,7 +25,6 @@ * */ -#include <linux/config.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index 42c11fb..106c94f 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c @@ -4,7 +4,6 @@ * Copyright (c) 2002 Vojtech Pavlik * Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net) */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c index afc66f5..50f1fed 100644 --- a/drivers/input/mouse/inport.c +++ b/drivers/input/mouse/inport.c @@ -36,7 +36,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index a897424..0023501 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c @@ -33,7 +33,6 @@ #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/input.h> -#include <linux/config.h> #include <linux/serio.h> #include <linux/init.h> diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 7b85bc2..47edcfd 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c @@ -81,7 +81,6 @@ #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/input.h> -#include <linux/config.h> #include <linux/serio.h> #include <linux/init.h> diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index eb721b1..1f851ac 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -19,7 +19,6 @@ #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/input.h> -#include <linux/config.h> #include <linux/smp_lock.h> #include <linux/random.h> #include <linux/major.h> diff --git a/drivers/input/power.c b/drivers/input/power.c index 526e607..51a519e 100644 --- a/drivers/input/power.c +++ b/drivers/input/power.c @@ -28,7 +28,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/input.h> #include <linux/slab.h> #include <linux/init.h> diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 1ac739e..bc6e87a 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c @@ -31,7 +31,6 @@ #include <linux/delay.h> #include <linux/module.h> #include <linux/ioport.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/serio.h> diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index c0b1e4b..22d02d5 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -22,7 +22,6 @@ * was usable/enabled ?) */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/serio.h> diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h index 6d66351..7d9fafe 100644 --- a/drivers/input/serio/i8042-sparcio.h +++ b/drivers/input/serio/i8042-sparcio.h @@ -1,13 +1,10 @@ #ifndef _I8042_SPARCIO_H #define _I8042_SPARCIO_H -#include <linux/config.h> #include <asm/io.h> - -#ifdef CONFIG_PCI #include <asm/oplib.h> -#include <asm/ebus.h> -#endif +#include <asm/prom.h> +#include <asm/of_device.h> static int i8042_kbd_irq = -1; static int i8042_aux_irq = -1; @@ -48,54 +45,83 @@ static inline void i8042_write_command(int val) #define OBP_PS2MS_NAME1 "kdmouse" #define OBP_PS2MS_NAME2 "mouse" +static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_device_id *match) +{ + struct device_node *dp = op->node; + + dp = dp->child; + while (dp) { + if (!strcmp(dp->name, OBP_PS2KBD_NAME1) || + !strcmp(dp->name, OBP_PS2KBD_NAME2)) { + struct of_device *kbd = of_find_device_by_node(dp); + unsigned int irq = kbd->irqs[0]; + if (irq == 0xffffffff) + irq = op->irqs[0]; + i8042_kbd_irq = irq; + kbd_iobase = of_ioremap(&kbd->resource[0], + 0, 8, "kbd"); + } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || + !strcmp(dp->name, OBP_PS2MS_NAME2)) { + struct of_device *ms = of_find_device_by_node(dp); + unsigned int irq = ms->irqs[0]; + if (irq == 0xffffffff) + irq = op->irqs[0]; + i8042_aux_irq = irq; + } + + dp = dp->sibling; + } + + return 0; +} + +static int __devexit sparc_i8042_remove(struct of_device *op) +{ + of_iounmap(kbd_iobase, 8); + + return 0; +} + +static struct of_device_id sparc_i8042_match[] = { + { + .name = "8042", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, i8042_match); + +static struct of_platform_driver sparc_i8042_driver = { + .name = "i8042", + .match_table = sparc_i8042_match, + .probe = sparc_i8042_probe, + .remove = __devexit_p(sparc_i8042_remove), +}; + static int __init i8042_platform_init(void) { #ifndef CONFIG_PCI return -ENODEV; #else - char prop[128]; - int len; + struct device_node *root = of_find_node_by_path("/"); - len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop)); - if (len < 0) { - printk("i8042: Cannot get name property of root OBP node.\n"); - return -ENODEV; - } - if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) { + if (!strcmp(root->name, "SUNW,JavaStation-1")) { /* Hardcoded values for MrCoffee. */ i8042_kbd_irq = i8042_aux_irq = 13 | 0x20; kbd_iobase = ioremap(0x71300060, 8); if (!kbd_iobase) return -ENODEV; } else { - struct linux_ebus *ebus; - struct linux_ebus_device *edev; - struct linux_ebus_child *child; - - for_each_ebus(ebus) { - for_each_ebusdev(edev, ebus) { - if (!strcmp(edev->prom_node->name, "8042")) - goto edev_found; - } - } - return -ENODEV; - - edev_found: - for_each_edevchild(edev, child) { - if (!strcmp(child->prom_node->name, OBP_PS2KBD_NAME1) || - !strcmp(child->prom_node->name, OBP_PS2KBD_NAME2)) { - i8042_kbd_irq = child->irqs[0]; - kbd_iobase = - ioremap(child->resource[0].start, 8); - } - if (!strcmp(child->prom_node->name, OBP_PS2MS_NAME1) || - !strcmp(child->prom_node->name, OBP_PS2MS_NAME2)) - i8042_aux_irq = child->irqs[0]; - } + int err = of_register_driver(&sparc_i8042_driver, + &of_bus_type); + if (err) + return err; + if (i8042_kbd_irq == -1 || i8042_aux_irq == -1) { - printk("i8042: Error, 8042 device lacks both kbd and " - "mouse nodes.\n"); + if (kbd_iobase) { + of_iounmap(kbd_iobase, 8); + kbd_iobase = (void __iomem *) NULL; + } return -ENODEV; } } @@ -109,7 +135,10 @@ static int __init i8042_platform_init(void) static inline void i8042_platform_exit(void) { #ifdef CONFIG_PCI - iounmap(kbd_iobase); + struct device_node *root = of_find_node_by_path("/"); + + if (strcmp(root->name, "SUNW,JavaStation-1")) + of_unregister_driver(&sparc_i8042_driver); #endif } diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index a7d91d5..7fa4bc2 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -15,7 +15,6 @@ #include <linux/moduleparam.h> #include <linux/interrupt.h> #include <linux/ioport.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/serio.h> #include <linux/err.h> diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h index cbbf384..af526ab 100644 --- a/drivers/input/serio/i8042.h +++ b/drivers/input/serio/i8042.h @@ -1,7 +1,6 @@ #ifndef _I8042_H #define _I8042_H -#include <linux/config.h> /* * Copyright (c) 1999-2002 Vojtech Pavlik diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c index 5f9ecad..00e3929 100644 --- a/drivers/input/tsdev.c +++ b/drivers/input/tsdev.c @@ -48,7 +48,6 @@ #include <linux/init.h> #include <linux/input.h> #include <linux/major.h> -#include <linux/config.h> #include <linux/smp_lock.h> #include <linux/random.h> #include <linux/time.h> diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index a518ec5..669f763 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c index e7cf6bc..c1b2155 100644 --- a/drivers/isdn/capi/capiutil.c +++ b/drivers/isdn/capi/capiutil.c @@ -17,7 +17,6 @@ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/isdn/capiutil.h> /* from CAPI2.0 DDK AVM Berlin GmbH */ diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 1b37d86..399b316 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/poll.h> #include <linux/smp_lock.h> diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index 1ca3bfd..884bd72 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h @@ -16,7 +16,6 @@ #ifndef GIGASET_H #define GIGASET_H -#include <linux/config.h> #include <linux/kernel.h> #include <linux/compiler.h> #include <linux/types.h> diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 4d64e5cb..a4beeb4 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> diff --git a/drivers/isdn/hardware/avm/b1pci.c b/drivers/isdn/hardware/avm/b1pci.c index 5435a6c..7edf19b 100644 --- a/drivers/isdn/hardware/avm/b1pci.c +++ b/drivers/isdn/hardware/avm/b1pci.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index f7253b2..e7924a5 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> diff --git a/drivers/isdn/hardware/avm/t1pci.c b/drivers/isdn/hardware/avm/t1pci.c index 2ceec8e..af85511 100644 --- a/drivers/isdn/hardware/avm/t1pci.c +++ b/drivers/isdn/hardware/avm/t1pci.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> diff --git a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c index 8fe4f3f..7a74ed3 100644 --- a/drivers/isdn/hardware/eicon/capimain.c +++ b/drivers/isdn/hardware/eicon/capimain.c @@ -10,7 +10,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <asm/uaccess.h> diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c index 27204f4..14298b8 100644 --- a/drivers/isdn/hardware/eicon/diva_didd.c +++ b/drivers/isdn/hardware/eicon/diva_didd.c @@ -11,7 +11,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c index b163c59..77155d9 100644 --- a/drivers/isdn/hardware/eicon/divamnt.c +++ b/drivers/isdn/hardware/eicon/divamnt.c @@ -10,7 +10,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c index 6e7d89a..fff0d89 100644 --- a/drivers/isdn/hardware/eicon/divasi.c +++ b/drivers/isdn/hardware/eicon/divasi.c @@ -10,7 +10,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index 9dee6a3..b05e35f 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c @@ -9,7 +9,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c index c12efa6..6a4373a 100644 --- a/drivers/isdn/hardware/eicon/divasproc.c +++ b/drivers/isdn/hardware/eicon/divasproc.c @@ -10,7 +10,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/poll.h> diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h index 12b8ff2..a66836c 100644 --- a/drivers/isdn/hardware/eicon/platform.h +++ b/drivers/isdn/hardware/eicon/platform.h @@ -18,7 +18,6 @@ #define DIVA_BUILD "local" #endif -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index 4abe5ff..93f3a53 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c index dcb308a..de28cb5 100644 --- a/drivers/isdn/hisax/bkm_a4t.c +++ b/drivers/isdn/hisax/bkm_a4t.c @@ -11,7 +11,6 @@ */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c index 5f21b82..9d1abfb 100644 --- a/drivers/isdn/hisax/bkm_a8.c +++ b/drivers/isdn/hisax/bkm_a8.c @@ -11,7 +11,6 @@ */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 2733250..5333be5 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -17,7 +17,6 @@ #include <linux/types.h> #include <linux/stddef.h> #include <linux/timer.h> -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include <linux/module.h> diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index b0ff1cc..fbb9d02 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -16,7 +16,6 @@ */ #include <linux/init.h> -#include <linux/config.h> #include "hisax.h" #include "isac.h" #include "hscx.h" diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index f8ca4b3..7a5cdb1 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -19,7 +19,6 @@ */ #include <linux/init.h> -#include <linux/config.h> #include "hisax.h" #include "arcofi.h" #include "isac.h" diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index 898ec09..0279fb3 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c @@ -7,7 +7,6 @@ * */ -#include <linux/config.h> #include <linux/serial.h> #include <linux/serial_reg.h> diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c index 3341cf1..5f48761 100644 --- a/drivers/isdn/hisax/enternow_pci.c +++ b/drivers/isdn/hisax/enternow_pci.c @@ -60,7 +60,6 @@ */ -#include <linux/config.h> #include "hisax.h" #include "isac.h" #include "isdnl1.h" diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c index 60b04c6..82a1d2e 100644 --- a/drivers/isdn/hisax/gazel.c +++ b/drivers/isdn/hisax/gazel.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index e3866b0..913fd27 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c @@ -22,7 +22,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/pci.h> #include <linux/interrupt.h> #include <linux/delay.h> diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 3622720..fa96157 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -16,7 +16,6 @@ */ #include <linux/init.h> -#include <linux/config.h> #include "hisax.h" #include "hfc_pci.h" #include "isdnl1.h" diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 262c441..b5e571a 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -32,7 +32,6 @@ #include <linux/types.h> #include <linux/stddef.h> #include <linux/timer.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel_stat.h> diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 11fe537..75920aa0 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -6,7 +6,6 @@ * of the GNU General Public License, incorporated herein by reference. * */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/fs.h> #include <linux/major.h> diff --git a/drivers/isdn/hisax/hisax_debug.h b/drivers/isdn/hisax/hisax_debug.h index ba518a7..ceafecd 100644 --- a/drivers/isdn/hisax/hisax_debug.h +++ b/drivers/isdn/hisax/hisax_debug.h @@ -22,7 +22,6 @@ #ifndef __HISAX_DEBUG_H__ #define __HISAX_DEBUG_H__ -#include <linux/config.h> #ifdef CONFIG_HISAX_DEBUG diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c index 2e9afae..df5fc92 100644 --- a/drivers/isdn/hisax/ipacx.c +++ b/drivers/isdn/hisax/ipacx.c @@ -10,7 +10,6 @@ * */ #include <linux/kernel.h> -#include <linux/config.h> #include <linux/init.h> #include "hisax_if.h" #include "hisax.h" diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c index c9917cd..281fa27 100644 --- a/drivers/isdn/hisax/isdnl3.c +++ b/drivers/isdn/hisax/isdnl3.c @@ -18,7 +18,6 @@ #include <linux/init.h> #include "hisax.h" #include "isdnl3.h" -#include <linux/config.h> const char *l3_revision = "$Revision: 2.22.2.3 $"; diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index e96845c..99feae8 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c @@ -23,7 +23,6 @@ #include "isdnl3.h" #include "l3dss1.h" #include <linux/ctype.h> -#include <linux/config.h> extern char *HiSax_getrev(const char *revision); static const char *dss1_revision = "$Revision: 2.32.2.3 $"; diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c index 68a2159..868762c 100644 --- a/drivers/isdn/hisax/niccy.c +++ b/drivers/isdn/hisax/niccy.c @@ -14,7 +14,6 @@ */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/nj_s.c b/drivers/isdn/hisax/nj_s.c index a7d3cd3..1b3ac46 100644 --- a/drivers/isdn/hisax/nj_s.c +++ b/drivers/isdn/hisax/nj_s.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "isac.h" diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c index 1ae7cac..7a6010e 100644 --- a/drivers/isdn/hisax/nj_u.c +++ b/drivers/isdn/hisax/nj_u.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "icc.h" diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index 8c044a6..11ea456 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -39,7 +39,6 @@ */ #include <linux/init.h> -#include <linux/config.h> #include "hisax.h" #include "isac.h" #include "ipac.h" diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h index 9ffaae7..04416ba 100644 --- a/drivers/isdn/hisax/st5481.h +++ b/drivers/isdn/hisax/st5481.h @@ -13,7 +13,6 @@ #ifndef _ST5481_H_ #define _ST5481_H_ -#include <linux/config.h> // USB IDs, the Product Id is in the range 0x4810-0x481F diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c index 99cb0f3..2716aa5 100644 --- a/drivers/isdn/hisax/st5481_init.c +++ b/drivers/isdn/hisax/st5481_init.c @@ -24,7 +24,6 @@ * clean up debug */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/usb.h> diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c index e82ab22..a1bb73e 100644 --- a/drivers/isdn/hisax/telespci.c +++ b/drivers/isdn/hisax/telespci.c @@ -13,7 +13,6 @@ */ #include <linux/init.h> -#include <linux/config.h> #include "hisax.h" #include "isac.h" #include "hscx.h" diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index 0352ee5..00e4fa2 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -10,7 +10,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include "hisax.h" #include "w6692.h" diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c index 48d134b..89fd531 100644 --- a/drivers/isdn/hysdn/boardergo.c +++ b/drivers/isdn/hysdn/boardergo.c @@ -14,7 +14,6 @@ * */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/signal.h> #include <linux/kernel.h> diff --git a/drivers/isdn/hysdn/hysdn_defs.h b/drivers/isdn/hysdn/hysdn_defs.h index 3a9b29b..461e831 100644 --- a/drivers/isdn/hysdn/hysdn_defs.h +++ b/drivers/isdn/hysdn/hysdn_defs.h @@ -14,7 +14,6 @@ #ifndef HYSDN_DEFS_H #define HYSDN_DEFS_H -#include <linux/config.h> #include <linux/hysdn_if.h> #include <linux/interrupt.h> #include <linux/workqueue.h> diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c index b75ac5a..b702ed27 100644 --- a/drivers/isdn/hysdn/hysdn_init.c +++ b/drivers/isdn/hysdn/hysdn_init.c @@ -10,7 +10,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/poll.h> diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index 1330329..1c0d54a 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/signal.h> #include <linux/kernel.h> diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index eb21063..9f6c637 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/poll.h> diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 96c115e..43da8ae 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -22,7 +22,6 @@ * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt */ -#include <linux/config.h> #include <linux/isdn.h> #include <net/arp.h> #include <net/dst.h> diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 9187422..29e7667 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/isdn.h> #include <linux/poll.h> #include <linux/ppp-comp.h> diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 0a53a99..9ab66e8 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -11,7 +11,6 @@ */ #undef ISDN_TTY_STAT_DEBUG -#include <linux/config.h> #include <linux/isdn.h> #include <linux/delay.h> #include "isdn_common.h" diff --git a/drivers/isdn/i4l/isdn_tty.h b/drivers/isdn/i4l/isdn_tty.h index 9f0fa95..692c74d 100644 --- a/drivers/isdn/i4l/isdn_tty.h +++ b/drivers/isdn/i4l/isdn_tty.h @@ -10,7 +10,6 @@ * */ -#include <linux/config.h> #define DLE 0x10 #define ETX 0x03 diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index a67d31a..fabbd46 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/init.h> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index c75d0ef..d424b44 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -9,7 +9,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 1b1ce65..47f0ff1 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/leds/leds-corgi.c b/drivers/leds/leds-corgi.c index bb7d84d..cf1dcd7 100644 --- a/drivers/leds/leds-corgi.c +++ b/drivers/leds/leds-corgi.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/leds/leds-ixp4xx-gpio.c b/drivers/leds/leds-ixp4xx-gpio.c index 30ced15..7dcf0b9 100644 --- a/drivers/leds/leds-ixp4xx-gpio.c +++ b/drivers/leds/leds-ixp4xx-gpio.c @@ -31,7 +31,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/leds/leds-locomo.c b/drivers/leds/leds-locomo.c index 8419e29..3b87951 100644 --- a/drivers/leds/leds-locomo.c +++ b/drivers/leds/leds-locomo.c @@ -8,7 +8,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/device.h> diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c index 650cf72..fb1edc1 100644 --- a/drivers/leds/leds-s3c24xx.c +++ b/drivers/leds/leds-s3c24xx.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/leds/leds-spitz.c b/drivers/leds/leds-spitz.c index 65bbef4..126d09c 100644 --- a/drivers/leds/leds-spitz.c +++ b/drivers/leds/leds-spitz.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/leds/leds-tosa.c b/drivers/leds/leds-tosa.c index c9e8cc1..fb2416a 100644 --- a/drivers/leds/leds-tosa.c +++ b/drivers/leds/leds-tosa.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c index fbf141e..179c287 100644 --- a/drivers/leds/ledtrig-timer.c +++ b/drivers/leds/ledtrig-timer.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 9f1a049..360f93f 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -16,7 +16,6 @@ * - move bus probe to a kernel thread */ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index cbfbbe2..545be1e 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c @@ -34,7 +34,6 @@ * Move to syfs */ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/init.h> diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c index e5a2bbf..1293876 100644 --- a/drivers/macintosh/apm_emu.c +++ b/drivers/macintosh/apm_emu.c @@ -18,7 +18,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/poll.h> diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index a666361..6b129ee 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -8,7 +8,6 @@ * This file will soon be removed in favor of an uinput userspace tool. */ -#include <linux/config.h> #include <linux/init.h> #include <linux/proc_fs.h> #include <linux/sysctl.h> diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index c687ac7..d832e10 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -17,7 +17,6 @@ * sub-devices. */ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index 7f7d4ea..cae24a1 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/stat.h> #include <asm/macio.h> diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 53c1c79..0acf2f7 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -10,7 +10,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index f4516ca..0301305 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -19,7 +19,6 @@ * the userland interface */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/device.h> diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 5282fec..7f86478 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 231146f..c1fe0b3 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c @@ -97,7 +97,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/macintosh/therm_pm72.h b/drivers/macintosh/therm_pm72.h index c17e61f..fc7e9b7 100644 --- a/drivers/macintosh/therm_pm72.h +++ b/drivers/macintosh/therm_pm72.h @@ -93,7 +93,7 @@ static char * critical_overtemp_path = "/sbin/critical_overtemp"; * 0. This appear to be safe enough for this first version * of the driver, though I would accept any clean patch * doing a better use of the device-tree without turning the - * while i2c registration mecanism into a racy mess + * while i2c registration mechanism into a racy mess * * Note: Xserve changed this. We have some bits on the K2 bus, * which I arbitrarily set to 0x200. Ultimately, we really want diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 3d9dd2e..c7d1c29 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 2d9d791..6501db5 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -9,7 +9,6 @@ * Copyright (C) 1996 Paul Mackerras. */ #include <stdarg.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 1ab4f16c..c1193d3 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -21,7 +21,6 @@ * */ #include <stdarg.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 81337cd..900aade 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index ebbd2d8..ecc5676 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -20,7 +20,6 @@ #include <linux/errno.h> #include <linux/slab.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/timer.h> #include <linux/sched.h> #include <linux/list.h> diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 8eea0ddb..1d0fafd 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -7,7 +7,6 @@ */ #include <linux/blkdev.h> -#include <linux/config.h> #include <linux/ctype.h> #include <linux/device-mapper.h> #include <linux/fs.h> diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c index 73ab875..f1db6ef 100644 --- a/drivers/md/kcopyd.c +++ b/drivers/md/kcopyd.c @@ -12,7 +12,6 @@ #include <asm/atomic.h> #include <linux/blkdev.h> -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/list.h> diff --git a/drivers/md/md.c b/drivers/md/md.c index 2ec1b35..2fe32c2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -33,7 +33,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kthread.h> #include <linux/linkage.h> #include <linux/raid/md.h> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 837ec4e..7433871 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -19,7 +19,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/highmem.h> diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c index 2092e6c..d290572 100644 --- a/drivers/media/common/saa7146_hlp.c +++ b/drivers/media/common/saa7146_hlp.c @@ -158,7 +158,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, } /* the horizontal scaling increment controls the UV filter - to reduce the bandwith to improve the display quality, + to reduce the bandwidth to improve the display quality, so set it ... */ if ( xsci == 0x400) pfuv = 0x00; diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h index b3dd060..5a6c4fe 100644 --- a/drivers/media/dvb/b2c2/flexcop-common.h +++ b/drivers/media/dvb/b2c2/flexcop-common.h @@ -8,7 +8,6 @@ #ifndef __FLEXCOP_COMMON_H__ #define __FLEXCOP_COMMON_H__ -#include <linux/config.h> #include <linux/pci.h> #include <linux/mutex.h> diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index 1b89536..001c71b 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/slab.h> diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 5e8bb41a..59ac35d 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -570,7 +570,8 @@ static int dvb_frontend_thread(void *data) dvb_frontend_add_event(fe, s); fepriv->status = s; } - } + } else + dvb_frontend_swzigzag(fe); } else dvb_frontend_swzigzag(fe); } @@ -975,6 +976,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, case FE_SET_FRONTEND_TUNE_MODE: fepriv->tune_mode_flags = (unsigned long) parg; + err = 0; break; }; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 4cf9f89..97f8ea9 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -8,7 +8,6 @@ #ifndef __DVB_USB_H__ #define __DVB_USB_H__ -#include <linux/config.h> #include <linux/input.h> #include <linux/usb.h> #include <linux/firmware.h> diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c index 3c7c09a..13ad1bf 100644 --- a/drivers/media/dvb/frontends/cx22700.c +++ b/drivers/media/dvb/frontends/cx22700.c @@ -134,6 +134,7 @@ static int cx22700_set_tps (struct cx22700_state *state, struct dvb_ofdm_paramet return -EINVAL; if (p->code_rate_LP < FEC_1_2 || p->code_rate_LP > FEC_7_8) + return -EINVAL; if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5) return -EINVAL; diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index f2f795c..274a87b 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c @@ -670,10 +670,10 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage switch (voltage) { case SEC_VOLTAGE_13: dprintk("%s: setting voltage 13V\n", __FUNCTION__); - return cx24123_writereg(state, 0x29, val | 0x80); + return cx24123_writereg(state, 0x29, val & 0x7f); case SEC_VOLTAGE_18: dprintk("%s: setting voltage 18V\n", __FUNCTION__); - return cx24123_writereg(state, 0x29, val & 0x7f); + return cx24123_writereg(state, 0x29, val | 0x80); default: return -EINVAL; }; diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c index 7c6dc7e..5302e11 100644 --- a/drivers/media/dvb/frontends/dib3000mb.c +++ b/drivers/media/dvb/frontends/dib3000mb.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index 6c3be25..98673474 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c @@ -20,7 +20,6 @@ * see Documentation/dvb/README.dibusb for more information * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index 6e8ad17..9a35470 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c @@ -216,7 +216,7 @@ static int lgdt330x_init(struct dvb_frontend* fe) AGC_DELAY0, 0x07, AGC_DELAY2, 0xfe, /* Change the value of IAGCBW[15:8] - of inner AGC loop filter bandwith */ + of inner AGC loop filter bandwidth */ AGC_LOOP_BANDWIDTH0, 0x08, AGC_LOOP_BANDWIDTH1, 0x9a }; diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index e83ff21..9cbd164 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c @@ -21,7 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 6bffe85..9b57576 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c @@ -18,7 +18,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 7a5c99c..500f15c 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c @@ -30,7 +30,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kmod.h> #include <linux/delay.h> diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 6163cb0..5f111d4 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -1141,6 +1141,15 @@ static void frontend_init(struct budget_av *budget_av) break; case SUBID_DVBC_KNC1: + budget_av->reinitialise_demod = 1; + fe = tda10021_attach(&philips_cu1216_config, + &budget_av->budget.i2c_adap, + read_pwm(budget_av)); + if (fe) { + fe->ops.tuner_ops.set_params = philips_cu1216_tuner_set_params; + } + break; + case SUBID_DVBC_KNC1_PLUS: case SUBID_DVBC_CINERGY1200: budget_av->reinitialise_demod = 1; @@ -1293,11 +1302,7 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio budget_av->budget.dvb_adapter.priv = budget_av; frontend_init(budget_av); - - if (!budget_av->has_saa7113) { - ciintf_init(budget_av); - } - + ciintf_init(budget_av); return 0; } diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 336b2fe..04cef30 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -43,7 +43,7 @@ is a bit braindead (no matching channel masks or no matching filter mask), we won't support this - yet. it doesn't event support negative filters, so the best way is maybe to keep TTUSB_HWSECTIONS undef'd and just - parse TS data. USB bandwith will be a problem when having large + parse TS data. USB bandwidth will be a problem when having large datastreams, especially for dvb-net, but hey, that's not my problem. TTUSB_DISEQC, TTUSB_TONE: diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index 9f249e7..4c82956 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c @@ -37,7 +37,6 @@ *************************************************************************** */ -#include <linux/config.h> #include <linux/types.h> #include <linux/list.h> #include <linux/module.h> diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c index ae14f5f..5c5e682 100644 --- a/drivers/media/video/arv.c +++ b/drivers/media/video/arv.c @@ -18,7 +18,6 @@ * 2003-09-01: Support w3cam by Takeo Takahashi */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/delay.h> diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index e68a6d2..de14818 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c @@ -25,7 +25,6 @@ */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -3548,11 +3547,6 @@ void __devinit bttv_init_card2(struct bttv *btv) /* Hybrid DVB card, DOES have a tda9887 */ if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE) tda9887 = 1; - if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) || - (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) || - (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) || - tda9887) - request_module("tda9887"); if (btv->tuner_type != UNSET) request_module("tuner"); } diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index d295601..311c4c5 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h @@ -360,7 +360,7 @@ struct bttv { int mbox_csel; /* risc memory management data - - must aquire s_lock before changing these + - must acquire s_lock before changing these - only the irq handler is supported to touch top + bottom + vcurr */ struct btcx_riscmem main; struct bttv_buffer *screen; /* overlay */ diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c index 840fe01..353d02b 100644 --- a/drivers/media/video/compat_ioctl32.c +++ b/drivers/media/video/compat_ioctl32.c @@ -12,7 +12,6 @@ * ioctls. */ -#include <linux/config.h> #include <linux/compat.h> #include <linux/videodev.h> #include <linux/videodev2.h> diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index 95c5ace..3b31a0d 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -26,7 +26,6 @@ /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ /* #define _CPIA_DEBUG_ 1 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index d129db5..d09f499 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c @@ -31,7 +31,6 @@ #include <linux/version.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/time.h> diff --git a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c index 4c89bd3..41f4b8d 100644 --- a/drivers/media/video/cpia_pp.c +++ b/drivers/media/video/cpia_pp.c @@ -25,7 +25,6 @@ /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ /* #define _CPIA_DEBUG_ 1 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 4ff8158..349632b 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -686,6 +686,39 @@ static struct videobuf_queue_ops blackbird_qops = { /* ------------------------------------------------------------------ */ +static const u32 *ctrl_classes[] = { + cx88_user_ctrls, + cx2341x_mpeg_ctrls, + NULL +}; + +static int blackbird_queryctrl(struct cx8802_dev *dev, struct v4l2_queryctrl *qctrl) +{ + qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); + if (qctrl->id == 0) + return -EINVAL; + + /* Standard V4L2 controls */ + if (cx8800_ctrl_query(qctrl) == 0) + return 0; + + /* MPEG V4L2 controls */ + if (cx2341x_ctrl_query(&dev->params, qctrl)) + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; + return 0; +} + +static int blackbird_querymenu(struct cx8802_dev *dev, struct v4l2_querymenu *qmenu) +{ + struct v4l2_queryctrl qctrl; + + qctrl.id = qmenu->id; + blackbird_queryctrl(dev, &qctrl); + return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); +} + +/* ------------------------------------------------------------------ */ + static int mpeg_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) { @@ -866,6 +899,16 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file, core->name); return 0; } + case VIDIOC_QUERYMENU: + return blackbird_querymenu(dev, arg); + case VIDIOC_QUERYCTRL: + { + struct v4l2_queryctrl *c = arg; + + if (blackbird_queryctrl(dev, c) == 0) + return 0; + return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl); + } default: return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl); diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index f9d68f2..14bd486 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1194,6 +1194,21 @@ struct cx88_board cx88_boards[] = { }}, .dvb = 1, }, + [CX88_BOARD_GENIATECH_DVBS] = { + .name = "Geniatech DVB-S", + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = {{ + .type = CX88_VMUX_DVB, + .vmux = 0, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + }}, + .dvb = 1, + }, }; const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); @@ -1439,6 +1454,10 @@ struct cx88_subid cx88_subids[] = { .subvendor = 0x18ac, .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */ .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q, + },{ + .subvendor = 0x14f1, + .subdevice = 0x0084, + .card = CX88_BOARD_GENIATECH_DVBS, }, }; const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index dce1fed..afde378 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -496,6 +496,26 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t return 0; } +static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) +{ + struct cx8802_dev *dev= fe->dvb->priv; + struct cx88_core *core = dev->core; + + if (voltage == SEC_VOLTAGE_OFF) { + dprintk(1,"LNB Voltage OFF\n"); + cx_write(MO_GP0_IO, 0x0000efff); + } + + if (core->prev_set_voltage) + return core->prev_set_voltage(fe, voltage); + return 0; +} + +static struct cx24123_config geniatech_dvbs_config = { + .demod_address = 0x55, + .set_ts_params = cx24123_set_ts_param, +}; + static struct cx24123_config hauppauge_novas_config = { .demod_address = 0x55, .set_ts_params = cx24123_set_ts_param, @@ -760,6 +780,14 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; } break; + case CX88_BOARD_GENIATECH_DVBS: + dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config, + &dev->core->i2c_adap); + if (dev->dvb.frontend) { + dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; + dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; + } + break; #endif default: printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 8d5cf47..c538d99 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -327,6 +327,51 @@ static struct cx88_ctrl cx8800_ctls[] = { }; static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); +const u32 cx88_user_ctrls[] = { + V4L2_CID_USER_CLASS, + V4L2_CID_BRIGHTNESS, + V4L2_CID_CONTRAST, + V4L2_CID_SATURATION, + V4L2_CID_HUE, + V4L2_CID_AUDIO_VOLUME, + V4L2_CID_AUDIO_BALANCE, + V4L2_CID_AUDIO_MUTE, + 0 +}; +EXPORT_SYMBOL(cx88_user_ctrls); + +static const u32 *ctrl_classes[] = { + cx88_user_ctrls, + NULL +}; + +int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) +{ + int i; + + if (qctrl->id < V4L2_CID_BASE || + qctrl->id >= V4L2_CID_LASTP1) + return -EINVAL; + for (i = 0; i < CX8800_CTLS; i++) + if (cx8800_ctls[i].v.id == qctrl->id) + break; + if (i == CX8800_CTLS) { + *qctrl = no_ctl; + return 0; + } + *qctrl = cx8800_ctls[i].v; + return 0; +} +EXPORT_SYMBOL(cx8800_ctrl_query); + +static int cx88_queryctrl(struct v4l2_queryctrl *qctrl) +{ + qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); + if (qctrl->id == 0) + return -EINVAL; + return cx8800_ctrl_query(qctrl); +} + /* ------------------------------------------------------------------- */ /* resource management */ @@ -1362,20 +1407,8 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, case VIDIOC_QUERYCTRL: { struct v4l2_queryctrl *c = arg; - int i; - if (c->id < V4L2_CID_BASE || - c->id >= V4L2_CID_LASTP1) - return -EINVAL; - for (i = 0; i < CX8800_CTLS; i++) - if (cx8800_ctls[i].v.id == c->id) - break; - if (i == CX8800_CTLS) { - *c = no_ctl; - return 0; - } - *c = cx8800_ctls[i].v; - return 0; + return cx88_queryctrl(c); } case VIDIOC_G_CTRL: return get_control(core,arg); @@ -1893,8 +1926,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, /* load and configure helper modules */ if (TUNER_ABSENT != core->tuner_type) request_module("tuner"); - if (core->tda9887_conf) - request_module("tda9887"); /* register v4l devices */ dev->video_dev = cx88_vdev_init(core,dev->pci, diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 9a9a0fc..e781095 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -196,6 +196,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49 #define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50 #define CX88_BOARD_WINFAST_DTV2000H 51 +#define CX88_BOARD_GENIATECH_DVBS 52 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, @@ -590,6 +591,8 @@ int cx8802_resume_common(struct pci_dev *pci_dev); extern int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl); +extern const u32 cx88_user_ctrls[]; +extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl); /* * Local variables: diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 9286090..2a461dde4 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -1574,8 +1574,6 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, request_module("tvp5150"); if (dev->has_tuner) request_module("tuner"); - if (dev->tda9887_conf) - request_module("tda9887"); #endif errCode = em28xx_config(dev); if (errCode) { diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index f68ca7d..ddd6221 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c @@ -26,7 +26,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/sched.h> diff --git a/drivers/media/video/meye.h b/drivers/media/video/meye.h index 0d09a0e..ea107cb 100644 --- a/drivers/media/video/meye.h +++ b/drivers/media/video/meye.h @@ -36,7 +36,6 @@ #define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \ __stringify(MEYE_DRIVER_MINORVERSION) -#include <linux/config.h> #include <linux/types.h> #include <linux/pci.h> #include <linux/kfifo.h> diff --git a/drivers/media/video/msp3400-driver.h b/drivers/media/video/msp3400-driver.h index 4e45104..545e4ac0 100644 --- a/drivers/media/video/msp3400-driver.h +++ b/drivers/media/video/msp3400-driver.h @@ -90,8 +90,8 @@ struct msp_state { /* thread */ struct task_struct *kthread; wait_queue_head_t wq; - int restart:1; - int watch_stereo:1; + unsigned int restart:1; + unsigned int watch_stereo:1; }; /* msp3400-driver.c */ diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index a988df2..1b07a61 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c @@ -35,7 +35,6 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/vmalloc.h> diff --git a/drivers/media/video/pvrusb2/Makefile b/drivers/media/video/pvrusb2/Makefile index fed603a..02e4142 100644 --- a/drivers/media/video/pvrusb2/Makefile +++ b/drivers/media/video/pvrusb2/Makefile @@ -8,7 +8,7 @@ obj-pvrusb2-24xxx-$(CONFIG_VIDEO_PVRUSB2_24XXX) := \ pvrusb2-objs := pvrusb2-i2c-core.o pvrusb2-i2c-cmd-v4l2.o \ pvrusb2-audio.o pvrusb2-i2c-chips-v4l2.o \ pvrusb2-encoder.o pvrusb2-video-v4l.o \ - pvrusb2-eeprom.o pvrusb2-tuner.o pvrusb2-demod.o \ + pvrusb2-eeprom.o pvrusb2-tuner.o \ pvrusb2-main.o pvrusb2-hdw.o pvrusb2-v4l2.o \ pvrusb2-ctrl.o pvrusb2-std.o \ pvrusb2-context.o pvrusb2-io.o pvrusb2-ioread.o \ diff --git a/drivers/media/video/pvrusb2/pvrusb2-audio.c b/drivers/media/video/pvrusb2/pvrusb2-audio.c index 313d2dc..9846c46 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -145,8 +145,8 @@ static int get_audio_status(struct pvr2_msp3400_handler *ctxt) static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->audio_stat = 0; + ctxt->client->handler = NULL; + ctxt->hdw->audio_stat = NULL; kfree(ctxt); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.c b/drivers/media/video/pvrusb2/pvrusb2-context.c index 40dc598..f129f31 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -77,7 +77,7 @@ struct pvr2_context *pvr2_context_create( const struct usb_device_id *devid, void (*setup_func)(struct pvr2_context *)) { - struct pvr2_context *mp = 0; + struct pvr2_context *mp = NULL; mp = kmalloc(sizeof(*mp),GFP_KERNEL); if (!mp) goto done; memset(mp,0,sizeof(*mp)); @@ -87,7 +87,7 @@ struct pvr2_context *pvr2_context_create( mp->hdw = pvr2_hdw_create(intf,devid); if (!mp->hdw) { pvr2_context_destroy(mp); - mp = 0; + mp = NULL; goto done; } @@ -145,7 +145,7 @@ void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp) { cp->hdw = mp->hdw; cp->mc_head = mp; - cp->mc_next = 0; + cp->mc_next = NULL; cp->mc_prev = mp->mc_last; if (mp->mc_last) { mp->mc_last->mc_next = cp; @@ -160,8 +160,8 @@ static void pvr2_channel_disclaim_stream(struct pvr2_channel *cp) { if (!cp->stream) return; pvr2_stream_kill(cp->stream->stream); - cp->stream->user = 0; - cp->stream = 0; + cp->stream->user = NULL; + cp->stream = NULL; } @@ -179,7 +179,7 @@ void pvr2_channel_done(struct pvr2_channel *cp) } else { mp->mc_first = cp->mc_next; } - cp->hdw = 0; + cp->hdw = NULL; } @@ -212,7 +212,7 @@ struct pvr2_ioread *pvr2_channel_create_mpeg_stream( { struct pvr2_ioread *cp; cp = pvr2_ioread_create(); - if (!cp) return 0; + if (!cp) return NULL; pvr2_ioread_setup(cp,sp->stream); pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key)); return cp; diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index d5df9fb..fb6198f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -158,7 +158,7 @@ int pvr2_ctrl_get_mask(struct pvr2_ctrl *cptr) /* Retrieve the control's name */ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) { - if (!cptr) return 0; + if (!cptr) return NULL; return cptr->info->name; } @@ -166,7 +166,7 @@ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) /* Retrieve the control's desc */ const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr) { - if (!cptr) return 0; + if (!cptr) return NULL; return cptr->info->desc; } @@ -488,7 +488,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { - ret = parse_token(ptr,len,valptr,0,0); + ret = parse_token(ptr,len,valptr,NULL,0); if ((ret >= 0) && ((*valptr < cptr->info->def.type_int.min_value) || (*valptr > cptr->info->def.type_int.max_value))) { diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c index 27eadaf..c80c26b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c @@ -139,8 +139,8 @@ static const struct pvr2_v4l_cx2584x_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->decoder_ctrl = 0; + ctxt->client->handler = NULL; + ctxt->hdw->decoder_ctrl = NULL; kfree(ctxt); } @@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt, static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt) { int ret; - ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0); + ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL); pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index 586900e..f985f00 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -82,7 +82,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, unsigned int wlen; unsigned int scnt; - wptr = 0; + wptr = NULL; wlen = 0; scnt = debugifc_count_whitespace(buf,count); consume_cnt += scnt; count -= scnt; buf += scnt; @@ -337,8 +337,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, } -int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, - unsigned int count) +static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, + unsigned int count) { const char *wptr; unsigned int wlen; diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.c b/drivers/media/video/pvrusb2/pvrusb2-demod.c deleted file mode 100644 index 9686569..0000000 --- a/drivers/media/video/pvrusb2/pvrusb2-demod.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * $Id$ - * - * Copyright (C) 2005 Mike Isely <isely@pobox.com> - * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> - * - * 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 - * - * 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. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "pvrusb2.h" -#include "pvrusb2-util.h" -#include "pvrusb2-demod.h" -#include "pvrusb2-hdw-internal.h" -#include "pvrusb2-debug.h" -#include <linux/videodev2.h> -#include <media/tuner.h> -#include <media/v4l2-common.h> - - -struct pvr2_demod_handler { - struct pvr2_hdw *hdw; - struct pvr2_i2c_client *client; - struct pvr2_i2c_handler i2c_handler; - int type_update_fl; -}; - - -static void set_config(struct pvr2_demod_handler *ctxt) -{ - struct pvr2_hdw *hdw = ctxt->hdw; - int cfg = 0; - - switch (hdw->tuner_type) { - case TUNER_PHILIPS_FM1216ME_MK3: - case TUNER_PHILIPS_FM1236_MK3: - cfg = TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE; - break; - default: - break; - } - pvr2_trace(PVR2_TRACE_CHIPS,"i2c demod set_config(0x%x)",cfg); - pvr2_i2c_client_cmd(ctxt->client,TDA9887_SET_CONFIG,&cfg); - ctxt->type_update_fl = 0; -} - - -static int demod_check(struct pvr2_demod_handler *ctxt) -{ - struct pvr2_hdw *hdw = ctxt->hdw; - if (hdw->tuner_updated) ctxt->type_update_fl = !0; - return ctxt->type_update_fl != 0; -} - - -static void demod_update(struct pvr2_demod_handler *ctxt) -{ - if (ctxt->type_update_fl) set_config(ctxt); -} - - -static void demod_detach(struct pvr2_demod_handler *ctxt) -{ - ctxt->client->handler = 0; - kfree(ctxt); -} - - -static unsigned int demod_describe(struct pvr2_demod_handler *ctxt,char *buf,unsigned int cnt) -{ - return scnprintf(buf,cnt,"handler: pvrusb2-demod"); -} - - -const static struct pvr2_i2c_handler_functions tuner_funcs = { - .detach = (void (*)(void *))demod_detach, - .check = (int (*)(void *))demod_check, - .update = (void (*)(void *))demod_update, - .describe = (unsigned int (*)(void *,char *,unsigned int))demod_describe, -}; - - -int pvr2_i2c_demod_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) -{ - struct pvr2_demod_handler *ctxt; - if (cp->handler) return 0; - - ctxt = kmalloc(sizeof(*ctxt),GFP_KERNEL); - if (!ctxt) return 0; - memset(ctxt,0,sizeof(*ctxt)); - - ctxt->i2c_handler.func_data = ctxt; - ctxt->i2c_handler.func_table = &tuner_funcs; - ctxt->type_update_fl = !0; - ctxt->client = cp; - ctxt->hdw = hdw; - cp->handler = &ctxt->i2c_handler; - pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x tda9887 V4L2 handler set up", - cp->client->addr); - return !0; -} - - - - -/* - Stuff for Emacs to see, in order to encourage consistent editing style: - *** Local Variables: *** - *** mode: c *** - *** fill-column: 70 *** - *** tab-width: 8 *** - *** c-basic-offset: 8 *** - *** End: *** - */ diff --git a/drivers/media/video/pvrusb2/pvrusb2-demod.h b/drivers/media/video/pvrusb2/pvrusb2-demod.h deleted file mode 100644 index 4c4e40f..0000000 --- a/drivers/media/video/pvrusb2/pvrusb2-demod.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * $Id$ - * - * Copyright (C) 2005 Mike Isely <isely@pobox.com> - * - * 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 - * - * 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. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef __PVRUSB2_DEMOD_H -#define __PVRUSB2_DEMOD_H - -#include "pvrusb2-i2c-core.h" - -int pvr2_i2c_demod_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); - -#endif /* __PVRUSB2_DEMOD_H */ - -/* - Stuff for Emacs to see, in order to encourage consistent editing style: - *** Local Variables: *** - *** mode: c *** - *** fill-column: 70 *** - *** tab-width: 8 *** - *** c-basic-offset: 8 *** - *** End: *** - */ diff --git a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c index 94d383f..6cff8e7 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-eeprom.c +++ b/drivers/media/video/pvrusb2/pvrusb2-eeprom.c @@ -58,7 +58,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to allocate memory" " required to read eeprom"); - return 0; + return NULL; } trace_eeprom("Value for eeprom addr from controller was 0x%x", @@ -108,7 +108,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "eeprom fetch set offs err=%d",ret); kfree(eeprom); - return 0; + return NULL; } } return eeprom; diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 2cc3169..18a7073 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -65,7 +65,7 @@ static int pvr2_encoder_write_words(struct pvr2_hdw *hdw, } ret = pvr2_send_request(hdw, hdw->cmd_buffer,1+(chunkCnt*7), - 0,0); + NULL,0); if (ret) return ret; data += chunkCnt; dlen -= chunkCnt; @@ -322,7 +322,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) } ret = cx2341x_update(hdw,pvr2_encoder_cmd, - (hdw->enc_cur_valid ? &hdw->enc_cur_state : 0), + (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL), &hdw->enc_ctl_state); if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index ba2afbf..0d6dc33 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -354,23 +354,6 @@ struct pvr2_hdw { unsigned int control_cnt; }; -int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); - -unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *); - -void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val); -void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val); - -void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); -void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); - -int pvr2_i2c_basic_op(struct pvr2_hdw *,u8 i2c_addr, - u8 *wdata,u16 wlen, - u8 *rdata,u16 rlen); - #endif /* __PVRUSB2_HDW_INTERNAL_H */ /* diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 643c471..9b48abc 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -63,7 +63,6 @@ struct pvr2_string_table { static const char *pvr2_client_24xxx[] = { "cx25840", "tuner", - "tda9887", "wm8775", }; #endif @@ -73,7 +72,6 @@ static const char *pvr2_client_29xxx[] = { "msp3400", "saa7115", "tuner", - "tda9887", }; static struct pvr2_string_table pvr2_client_lists[] = { @@ -89,8 +87,8 @@ static struct pvr2_string_table pvr2_client_lists[] = { #endif }; -static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; -DECLARE_MUTEX(pvr2_unit_sem); +static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL}; +static DECLARE_MUTEX(pvr2_unit_sem); static int ctlchg = 0; static int initusbreset = 1; @@ -263,6 +261,25 @@ static const char *control_values_subsystem[] = { [PVR2_SUBSYS_B_ENC_RUN] = "enc_run", }; +static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); +static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); +static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw); +static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw); +static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); +static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); +static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw); +static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val); +static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val); +static int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len); +static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res); +static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res); static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) { @@ -405,7 +422,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) info = (struct pvr2_ctl_info *)(cptr->info); if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { if (info->set_value) { - info->set_value = 0; + info->set_value = NULL; } } else { if (!(info->set_value)) { @@ -836,14 +853,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw) } -struct pvr2_hdw *pvr2_hdw_find(int unit_number) -{ - if (unit_number < 0) return 0; - if (unit_number >= PVR_NUM) return 0; - return unit_pointers[unit_number]; -} - - int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) { return hdw->unit_number; @@ -917,9 +926,9 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw, * is not suitable for an usb transaction. * */ -int pvr2_upload_firmware1(struct pvr2_hdw *hdw) +static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = 0; + const struct firmware *fw_entry = NULL; void *fw_ptr; unsigned int pipe; int ret; @@ -1015,7 +1024,7 @@ int pvr2_upload_firmware1(struct pvr2_hdw *hdw) int pvr2_upload_firmware2(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = 0; + const struct firmware *fw_entry = NULL; void *fw_ptr; unsigned int pipe, fw_len, fw_done; int actual_length; @@ -1166,8 +1175,9 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) reconfigure and start over. */ -void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val) +static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val) { unsigned long nmsk; unsigned long vmsk; @@ -1318,18 +1328,6 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, } -void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk) -{ - pvr2_hdw_subsys_bit_chg(hdw,msk,msk); -} - - -void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk) -{ - pvr2_hdw_subsys_bit_chg(hdw,msk,0); -} - - unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw) { return hdw->subsys_enabled_mask; @@ -1342,9 +1340,9 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw) } -void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) +static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val) { unsigned long val2; msk &= PVR2_SUBSYS_ALL; @@ -1366,7 +1364,7 @@ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw, } -int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) +static int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) { if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0; if (enableFl) { @@ -1400,8 +1398,8 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) } -int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, - enum pvr2_config config) +static int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, + enum pvr2_config config) { unsigned long sm = hdw->subsys_enabled_mask; if (!hdw->flag_ok) return -EIO; @@ -1741,7 +1739,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Bogus device type of %u reported",hdw_type); - return 0; + return NULL; } hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); @@ -1922,38 +1920,38 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); kfree(hdw); } - return 0; + return NULL; } /* Remove _all_ associations between this driver and the underlying USB layer. */ -void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) +static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) { if (hdw->flag_disconnected) return; pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw); if (hdw->ctl_read_urb) { usb_kill_urb(hdw->ctl_read_urb); usb_free_urb(hdw->ctl_read_urb); - hdw->ctl_read_urb = 0; + hdw->ctl_read_urb = NULL; } if (hdw->ctl_write_urb) { usb_kill_urb(hdw->ctl_write_urb); usb_free_urb(hdw->ctl_write_urb); - hdw->ctl_write_urb = 0; + hdw->ctl_write_urb = NULL; } if (hdw->ctl_read_buffer) { kfree(hdw->ctl_read_buffer); - hdw->ctl_read_buffer = 0; + hdw->ctl_read_buffer = NULL; } if (hdw->ctl_write_buffer) { kfree(hdw->ctl_write_buffer); - hdw->ctl_write_buffer = 0; + hdw->ctl_write_buffer = NULL; } pvr2_hdw_render_useless_unlocked(hdw); hdw->flag_disconnected = !0; - hdw->usb_dev = 0; - hdw->usb_intf = 0; + hdw->usb_dev = NULL; + hdw->usb_intf = NULL; } @@ -1963,11 +1961,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); if (hdw->fw_buffer) { kfree(hdw->fw_buffer); - hdw->fw_buffer = 0; + hdw->fw_buffer = NULL; } if (hdw->vid_stream) { pvr2_stream_destroy(hdw->vid_stream); - hdw->vid_stream = 0; + hdw->vid_stream = NULL; } if (hdw->audio_stat) { hdw->audio_stat->detach(hdw->audio_stat->ctxt); @@ -1981,7 +1979,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) if ((hdw->unit_number >= 0) && (hdw->unit_number < PVR_NUM) && (unit_pointers[hdw->unit_number] == hdw)) { - unit_pointers[hdw->unit_number] = 0; + unit_pointers[hdw->unit_number] = NULL; } } while (0); up(&pvr2_unit_sem); if (hdw->controls) kfree(hdw->controls); @@ -2018,7 +2016,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw) // Attempt to autoselect an appropriate value for std_enum_cur given // whatever is currently in std_mask_cur -void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) +static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) { unsigned int idx; for (idx = 1; idx < hdw->std_enum_cnt; idx++) { @@ -2033,7 +2031,7 @@ void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) // Calculate correct set of enumerated standards based on currently known // set of available standards bits. -void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) +static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) { struct v4l2_standard *newstd; unsigned int std_cnt; @@ -2043,12 +2041,12 @@ void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) if (hdw->std_defs) { kfree(hdw->std_defs); - hdw->std_defs = 0; + hdw->std_defs = NULL; } hdw->std_enum_cnt = 0; if (hdw->std_enum_names) { kfree(hdw->std_enum_names); - hdw->std_enum_names = 0; + hdw->std_enum_names = NULL; } if (!std_cnt) { @@ -2099,7 +2097,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, unsigned int idx) { - if (idx >= hdw->control_cnt) return 0; + if (idx >= hdw->control_cnt) return NULL; return hdw->controls + idx; } @@ -2118,7 +2116,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, i = cptr->info->internal_id; if (i && (i == ctl_id)) return cptr; } - return 0; + return NULL; } @@ -2135,7 +2133,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id i = cptr->info->v4l_id; if (i && (i == ctl_id)) return cptr; } - return 0; + return NULL; } @@ -2149,7 +2147,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, int i; /* This could be made a lot more efficient, but for now... */ - cp2 = 0; + cp2 = NULL; for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; i = cptr->info->v4l_id; @@ -2159,7 +2157,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, cp2 = cptr; } return cp2; - return 0; + return NULL; } @@ -2182,7 +2180,7 @@ static const char *get_ctrl_typename(enum pvr2_ctl_type tp) state(s) back to their previous value before this function was called. Thus we can automatically reconfigure affected pieces of the driver as controls are changed. */ -int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) +static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) { unsigned long saved_subsys_mask = hdw->subsys_enabled_mask; unsigned long stale_subsys_mask = 0; @@ -2321,14 +2319,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw) } -void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw) -{ - LOCK_TAKE(hdw->big_lock); do { - pvr2_hdw_poll_trigger_unlocked(hdw); - } while (0); LOCK_GIVE(hdw->big_lock); -} - - /* Return name for this driver instance */ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) { @@ -2337,7 +2327,7 @@ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) /* Return bit mask indicating signal status */ -unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) +static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) { unsigned int msk = 0; switch (hdw->input_val) { @@ -2424,7 +2414,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) pvr2_trace(PVR2_TRACE_FIRMWARE, "Cleaning up after CPU firmware fetch"); kfree(hdw->fw_buffer); - hdw->fw_buffer = 0; + hdw->fw_buffer = NULL; hdw->fw_size = 0; /* Now release the CPU. It will disconnect and reconnect later. */ @@ -2519,22 +2509,6 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v) } -void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) -{ - if (!hdw->usb_dev) return; - usb_settoggle(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0xf, - !(PVR2_CTL_WRITE_ENDPOINT & USB_DIR_IN), 0); - usb_settoggle(hdw->usb_dev, PVR2_CTL_READ_ENDPOINT & 0xf, - !(PVR2_CTL_READ_ENDPOINT & USB_DIR_IN), 0); - usb_clear_halt(hdw->usb_dev, - usb_rcvbulkpipe(hdw->usb_dev, - PVR2_CTL_READ_ENDPOINT & 0x7f)); - usb_clear_halt(hdw->usb_dev, - usb_sndbulkpipe(hdw->usb_dev, - PVR2_CTL_WRITE_ENDPOINT & 0x7f)); -} - - static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) { struct pvr2_hdw *hdw = urb->context; @@ -2568,10 +2542,10 @@ static void pvr2_ctl_timeout(unsigned long data) } -int pvr2_send_request_ex(struct pvr2_hdw *hdw, - unsigned int timeout,int probe_fl, - void *write_data,unsigned int write_len, - void *read_data,unsigned int read_len) +static int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len) { unsigned int idx; int status = 0; @@ -2826,7 +2800,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data) } -int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) +static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) { int ret = 0; @@ -2850,7 +2824,7 @@ int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) } -int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) +static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) { int ret; @@ -2867,7 +2841,7 @@ int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) } -int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) +static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) { int ret; @@ -2883,13 +2857,13 @@ int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) } -void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) +static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) { if (!hdw->flag_ok) return; pvr2_trace(PVR2_TRACE_INIT,"render_useless"); hdw->flag_ok = 0; if (hdw->vid_stream) { - pvr2_stream_setup(hdw->vid_stream,0,0,0); + pvr2_stream_setup(hdw->vid_stream,NULL,0,0); } hdw->flag_streaming_enabled = 0; hdw->subsys_enabled_mask = 0; @@ -2908,7 +2882,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) { int ret; pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); - ret = usb_lock_device_for_reset(hdw->usb_dev,0); + ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); if (ret == 1) { ret = usb_reset_device(hdw->usb_dev); usb_unlock_device(hdw->usb_dev); @@ -2957,7 +2931,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); hdw->flag_ok = !0; hdw->cmd_buffer[0] = 0xdd; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -2969,7 +2943,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) LOCK_TAKE(hdw->ctl_lock); do { pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); hdw->cmd_buffer[0] = 0xde; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -2996,12 +2970,12 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) } -int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) +static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) { int status; LOCK_TAKE(hdw->ctl_lock); do { hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); if (!status) { hdw->subsys_enabled_mask = @@ -3094,7 +3068,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val) } -int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) +static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) { int result; LOCK_TAKE(hdw->ctl_lock); do { diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 63f5291..fd931b5 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -91,7 +91,6 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, void pvr2_hdw_poll(struct pvr2_hdw *); /* Trigger a poll to take place later at a convenient time */ -void pvr2_hdw_poll_trigger(struct pvr2_hdw *); void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *); /* Register a callback used to trigger a future poll */ @@ -99,9 +98,6 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *, void (*func)(void *), void *data); -/* Get pointer to structure given unit number */ -struct pvr2_hdw *pvr2_hdw_find(int unit_number); - /* Destroy hardware interaction structure */ void pvr2_hdw_destroy(struct pvr2_hdw *); @@ -180,12 +176,6 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, unsigned long msk,unsigned long val); -/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */ -void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk); - -/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */ -void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk); - /* Retrieve mask indicating which pieces of hardware are currently enabled / configured. */ unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *); @@ -225,34 +215,18 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,int); /* The following entry points are all lower level things you normally don't want to worry about. */ -/* Attempt to recover from a USB foul-up (in practice I find that if you - have to do this, then it's already too late). */ -void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw); - /* Issue a command and get a response from the device. LOTS of higher level stuff is built on this. */ int pvr2_send_request(struct pvr2_hdw *, void *write_ptr,unsigned int write_len, void *read_ptr,unsigned int read_len); -/* Issue a command and get a response from the device. This extended - version includes a probe flag (which if set means that device errors - should not be logged or treated as fatal) and a timeout in jiffies. - This can be used to non-lethally probe the health of endpoint 1. */ -int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl, - void *write_ptr,unsigned int write_len, - void *read_ptr,unsigned int read_len); - /* Slightly higher level device communication functions. */ int pvr2_write_register(struct pvr2_hdw *, u16, u32); -int pvr2_read_register(struct pvr2_hdw *, u16, u32 *); -int pvr2_write_u16(struct pvr2_hdw *, u16, int); -int pvr2_write_u8(struct pvr2_hdw *, u8, int); /* Call if for any reason we can't talk to the hardware anymore - this will cause the driver to stop flailing on the device. */ void pvr2_hdw_render_useless(struct pvr2_hdw *); -void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *); /* Set / clear 8051's reset bit */ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int); @@ -271,12 +245,6 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); /* Order decoder to reset */ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); -/* Stop / start video stream transport */ -int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); - -/* Find I2C address of eeprom */ -int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *); - /* Direct manipulation of GPIO bits */ int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *); int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *); diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index 1dd4f62..fbe6039 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -25,7 +25,6 @@ #include "pvrusb2-i2c-cmd-v4l2.h" #include "pvrusb2-audio.h" #include "pvrusb2-tuner.h" -#include "pvrusb2-demod.h" #include "pvrusb2-video-v4l.h" #ifdef CONFIG_VIDEO_PVRUSB2_24XXX #include "pvrusb2-cx2584x-v4l.h" @@ -89,11 +88,6 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) return; } } - if (id == I2C_DRIVERID_TDA9887) { - if (pvr2_i2c_demod_setup(hdw,cp)) { - return; - } - } } diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 9f81aff..8a9933d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -196,7 +196,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = { static void do_log(struct pvr2_hdw *hdw) { pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()"); - pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0); + pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,NULL); } @@ -217,7 +217,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = { void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) { pvr2_i2c_client_cmd(cp, - (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),0); + (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index c8d0bde..7fca479 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -37,6 +37,10 @@ static unsigned int i2c_scan = 0; module_param(i2c_scan, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); +static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, + unsigned int detail, + char *buf,unsigned int maxlen); + static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ u8 i2c_addr, /* I2C address we're talking to */ u8 *data, /* Data to write */ @@ -165,12 +169,12 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ /* This is the common low level entry point for doing I2C operations to the hardware. */ -int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, - u8 i2c_addr, - u8 *wdata, - u16 wlen, - u8 *rdata, - u16 rlen) +static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, + u8 i2c_addr, + u8 *wdata, + u16 wlen, + u8 *rdata, + u16 rlen) { if (!rdata) rlen = 0; if (!wdata) wlen = 0; @@ -267,7 +271,7 @@ static int i2c_hack_cx25840(struct pvr2_hdw *hdw, "WARNING: Disabling further access to the device" " to prevent other foul-ups."); // This blocks all further communication with the part. - hdw->i2c_func[0x44] = 0; + hdw->i2c_func[0x44] = NULL; pvr2_hdw_render_useless(hdw); goto fail; } @@ -294,7 +298,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, int num) { int ret = -ENOTSUPP; - pvr2_i2c_func funcp = 0; + pvr2_i2c_func funcp = NULL; struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data); if (!num) { @@ -319,7 +323,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, u16 tcnt,bcnt,offs; if (!msgs[0].len) { /* Length == 0 read. This is a probe. */ - if (funcp(hdw,msgs[0].addr,0,0,0,0)) { + if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) { ret = -EIO; goto done; } @@ -336,7 +340,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, if (bcnt > sizeof(hdw->cmd_buffer)-1) { bcnt = sizeof(hdw->cmd_buffer)-1; } - if (funcp(hdw,msgs[0].addr,0,0, + if (funcp(hdw,msgs[0].addr,NULL,0, msgs[0].buf+offs,bcnt)) { ret = -EIO; goto done; @@ -350,7 +354,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, /* Simple write */ ret = 1; if (funcp(hdw,msgs[0].addr, - msgs[0].buf,msgs[0].len,0,0)) { + msgs[0].buf,msgs[0].len,NULL,0)) { ret = -EIO; } goto done; @@ -705,9 +709,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw) return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0; } -unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, - unsigned int detail, - char *buf,unsigned int maxlen) +static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, + unsigned int detail, + char *buf,unsigned int maxlen) { unsigned int ccnt,bcnt; int spcfl = 0; @@ -871,7 +875,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw) msg[0].addr = 0; msg[0].flags = I2C_M_RD; msg[0].len = 0; - msg[0].buf = 0; + msg[0].buf = NULL; printk("%s: i2c scan beginning\n",hdw->name); for (i = 0; i < 128; i++) { msg[0].addr = i; diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h index e8af5b0e..6d7e252 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h @@ -75,9 +75,6 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *,char *buf,unsigned int maxlen); PVR2_I2C_DETAIL_DEBUG |\ PVR2_I2C_DETAIL_HANDLER |\ PVR2_I2C_DETAIL_CTLMASK) -unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *, - unsigned int detail_mask, - char *buf,unsigned int maxlen); void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *); const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx); diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c index a984c91..681f79c 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -93,7 +93,7 @@ struct pvr2_buffer { struct urb *purb; }; -const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) +static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) { switch (st) { case pvr2_buffer_state_none: return "none"; @@ -104,7 +104,8 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) return "unknown"; } -void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) +#ifdef SANITY_CHECK_BUFFERS +static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) { pvr2_trace(PVR2_TRACE_INFO, "buffer%s%s %p state=%s id=%d status=%d" @@ -115,10 +116,11 @@ void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"), (bp ? bp->id : 0), (bp ? bp->status : 0), - (bp ? bp->stream : 0), - (bp ? bp->purb : 0), + (bp ? bp->stream : NULL), + (bp ? bp->purb : NULL), (bp ? bp->signature : 0)); } +#endif /* SANITY_CHECK_BUFFERS */ static void pvr2_buffer_remove(struct pvr2_buffer *bp) { @@ -284,7 +286,7 @@ static void pvr2_buffer_done(struct pvr2_buffer *bp) pvr2_buffer_wipe(bp); pvr2_buffer_set_none(bp); bp->signature = 0; - bp->stream = 0; + bp->stream = NULL; if (bp->purb) usb_free_urb(bp->purb); pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/" " bufferDone %p",bp); @@ -339,13 +341,13 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *bp; bp = sp->buffers[sp->buffer_total_count - 1]; /* Paranoia */ - sp->buffers[sp->buffer_total_count - 1] = 0; + sp->buffers[sp->buffer_total_count - 1] = NULL; (sp->buffer_total_count)--; pvr2_buffer_done(bp); kfree(bp); } if (scnt < sp->buffer_slot_count) { - struct pvr2_buffer **nb = 0; + struct pvr2_buffer **nb = NULL; if (scnt) { nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL); if (!nb) return -ENOMEM; @@ -513,10 +515,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp, } /* Query / set the nominal buffer count */ -int pvr2_stream_get_buffer_count(struct pvr2_stream *sp) -{ - return sp->buffer_target_count; -} int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) { @@ -532,21 +530,21 @@ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->idle_list.next; - if (lp == &sp->idle_list) return 0; + if (lp == &sp->idle_list) return NULL; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->ready_list.next; - if (lp == &sp->ready_list) return 0; + if (lp == &sp->ready_list) return NULL; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id) { - if (id < 0) return 0; - if (id >= sp->buffer_total_count) return 0; + if (id < 0) return NULL; + if (id >= sp->buffer_total_count) return NULL; return sp->buffers[id]; } @@ -555,17 +553,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp) return sp->r_count; } -int pvr2_stream_get_idle_count(struct pvr2_stream *sp) -{ - return sp->i_count; -} - -void pvr2_stream_flush(struct pvr2_stream *sp) -{ - mutex_lock(&sp->mutex); do { - pvr2_stream_internal_flush(sp); - } while(0); mutex_unlock(&sp->mutex); -} void pvr2_stream_kill(struct pvr2_stream *sp) { @@ -620,20 +607,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp) return ret; } -int pvr2_buffer_idle(struct pvr2_buffer *bp) -{ - struct pvr2_stream *sp; - if (!bp) return -EINVAL; - sp = bp->stream; - mutex_lock(&sp->mutex); do { - pvr2_buffer_wipe(bp); - pvr2_buffer_set_idle(bp); - if (sp->buffer_total_count != sp->buffer_target_count) { - pvr2_stream_achieve_buffer_count(sp); - } - } while(0); mutex_unlock(&sp->mutex); - return 0; -} int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) { @@ -673,10 +646,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp) return bp->status; } -enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp) -{ - return bp->state; -} int pvr2_buffer_get_id(struct pvr2_buffer *bp) { diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.h b/drivers/media/video/pvrusb2/pvrusb2-io.h index 65e1138..96285ad 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-io.h +++ b/drivers/media/video/pvrusb2/pvrusb2-io.h @@ -36,8 +36,6 @@ enum pvr2_buffer_state { struct pvr2_stream; struct pvr2_buffer; -const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); - /* Initialize / tear down stream structure */ struct pvr2_stream *pvr2_stream_create(void); void pvr2_stream_destroy(struct pvr2_stream *); @@ -49,7 +47,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *, void *data); /* Query / set the nominal buffer count */ -int pvr2_stream_get_buffer_count(struct pvr2_stream *); int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int); /* Get a pointer to a buffer that is either idle, ready, or is specified @@ -59,12 +56,8 @@ struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *); struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id); /* Find out how many buffers are idle or ready */ -int pvr2_stream_get_idle_count(struct pvr2_stream *); int pvr2_stream_get_ready_count(struct pvr2_stream *); -/* Kill all pending operations */ -void pvr2_stream_flush(struct pvr2_stream *); - /* Kill all pending buffers and throw away any ready buffers as well */ void pvr2_stream_kill(struct pvr2_stream *); @@ -77,18 +70,12 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *); /* Retrieve completion code for given ready buffer */ int pvr2_buffer_get_status(struct pvr2_buffer *); -/* Retrieve state of given buffer */ -enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *); - /* Retrieve ID of given buffer */ int pvr2_buffer_get_id(struct pvr2_buffer *); /* Start reading into given buffer (kill it if needed) */ int pvr2_buffer_queue(struct pvr2_buffer *); -/* Move buffer back to idle pool (kill it if needed) */ -int pvr2_buffer_idle(struct pvr2_buffer *); - #endif /* __PVRUSB2_IO_H */ /* diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c index 49da062..f7a2e22 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -54,7 +54,7 @@ static int pvr2_ioread_init(struct pvr2_ioread *cp) { unsigned int idx; - cp->stream = 0; + cp->stream = NULL; mutex_init(&cp->mutex); for (idx = 0; idx < BUFFER_COUNT; idx++) { @@ -77,7 +77,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) { unsigned int idx; - pvr2_ioread_setup(cp,0); + pvr2_ioread_setup(cp,NULL); for (idx = 0; idx < BUFFER_COUNT; idx++) { if (!(cp->buffer_storage[idx])) continue; kfree(cp->buffer_storage[idx]); @@ -88,12 +88,12 @@ struct pvr2_ioread *pvr2_ioread_create(void) { struct pvr2_ioread *cp; cp = kmalloc(sizeof(*cp),GFP_KERNEL); - if (!cp) return 0; + if (!cp) return NULL; pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); memset(cp,0,sizeof(*cp)); if (pvr2_ioread_init(cp) < 0) { kfree(cp); - return 0; + return NULL; } return cp; } @@ -105,7 +105,7 @@ void pvr2_ioread_destroy(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp); if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = 0; + cp->sync_key_ptr = NULL; } kfree(cp); } @@ -124,7 +124,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *cp, if (sync_key_len != cp->sync_key_len) { if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = 0; + cp->sync_key_ptr = NULL; } cp->sync_key_len = 0; if (sync_key_len) { @@ -144,8 +144,8 @@ static void pvr2_ioread_stop(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_START_STOP, "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp); pvr2_stream_kill(cp->stream); - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; cp->enabled = 0; @@ -179,8 +179,8 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp) } } cp->enabled = !0; - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; cp->stream_running = 0; @@ -214,7 +214,7 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp) pvr2_ioread_stop(cp); pvr2_stream_kill(cp->stream); pvr2_stream_set_buffer_count(cp->stream,0); - cp->stream = 0; + cp->stream = NULL; } if (sp) { pvr2_trace(PVR2_TRACE_START_STOP, @@ -251,12 +251,8 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl) return ret; } -int pvr2_ioread_get_enabled(struct pvr2_ioread *cp) -{ - return cp->enabled != 0; -} -int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) +static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) { int stat; @@ -274,8 +270,8 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) pvr2_ioread_stop(cp); return 0; } - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; } @@ -307,7 +303,7 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) return !0; } -void pvr2_ioread_filter(struct pvr2_ioread *cp) +static void pvr2_ioread_filter(struct pvr2_ioread *cp) { unsigned int idx; if (!cp->enabled) return; diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.h b/drivers/media/video/pvrusb2/pvrusb2-ioread.h index 6b00259..1d362f8 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ioread.h +++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.h @@ -33,7 +33,6 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *, const char *sync_key_ptr, unsigned int sync_key_len); int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl); -int pvr2_ioread_get_enabled(struct pvr2_ioread *); int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt); int pvr2_ioread_avail(struct pvr2_ioread *); diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c index b952482..8f1a5af 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -54,7 +54,7 @@ module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR); MODULE_PARM_DESC(debug, "Debug trace mask"); #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS -static struct pvr2_sysfs_class *class_ptr = 0; +static struct pvr2_sysfs_class *class_ptr = NULL; #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ static void pvr_setup_attach(struct pvr2_context *pvr) @@ -104,10 +104,10 @@ static void pvr_disconnect(struct usb_interface *intf) } static struct usb_driver pvr_driver = { - name: "pvrusb2", - id_table: pvr2_device_table, - probe: pvr_probe, - disconnect: pvr_disconnect + .name = "pvrusb2", + .id_table = pvr2_device_table, + .probe = pvr_probe, + .disconnect = pvr_disconnect }; /* diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c index 1340636..f95c598 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-std.c +++ b/drivers/media/video/pvrusb2/pvrusb2-std.c @@ -121,7 +121,7 @@ static const struct std_name *find_std_name(const struct std_name *arrPtr, if (strlen(p->name) != bufSize) continue; if (!memcmp(bufPtr,p->name,bufSize)) return p; } - return 0; + return NULL; } @@ -289,7 +289,7 @@ static struct v4l2_standard *match_std(v4l2_std_id id) return generic_standards + idx; } } - return 0; + return NULL; } static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id) @@ -364,7 +364,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)", std_cnt); - if (!std_cnt) return 0; // paranoia + if (!std_cnt) return NULL; // paranoia stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt, GFP_KERNEL); diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index c6e6523..6af55a8 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -504,7 +504,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) cip->cptr = cptr; cip->chptr = sfp; - cip->item_next = 0; + cip->item_next = NULL; if (sfp->item_last) { sfp->item_last->item_next = cip; } else { @@ -625,7 +625,7 @@ static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp) &sfp->debugifc->attr_debuginfo); class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); kfree(sfp->debugifc); - sfp->debugifc = 0; + sfp->debugifc = NULL; } #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ @@ -678,9 +678,9 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp) class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); - sfp->class_dev->class_data = 0; + sfp->class_dev->class_data = NULL; class_device_unregister(sfp->class_dev); - sfp->class_dev = 0; + sfp->class_dev = NULL; } @@ -739,13 +739,13 @@ static void class_dev_create(struct pvr2_sysfs *sfp, sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; sfp->attr_v4l_minor_number.show = v4l_minor_number_show; - sfp->attr_v4l_minor_number.store = 0; + sfp->attr_v4l_minor_number.store = NULL; class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); sfp->attr_unit_number.attr.owner = THIS_MODULE; sfp->attr_unit_number.attr.name = "unit_number"; sfp->attr_unit_number.attr.mode = S_IRUGO; sfp->attr_unit_number.show = unit_number_show; - sfp->attr_unit_number.store = 0; + sfp->attr_unit_number.store = NULL; class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_add_controls(sfp); @@ -806,7 +806,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) pvr2_sysfs_trace( "Registration failed for pvr2_sysfs_class id=%p",clp); kfree(clp); - clp = 0; + clp = NULL; } return clp; } diff --git a/drivers/media/video/pvrusb2/pvrusb2-tuner.c b/drivers/media/video/pvrusb2/pvrusb2-tuner.c index f4aba81..af9f246 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-tuner.c +++ b/drivers/media/video/pvrusb2/pvrusb2-tuner.c @@ -69,7 +69,7 @@ static void tuner_update(struct pvr2_tuner_handler *ctxt) static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt) { - ctxt->client->handler = 0; + ctxt->client->handler = NULL; kfree(ctxt); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 9619510..0caf70b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -81,7 +81,7 @@ static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1}; module_param_array(video_nr, int, NULL, 0444); MODULE_PARM_DESC(video_nr, "Offset for device's minor"); -struct v4l2_capability pvr_capability ={ +static struct v4l2_capability pvr_capability ={ .driver = "pvrusb2", .card = "Hauppauge WinTV pvr-usb2", .bus_info = "usb", @@ -111,7 +111,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= { } }; -struct v4l2_fmtdesc pvr_fmtdesc [] = { +static struct v4l2_fmtdesc pvr_fmtdesc [] = { { .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, @@ -127,7 +127,7 @@ struct v4l2_fmtdesc pvr_fmtdesc [] = { #define PVR_FORMAT_PIX 0 #define PVR_FORMAT_VBI 1 -struct v4l2_format pvr_format [] = { +static struct v4l2_format pvr_format [] = { [PVR_FORMAT_PIX] = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .fmt = { @@ -701,9 +701,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) { - pvr2_trace(PVR2_TRACE_INIT, - "unregistering device video%d [%s]", - dip->vdev->minor,pvr2_config_get_name(dip->config)); + printk(KERN_INFO "pvrusb2: unregistering device video%d [%s]\n", + dip->vdev->minor,pvr2_config_get_name(dip->config)); if (dip->ctxt_idx >= 0) { mutex_lock(&device_lock); devices[dip->ctxt_idx] = NULL; @@ -725,7 +724,7 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) } -void pvr2_v4l2_internal_check(struct pvr2_channel *chp) +static void pvr2_v4l2_internal_check(struct pvr2_channel *chp) { struct pvr2_v4l2 *vp; vp = container_of(chp,struct pvr2_v4l2,channel); @@ -735,8 +734,8 @@ void pvr2_v4l2_internal_check(struct pvr2_channel *chp) } -int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { /* Temporary hack : use ivtv api until a v4l2 one is available. */ @@ -747,7 +746,7 @@ int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, } -int pvr2_v4l2_release(struct inode *inode, struct file *file) +static int pvr2_v4l2_release(struct inode *inode, struct file *file) { struct pvr2_v4l2_fh *fhp = file->private_data; struct pvr2_v4l2 *vp = fhp->vhead; @@ -761,9 +760,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file) hdw = fhp->channel.mc_head->hdw; pvr2_hdw_set_streaming(hdw,0); sp = pvr2_ioread_get_stream(fhp->rhp); - if (sp) pvr2_stream_set_callback(sp,0,0); + if (sp) pvr2_stream_set_callback(sp,NULL,NULL); pvr2_ioread_destroy(fhp->rhp); - fhp->rhp = 0; + fhp->rhp = NULL; } v4l2_prio_close(&vp->prio, &fhp->prio); file->private_data = NULL; @@ -779,9 +778,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file) } else { vp->vfirst = fhp->vnext; } - fhp->vnext = 0; - fhp->vprev = 0; - fhp->vhead = 0; + fhp->vnext = NULL; + fhp->vprev = NULL; + fhp->vhead = NULL; pvr2_channel_done(&fhp->channel); pvr2_trace(PVR2_TRACE_STRUCT, "Destroying pvr_v4l2_fh id=%p",fhp); @@ -794,9 +793,9 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file) } -int pvr2_v4l2_open(struct inode *inode, struct file *file) +static int pvr2_v4l2_open(struct inode *inode, struct file *file) { - struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */ + struct pvr2_v4l2_dev *dip = NULL; /* Our own context pointer */ struct pvr2_v4l2_fh *fhp; struct pvr2_v4l2 *vp; struct pvr2_hdw *hdw; @@ -854,7 +853,7 @@ int pvr2_v4l2_open(struct inode *inode, struct file *file) pvr2_context_enter(vp->channel.mc_head); do { pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp); pvr2_channel_init(&fhp->channel,vp->channel.mc_head); - fhp->vnext = 0; + fhp->vnext = NULL; fhp->vprev = vp->vlast; if (vp->vlast) { vp->vlast->vnext = fhp; @@ -897,7 +896,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh) fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream); if (!fh->rhp) { - pvr2_channel_claim_stream(&fh->channel,0); + pvr2_channel_claim_stream(&fh->channel,NULL); return -ENOMEM; } @@ -1078,9 +1077,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, (video_register_device(dip->vdev, v4l_type, -1) < 0)) { err("Failed to register pvrusb2 v4l video device"); } else { - pvr2_trace(PVR2_TRACE_INIT, - "registered device video%d [%s]", - dip->vdev->minor,pvr2_config_get_name(dip->config)); + printk(KERN_INFO "pvrusb2: registered device video%d [%s]\n", + dip->vdev->minor,pvr2_config_get_name(dip->config)); } if ((dip->vdev->minor < sizeof(devices)/sizeof(devices[0])) && diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index e4ec7f2..05f2cdd 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c @@ -126,8 +126,8 @@ static const struct pvr2_v4l_decoder_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_decoder *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->decoder_ctrl = 0; + ctxt->client->handler = NULL; + ctxt->hdw->decoder_ctrl = NULL; kfree(ctxt); } diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index fcad346..2413e51 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c @@ -89,7 +89,7 @@ static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt, static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt) { - ctxt->client->handler = 0; + ctxt->client->handler = NULL; kfree(ctxt); } diff --git a/drivers/media/video/pwc/pwc-uncompress.h b/drivers/media/video/pwc/pwc-uncompress.h index 041227f..43028e7 100644 --- a/drivers/media/video/pwc/pwc-uncompress.h +++ b/drivers/media/video/pwc/pwc-uncompress.h @@ -30,7 +30,6 @@ #ifndef PWC_UNCOMPRESS_H #define PWC_UNCOMPRESS_H -#include <linux/config.h> #include <media/pwc-ioctl.h> diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h index 629f79e..7e9c423 100644 --- a/drivers/media/video/pwc/pwc.h +++ b/drivers/media/video/pwc/pwc.h @@ -25,7 +25,6 @@ #ifndef PWC_H #define PWC_H -#include <linux/config.h> #include <linux/module.h> #include <linux/usb.h> #include <linux/spinlock.h> diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index da3007d..535172f 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c @@ -20,7 +20,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/init.h> #include <linux/list.h> #include <linux/module.h> @@ -942,8 +941,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, /* load i2c helpers */ if (TUNER_ABSENT != dev->tuner_type) request_module("tuner"); - if (dev->tda9887_conf) - request_module("tda9887"); if (card_is_empress(dev)) { request_module("saa6752hs"); request_module_depend("saa7134-empress",&need_empress); diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index a846ebc..67987ba 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c @@ -27,7 +27,6 @@ static const char version[] = "0.24"; -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/vmalloc.h> diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c index 351b182..2ba2991 100644 --- a/drivers/media/video/stv680.c +++ b/drivers/media/video/stv680.c @@ -58,7 +58,6 @@ * Fixed proc entry removal bug. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/vmalloc.h> diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 2fadabf..8dab481 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -590,8 +590,8 @@ int tda9887_tuner_init(struct i2c_client *c) t->set_tv_freq = tda9887_set_freq; t->set_radio_freq = tda9887_set_freq; t->standby = tda9887_standby; - t->tuner_status=tda9887_tuner_status; - t->get_afc=tda9887_get_afc; + t->tuner_status = tda9887_tuner_status; + t->get_afc = tda9887_get_afc; return 0; } diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 011413c..f7eb402 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -416,7 +416,7 @@ static void tuner_status(struct i2c_client *client) /* ---------------------------------------------------------------------- */ -/* static var Used only in tuner_attach and tuner_probe */ +/* static vars: used only in tuner_attach and tuner_probe */ static unsigned default_mode_mask; /* During client attach, set_type is called by adapter's attach_inform callback. @@ -608,13 +608,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) tuner_dbg("VIDIOCSAUDIO not implemented.\n"); break; case TDA9887_SET_CONFIG: - { - int *i = arg; + if (t->type == TUNER_TDA9887) { + int *i = arg; - t->tda9887_config = *i; - set_freq(client, t->tv_freq); + t->tda9887_config = *i; + set_freq(client, t->tv_freq); + } break; - } /* --- v4l ioctls --- */ /* take care: bttv does userspace copying, we'll get a kernel pointer here... */ diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index 6da6f82..d071c5c 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c @@ -7,6 +7,7 @@ #include <linux/i2c.h> #include <linux/videodev.h> #include <media/tuner.h> +#include <media/v4l2-common.h> static int offset = 0; module_param(offset, int, 0666); @@ -128,6 +129,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) u8 buffer[4]; int rc, IFPCoff, i, j; enum param_type desired_type; + struct tuner_params *params; tun = &tuners[t->type]; @@ -169,19 +171,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) IFPCoff,t->type); j = 0; } + params = &tun->params[j]; - for (i = 0; i < tun->params[j].count; i++) { - if (freq > tun->params[j].ranges[i].limit) + for (i = 0; i < params->count; i++) { + if (freq > params->ranges[i].limit) continue; break; } - if (i == tun->params[j].count) { + if (i == params->count) { tuner_dbg("TV frequency out of range (%d > %d)", - freq, tun->params[j].ranges[i - 1].limit); - freq = tun->params[j].ranges[--i].limit; + freq, params->ranges[i - 1].limit); + freq = params->ranges[--i].limit; } - config = tun->params[j].ranges[i].config; - cb = tun->params[j].ranges[i].cb; + config = params->ranges[i].config; + cb = params->ranges[i].cb; /* i == 0 -> VHF_LO * i == 1 -> VHF_HI * i == 2 -> UHF */ @@ -281,7 +284,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) break; } - if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { + if (params->cb_first_if_lower_freq && div < t->last_div) { buffer[0] = config; buffer[1] = cb; buffer[2] = (div>>8) & 0x7f; @@ -293,6 +296,43 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) buffer[3] = cb; } t->last_div = div; + if (params->has_tda9887) { + int config = 0; + int is_secam_l = (t->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) && + !(t->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)); + + if (t->std == V4L2_STD_SECAM_LC) { + if (params->port1_active ^ params->port1_invert_for_secam_lc) + config |= TDA9887_PORT1_ACTIVE; + if (params->port2_active ^ params->port2_invert_for_secam_lc) + config |= TDA9887_PORT2_ACTIVE; + } + else { + if (params->port1_active) + config |= TDA9887_PORT1_ACTIVE; + if (params->port2_active) + config |= TDA9887_PORT2_ACTIVE; + } + if (params->intercarrier_mode) + config |= TDA9887_INTERCARRIER; + if (is_secam_l) { + if (i == 0 && params->default_top_secam_low) + config |= TDA9887_TOP(params->default_top_secam_low); + else if (i == 1 && params->default_top_secam_mid) + config |= TDA9887_TOP(params->default_top_secam_mid); + else if (params->default_top_secam_high) + config |= TDA9887_TOP(params->default_top_secam_high); + } + else { + if (i == 0 && params->default_top_low) + config |= TDA9887_TOP(params->default_top_low); + else if (i == 1 && params->default_top_mid) + config |= TDA9887_TOP(params->default_top_mid); + else if (params->default_top_high) + config |= TDA9887_TOP(params->default_top_high); + } + i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config); + } tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", buffer[0],buffer[1],buffer[2],buffer[3]); @@ -339,6 +379,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) u16 div; int rc, j; enum param_type desired_type = TUNER_PARAM_TYPE_RADIO; + struct tuner_params *params; tun = &tuners[t->type]; @@ -352,7 +393,8 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) j = 0; div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ - buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ + params = &tun->params[j]; + buffer[2] = (params->ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ switch (t->type) { case TUNER_TENA_9533_DI: @@ -384,7 +426,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) } buffer[0] = (div>>8) & 0x7f; buffer[1] = div & 0xff; - if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { + if (params->cb_first_if_lower_freq && div < t->last_div) { buffer[0] = buffer[2]; buffer[1] = buffer[3]; buffer[2] = (div>>8) & 0x7f; @@ -398,6 +440,18 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) buffer[0],buffer[1],buffer[2],buffer[3]); t->last_div = div; + if (params->has_tda9887) { + int config = 0; + if (params->port1_active && !params->port1_fm_high_sensitivity) + config |= TDA9887_PORT1_ACTIVE; + if (params->port2_active && !params->port2_fm_high_sensitivity) + config |= TDA9887_PORT2_ACTIVE; + if (params->intercarrier_mode) + config |= TDA9887_INTERCARRIER; +/* if (params->port1_set_for_fm_mono) + config &= ~TDA9887_PORT1_ACTIVE;*/ + i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config); + } if (4 != (rc = i2c_master_send(c,buffer,4))) tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); } diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c index 9d9226c..a167e17 100644 --- a/drivers/media/video/tuner-types.c +++ b/drivers/media/video/tuner-types.c @@ -380,6 +380,10 @@ static struct tuner_params tuner_philips_fq1216me_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_lg_pal_ranges, .count = ARRAY_SIZE(tuner_lg_pal_ranges), + .has_tda9887 = 1, + .port1_active = 1, + .port2_active = 1, + .port2_invert_for_secam_lc = 1, }, }; @@ -542,6 +546,14 @@ static struct tuner_params tuner_fm1216me_mk3_params[] = { .ranges = tuner_fm1216me_mk3_pal_ranges, .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges), .cb_first_if_lower_freq = 1, + .has_tda9887 = 1, + .port1_active = 1, + .port2_active = 1, + .port2_invert_for_secam_lc = 1, + .port1_fm_high_sensitivity = 1, + .default_top_mid = -2, + .default_top_secam_mid = -2, + .default_top_secam_high = -2, }, }; @@ -612,6 +624,10 @@ static struct tuner_params tuner_fm1236_mk3_params[] = { .ranges = tuner_fm1236_mk3_ntsc_ranges, .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), .cb_first_if_lower_freq = 1, + .has_tda9887 = 1, + .port1_active = 1, + .port2_active = 1, + .port1_fm_high_sensitivity = 1, }, }; @@ -632,6 +648,8 @@ static struct tuner_params tuner_microtune_4049_fm5_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_temic_4009f_5_pal_ranges, .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), + .has_tda9887 = 1, + .port1_invert_for_secam_lc = 1, }, }; @@ -648,6 +666,8 @@ static struct tuner_params tuner_panasonic_vp27_params[] = { .type = TUNER_PARAM_TYPE_NTSC, .ranges = tuner_panasonic_vp27_ntsc_ranges, .count = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges), + .has_tda9887 = 1, + .intercarrier_mode = 1, }, }; @@ -782,6 +802,13 @@ static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_philips_fq12_6a___mk4_pal_ranges, .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_pal_ranges), + .has_tda9887 = 1, + .port1_active = 1, + .port2_invert_for_secam_lc = 1, + .default_top_mid = -2, + .default_top_secam_low = -2, + .default_top_secam_mid = -2, + .default_top_secam_high = -2, }, }; @@ -870,6 +897,12 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_philips_fmd1216me_mk3_pal_ranges, .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges), + .has_tda9887 = 1, + .port1_active = 1, + .port2_active = 1, + .port2_fm_high_sensitivity = 1, + .port2_invert_for_secam_lc = 1, + .port1_set_for_fm_mono = 1, }, }; @@ -1005,6 +1038,7 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = { .type = TUNER_PARAM_TYPE_NTSC, .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges), + .has_tda9887 = 1, }, }; @@ -1037,6 +1071,10 @@ static struct tuner_params tuner_samsung_tcpg_6121p30a_params[] = { .type = TUNER_PARAM_TYPE_PAL, .ranges = tuner_samsung_tcpg_6121p30a_pal_ranges, .count = ARRAY_SIZE(tuner_samsung_tcpg_6121p30a_pal_ranges), + .has_tda9887 = 1, + .port1_active = 1, + .port2_active = 1, + .port2_invert_for_secam_lc = 1, }, }; diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index c2b7561..936e3f7 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -14,7 +14,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 30f8d80..d95529e 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c @@ -73,14 +73,14 @@ static struct HAUPPAUGE_TUNER_FMT } hauppauge_tuner_fmt[] = { - { V4L2_STD_UNKNOWN," UNKNOWN" }, - { V4L2_STD_UNKNOWN," FM" }, - { V4L2_STD_PAL_BG, " PAL(B/G)" }, - { V4L2_STD_NTSC_M, " NTSC(M)" }, - { V4L2_STD_PAL_I, " PAL(I)" }, - { V4L2_STD_SECAM_L," SECAM(L/L')" }, - { V4L2_STD_PAL_DK, " PAL(D/D1/K)" }, - { V4L2_STD_ATSC, " ATSC/DVB Digital" }, + { V4L2_STD_UNKNOWN, " UNKNOWN" }, + { V4L2_STD_UNKNOWN, " FM" }, + { V4L2_STD_B|V4L2_STD_GH, " PAL(B/G)" }, + { V4L2_STD_MN, " NTSC(M)" }, + { V4L2_STD_PAL_I, " PAL(I)" }, + { V4L2_STD_SECAM_L|V4L2_STD_SECAM_LC, " SECAM(L/L')" }, + { V4L2_STD_DK, " PAL(D/D1/K)" }, + { V4L2_STD_ATSC, " ATSC/DVB Digital" }, }; /* This is the full list of possible tuners. Many thanks to Hauppauge for @@ -219,7 +219,7 @@ hauppauge_tuner[] = { TUNER_ABSENT, "Thompson DTT75105"}, { TUNER_ABSENT, "Conexant_CX24109"}, { TUNER_TCL_2002N, "TCL M2523_5N_E"}, - { TUNER_ABSENT, "TCL M2523_3DB_E"}, + { TUNER_TCL_2002MB, "TCL M2523_3DB_E"}, { TUNER_ABSENT, "Philips 8275A"}, { TUNER_ABSENT, "Microtune MT2060"}, { TUNER_ABSENT, "Philips FM1236 MK5"}, diff --git a/drivers/media/video/usbvideo/usbvideo.h b/drivers/media/video/usbvideo/usbvideo.h index 49dbee5..051775d 100644 --- a/drivers/media/video/usbvideo/usbvideo.h +++ b/drivers/media/video/usbvideo/usbvideo.h @@ -16,7 +16,6 @@ #ifndef usbvideo_h #define usbvideo_h -#include <linux/config.h> #include <linux/videodev.h> #include <media/v4l2-common.h> #include <linux/usb.h> diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 19d3c20..d83a2c8 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -16,7 +16,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 97f946db..f06dc19 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -44,7 +44,6 @@ * Added Gerd Knorrs v4l1 enhancements (Justin Schoeman) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c index 8f271de..2ae3fb2 100644 --- a/drivers/media/video/videocodec.c +++ b/drivers/media/video/videocodec.c @@ -36,7 +36,6 @@ #include <linux/slab.h> // kernel config is here (procfs flag) -#include <linux/config.h> #ifdef CONFIG_PROC_FS #include <linux/proc_fs.h> diff --git a/drivers/media/video/videocodec.h b/drivers/media/video/videocodec.h index 8c23372..97a3bbe 100644 --- a/drivers/media/video/videocodec.h +++ b/drivers/media/video/videocodec.h @@ -222,14 +222,14 @@ M zr36055[1] 0001 0000c001 00000000 (zr36050[1]) /* ========================= */ struct vfe_polarity { - int vsync_pol:1; - int hsync_pol:1; - int field_pol:1; - int blank_pol:1; - int subimg_pol:1; - int poe_pol:1; - int pvalid_pol:1; - int vclk_pol:1; + unsigned int vsync_pol:1; + unsigned int hsync_pol:1; + unsigned int field_pol:1; + unsigned int blank_pol:1; + unsigned int subimg_pol:1; + unsigned int poe_pol:1; + unsigned int pvalid_pol:1; + unsigned int vclk_pol:1; }; struct vfe_settings { diff --git a/drivers/media/video/w9968cf.h b/drivers/media/video/w9968cf.h index 2836b45..ec7696e 100644 --- a/drivers/media/video/w9968cf.h +++ b/drivers/media/video/w9968cf.h @@ -28,7 +28,6 @@ #include <linux/spinlock.h> #include <linux/list.h> #include <linux/wait.h> -#include <linux/config.h> #include <linux/param.h> #include <linux/types.h> #include <linux/rwsem.h> diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index 958c1e6..33b32f3 100644 --- a/drivers/media/video/zoran_card.c +++ b/drivers/media/video/zoran_card.c @@ -29,7 +29,6 @@ #include <linux/delay.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c index 02168d9..3cbac2e 100644 --- a/drivers/media/video/zoran_device.c +++ b/drivers/media/video/zoran_device.c @@ -27,7 +27,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index 9711f62..d9a5876 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c @@ -44,7 +44,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/version.h> #include <linux/init.h> #include <linux/module.h> diff --git a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c index f4ffe79..c7f6f64 100644 --- a/drivers/media/video/zoran_procfs.c +++ b/drivers/media/video/zoran_procfs.c @@ -27,7 +27,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/media/video/zr36120_mem.c b/drivers/media/video/zr36120_mem.c index c87113d..416eaa9 100644 --- a/drivers/media/video/zr36120_mem.c +++ b/drivers/media/video/zr36120_mem.c @@ -18,7 +18,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/mm.h> #include <linux/pci.h> #include <linux/slab.h> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 12dd8d4..2544fc7 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -46,7 +46,6 @@ */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/errno.h> @@ -5592,7 +5591,7 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) /* The SCSI driver needs to adjust timeouts on all current * commands prior to the diagnostic reset being issued. - * Prevents timeouts occuring during a diagnostic reset...very bad. + * Prevents timeouts occurring during a diagnostic reset...very bad. * For all other protocol drivers, this is a no-op. */ { diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 4720f9a..32ae4d66 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -49,7 +49,6 @@ #define MPTBASE_H_INCLUDED /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/message/i2o/debug.c b/drivers/message/i2o/debug.c index 5a6cca8..8abe45e 100644 --- a/drivers/message/i2o/debug.c +++ b/drivers/message/i2o/debug.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index c8426a9..6fe2ff5 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -16,7 +16,6 @@ * Note that all locks are private to this file. Nothing else may * touch them. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 79fd062..0277681 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c @@ -17,7 +17,6 @@ * pin should provide pulses even when the LCD is blanked, otherwise * a pen touch needed to unblank the LCD will never be read. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h index 6aba419..634d538 100644 --- a/drivers/misc/ibmasm/ibmasm.h +++ b/drivers/misc/ibmasm/ibmasm.h @@ -29,7 +29,6 @@ #include <linux/wait.h> #include <linux/spinlock.h> #include <linux/slab.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/device.h> diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c index 3228516..075a2a0 100644 --- a/drivers/mmc/at91_mci.c +++ b/drivers/mmc/at91_mci.c @@ -53,7 +53,6 @@ Gets the status of the write protect pin, if available. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 5dc4bee..4106990 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c @@ -34,7 +34,6 @@ * So we use the timer to check the status manually. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/platform_device.h> diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index 5c62f4e..7ca9e95 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c @@ -25,7 +25,6 @@ * deficiencies * */ -#include <linux/config.h> #ifdef CONFIG_MMC_DEBUG #define DEBUG diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 6201f30..247ff2f 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -9,7 +9,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 8576a65..9dfb34a 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c @@ -7,7 +7,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index c25244b..7a4840e 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index b49368f..ef35090 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c @@ -16,7 +16,6 @@ * 1 and 3 byte data transfers not supported * max block length up to 1023 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/ioport.h> diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 8167332..3fcd86c 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -21,7 +21,6 @@ * - On APIC systems the FIFO empty interrupt is sometimes lost. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 1e01ad3..9885726 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index 4bf9f8c..60e11a0 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -4,7 +4,6 @@ $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/chips/chipreg.c b/drivers/mtd/chips/chipreg.c index c212784..2174c9754 100644 --- a/drivers/mtd/chips/chipreg.c +++ b/drivers/mtd/chips/chipreg.c @@ -6,7 +6,6 @@ */ #include <linux/kernel.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/kmod.h> #include <linux/spinlock.h> diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index 517ea33..8f39d0a 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c @@ -8,7 +8,6 @@ Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index be3f1c1..ede3561 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -8,7 +8,6 @@ * * Licence: GPL */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/blkdev.h> diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 593bb03..78872c3 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c @@ -40,7 +40,6 @@ */ #define DOC_SINGLE_DRIVER -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <asm/errno.h> diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 04271d0..5db7160 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -9,7 +9,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index b4438ea..e427c82 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c @@ -10,7 +10,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/ioport.h> diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 30f07b4..6f9bbf6 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -82,7 +82,6 @@ * * Comb the init routine. It's still a bit cludgy on a few things. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <asm/uaccess.h> diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index 1e21a2c..4116535 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c @@ -24,7 +24,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h> diff --git a/drivers/mtd/maps/alchemy-flash.c b/drivers/mtd/maps/alchemy-flash.c index b933a2a..7fc8097 100644 --- a/drivers/mtd/maps/alchemy-flash.c +++ b/drivers/mtd/maps/alchemy-flash.c @@ -7,7 +7,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/types.h> diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index a505870..447955b 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c @@ -14,7 +14,6 @@ #include <linux/mtd/map.h> #include <linux/mtd/cfi.h> #include <linux/mtd/flashchip.h> -#include <linux/config.h> #include <linux/pci.h> #include <linux/pci_ids.h> #include <linux/list.h> diff --git a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c index 5a95ab3..0402c21 100644 --- a/drivers/mtd/maps/ceiva.c +++ b/drivers/mtd/maps/ceiva.c @@ -14,7 +14,6 @@ * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/ioport.h> diff --git a/drivers/mtd/maps/cstm_mips_ixx.c b/drivers/mtd/maps/cstm_mips_ixx.c index a370953..aa56def 100644 --- a/drivers/mtd/maps/cstm_mips_ixx.c +++ b/drivers/mtd/maps/cstm_mips_ixx.c @@ -38,7 +38,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <linux/delay.h> #if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR) diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c index 85c2a9e..92a9c7f 100644 --- a/drivers/mtd/maps/dbox2-flash.c +++ b/drivers/mtd/maps/dbox2-flash.c @@ -12,7 +12,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <linux/errno.h> /* partition_info gives details on the logical partitions that the split the diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index 8b3784e..b32bb93 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c @@ -7,7 +7,6 @@ * * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c index c299d10..b1104fe 100644 --- a/drivers/mtd/maps/dilnetpc.c +++ b/drivers/mtd/maps/dilnetpc.c @@ -25,7 +25,6 @@ * and http://www.ssv-embedded.de/ssv/pc104/p170.htm */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/dmv182.c b/drivers/mtd/maps/dmv182.c index 2bb3c0f..a43c499 100644 --- a/drivers/mtd/maps/dmv182.c +++ b/drivers/mtd/maps/dmv182.c @@ -16,7 +16,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> diff --git a/drivers/mtd/maps/ebony.c b/drivers/mtd/maps/ebony.c index 60a6e51..641e1dd 100644 --- a/drivers/mtd/maps/ebony.c +++ b/drivers/mtd/maps/ebony.c @@ -20,7 +20,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <asm/io.h> #include <asm/ibm44x.h> #include <platforms/4xx/ebony.h> diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c index b48a347..1c5b97c 100644 --- a/drivers/mtd/maps/edb7312.c +++ b/drivers/mtd/maps/edb7312.c @@ -17,7 +17,6 @@ #include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> -#include <linux/config.h> #ifdef CONFIG_MTD_PARTITIONS #include <linux/mtd/partitions.h> diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c index 0667101..6dde318 100644 --- a/drivers/mtd/maps/h720x-flash.c +++ b/drivers/mtd/maps/h720x-flash.c @@ -8,7 +8,6 @@ * 2003 Thomas Gleixner <tglx@linutronix.de> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c index 1673279..db4b570 100644 --- a/drivers/mtd/maps/ichxrom.c +++ b/drivers/mtd/maps/ichxrom.c @@ -14,7 +14,6 @@ #include <linux/mtd/map.h> #include <linux/mtd/cfi.h> #include <linux/mtd/flashchip.h> -#include <linux/config.h> #include <linux/pci.h> #include <linux/pci_ids.h> #include <linux/list.h> diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index ba7f403..a0b4dc7 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c @@ -17,7 +17,6 @@ #include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> -#include <linux/config.h> #ifdef CONFIG_MTD_PARTITIONS #include <linux/mtd/partitions.h> diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index a3ba52f..c8db01b 100644 --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c @@ -26,7 +26,6 @@ ======================================================================*/ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/ipaq-flash.c b/drivers/mtd/maps/ipaq-flash.c index b8ccb0a..f27c132 100644 --- a/drivers/mtd/maps/ipaq-flash.c +++ b/drivers/mtd/maps/ipaq-flash.c @@ -8,7 +8,6 @@ * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c index 851bf95..6b784ef 100644 --- a/drivers/mtd/maps/l440gx.c +++ b/drivers/mtd/maps/l440gx.c @@ -13,7 +13,6 @@ #include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> -#include <linux/config.h> #define PIIXE_IOBASE_RESOURCE 11 diff --git a/drivers/mtd/maps/lasat.c b/drivers/mtd/maps/lasat.c index c658d40..1c13d2d 100644 --- a/drivers/mtd/maps/lasat.c +++ b/drivers/mtd/maps/lasat.c @@ -19,7 +19,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <asm/lasat/lasat.h> static struct mtd_info *lasat_mtd; diff --git a/drivers/mtd/maps/mpc1211.c b/drivers/mtd/maps/mpc1211.c index 4685e8e..45a00fa 100644 --- a/drivers/mtd/maps/mpc1211.c +++ b/drivers/mtd/maps/mpc1211.c @@ -15,7 +15,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> static struct mtd_info *flash_mtd; static struct mtd_partition *parsed_parts; diff --git a/drivers/mtd/maps/mtx-1_flash.c b/drivers/mtd/maps/mtx-1_flash.c index 5c25d4e..d884f2b 100644 --- a/drivers/mtd/maps/mtx-1_flash.c +++ b/drivers/mtd/maps/mtx-1_flash.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> diff --git a/drivers/mtd/maps/ocotea.c b/drivers/mtd/maps/ocotea.c index a21fcd1..2f07602 100644 --- a/drivers/mtd/maps/ocotea.c +++ b/drivers/mtd/maps/ocotea.c @@ -18,7 +18,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <asm/io.h> #include <asm/ibm44x.h> #include <platforms/4xx/ocotea.h> diff --git a/drivers/mtd/maps/omap-toto-flash.c b/drivers/mtd/maps/omap-toto-flash.c index dc37652..e6e391e 100644 --- a/drivers/mtd/maps/omap-toto-flash.c +++ b/drivers/mtd/maps/omap-toto-flash.c @@ -8,7 +8,6 @@ * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index d6301f0..7799a25 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -18,7 +18,6 @@ #include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> -#include <linux/config.h> #include <linux/mtd/partitions.h> #include <linux/mtd/physmap.h> #include <asm/io.h> diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c index 50b1403..ec8fdae 100644 --- a/drivers/mtd/maps/redwood.c +++ b/drivers/mtd/maps/redwood.c @@ -13,7 +13,6 @@ * or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 5cefb01..950bf1c 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c @@ -5,7 +5,6 @@ * * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/ioport.h> diff --git a/drivers/mtd/maps/sbc8240.c b/drivers/mtd/maps/sbc8240.c index 350286d..7d0fcf8 100644 --- a/drivers/mtd/maps/sbc8240.c +++ b/drivers/mtd/maps/sbc8240.c @@ -18,7 +18,6 @@ * Both parts are JEDEC compatible. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c index e8c130e..9b50cfc 100644 --- a/drivers/mtd/maps/sc520cdp.c +++ b/drivers/mtd/maps/sc520cdp.c @@ -25,7 +25,6 @@ * For details see http://www.amd.com/products/epd/desiging/evalboards/18.elansc520/520_cdp_brief/index.html */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c index 97a8dfd..dcfb858 100644 --- a/drivers/mtd/maps/scb2_flash.c +++ b/drivers/mtd/maps/scb2_flash.c @@ -53,7 +53,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/cfi.h> -#include <linux/config.h> #include <linux/pci.h> #include <linux/pci_ids.h> diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c index 331a158..7391fd5 100644 --- a/drivers/mtd/maps/scx200_docflash.c +++ b/drivers/mtd/maps/scx200_docflash.c @@ -8,7 +8,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c index c53c2c3..d76ceef 100644 --- a/drivers/mtd/maps/solutionengine.c +++ b/drivers/mtd/maps/solutionengine.c @@ -16,7 +16,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <linux/errno.h> static struct mtd_info *flash_mtd; diff --git a/drivers/mtd/maps/tqm834x.c b/drivers/mtd/maps/tqm834x.c index c7ae9a5..58e5912 100644 --- a/drivers/mtd/maps/tqm834x.c +++ b/drivers/mtd/maps/tqm834x.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/types.h> diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c index a435170..19578ba 100644 --- a/drivers/mtd/maps/tqm8xxl.c +++ b/drivers/mtd/maps/tqm8xxl.c @@ -22,7 +22,6 @@ * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at * kernel configuration. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c index a7422c2..b47270e 100644 --- a/drivers/mtd/maps/ts5500_flash.c +++ b/drivers/mtd/maps/ts5500_flash.c @@ -26,7 +26,6 @@ * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $ */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index f7264dc..389fea2 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -10,7 +10,6 @@ /****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> diff --git a/drivers/mtd/maps/walnut.c b/drivers/mtd/maps/walnut.c index f46bec6..ec80eec 100644 --- a/drivers/mtd/maps/walnut.c +++ b/drivers/mtd/maps/walnut.c @@ -20,7 +20,6 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> -#include <linux/config.h> #include <asm/io.h> #include <asm/ibm4xx.h> #include <platforms/4xx/walnut.h> diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c index 60c197e..ac5b810 100644 --- a/drivers/mtd/maps/wr_sbc82xx_flash.c +++ b/drivers/mtd/maps/wr_sbc82xx_flash.c @@ -17,7 +17,6 @@ #include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> -#include <linux/config.h> #include <linux/mtd/partitions.h> #include <asm/immap_cpm2.h> diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index e5c7846..04ed3469 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c @@ -7,7 +7,6 @@ * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 9a4b59d..fb8b4f7 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/fs.h> #include <linux/init.h> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 16a952dd..168d3ba 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 77a7123..06a9303 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -16,7 +16,6 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/list.h> -#include <linux/config.h> #include <linux/kmod.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index ebd64ab..545ff25 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -25,7 +25,6 @@ * $Id: nandsim.c,v 1.8 2005/03/19 15:33:56 dedekind Exp $ */ -#include <linux/config.h> #include <linux/init.h> #include <linux/types.h> #include <linux/module.h> diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index dc75735..dd5cea8 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c @@ -11,7 +11,6 @@ #define PRERELEASE -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <asm/errno.h> diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index dc845f3..cbdae54 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -68,7 +68,6 @@ /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 10; -#include <linux/config.h> #include <linux/module.h> #ifdef CONFIG_MCA #include <linux/mca.h> diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 91d1c4c..ac60f3f 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c @@ -57,7 +57,6 @@ static int max_interrupt_work = 20; #define RX_RING_SIZE 16 #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/isapnp.h> #include <linux/kernel.h> diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index d2f8089..45125db 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -236,7 +236,6 @@ static int vortex_debug = VORTEX_DEBUG; static int vortex_debug = 1; #endif -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index d26dd6a..1d7af76 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -52,7 +52,6 @@ #define DRV_RELDATE "Mar 22, 2004" -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index ed2e3c0..d21e98f 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -93,7 +93,6 @@ #define DRV_VERSION "0.9.27" -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/compiler.h> diff --git a/drivers/net/82596.c b/drivers/net/82596.c index 8a9f7d6..7e2ca95 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c @@ -40,7 +40,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/8390.h b/drivers/net/8390.h index 51e39dc..a9a58f5 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h @@ -7,7 +7,6 @@ #ifndef _8390_h #define _8390_h -#include <linux/config.h> #include <linux/if_ether.h> #include <linux/ioport.h> #include <linux/skbuff.h> diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 60304f7..a8c245a 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -27,7 +27,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/trdevice.h> diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 71165ac..519390c 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c @@ -48,7 +48,6 @@ #include <linux/skbuff.h> #include <linux/slab.h> #include <linux/string.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/crc32.h> #include <linux/zorro.h> diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 23ff22b..c290b5a 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -50,7 +50,6 @@ * Grant Grundler <grundler@cup.hp.com>: PCI write posting fixes. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/version.h> diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index a971070..62ec8ce 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h @@ -1,7 +1,6 @@ #ifndef _ACENIC_H_ #define _ACENIC_H_ -#include <linux/config.h> /* * Generate TX index update each time, when TX ring is closed. diff --git a/drivers/net/acenic_firmware.h b/drivers/net/acenic_firmware.h index d7882dd..ec146f6 100644 --- a/drivers/net/acenic_firmware.h +++ b/drivers/net/acenic_firmware.h @@ -1,4 +1,3 @@ -#include <linux/config.h> /* * Declare these here even if Tigon I support is disabled to avoid * the compiler complaining about undefined symbols. diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index d9ba8be..c017c4f 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c @@ -69,7 +69,6 @@ Revision History: */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c index 9edaa18..1d01ac0 100644 --- a/drivers/net/appletalk/cops.c +++ b/drivers/net/appletalk/cops.c @@ -48,7 +48,6 @@ static const char *version = * the driver figure it out. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/appletalk/cops_ffdrv.h b/drivers/net/appletalk/cops_ffdrv.h index 31cf8c9..b020050 100644 --- a/drivers/net/appletalk/cops_ffdrv.h +++ b/drivers/net/appletalk/cops_ffdrv.h @@ -24,7 +24,6 @@ * - Jay Schulist <jschlst@samba.org> */ -#include <linux/config.h> #ifdef CONFIG_COPS_DAYNA diff --git a/drivers/net/appletalk/cops_ltdrv.h b/drivers/net/appletalk/cops_ltdrv.h index 4afb8e1..c699b1a 100644 --- a/drivers/net/appletalk/cops_ltdrv.h +++ b/drivers/net/appletalk/cops_ltdrv.h @@ -23,7 +23,6 @@ * - Jay Schulist <jschlst@samba.org> */ -#include <linux/config.h> #ifdef CONFIG_COPS_TANGENT diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index 1a44a79..7f7dd45 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c @@ -23,7 +23,6 @@ * of the GNU General Public License, incorporated herein by reference. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index fabc060..5a95005 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c @@ -44,7 +44,6 @@ #define VERSION "arcnet: v3.93 BETA 2000/04/29 - by Avery Pennarun et al.\n" #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/netdevice.h> diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 613005a..85493b7 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c @@ -19,7 +19,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/mii.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index e613cc2..5d7929c7 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c @@ -35,7 +35,6 @@ response to inb()s from other device probes! */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 038d5fc..55f6e3f 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -35,7 +35,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index bbca8ae..6fad83f 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c @@ -7,7 +7,6 @@ * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to * dynamic procfs inode. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 7635736..7e32d4e 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -9,7 +9,6 @@ * Written by: Michael Chan (mchan@broadcom.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -57,8 +56,8 @@ #define DRV_MODULE_NAME "bnx2" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "1.4.42" -#define DRV_MODULE_RELDATE "June 12, 2006" +#define DRV_MODULE_VERSION "1.4.43" +#define DRV_MODULE_RELDATE "June 28, 2006" #define RUN_AT(x) (jiffies + (x)) @@ -1676,7 +1675,7 @@ bnx2_tx_int(struct bnx2 *bp) tx_free_bd += last + 1; - dev_kfree_skb_irq(skb); + dev_kfree_skb(skb); hw_cons = bp->hw_tx_cons = sblk->status_tx_quick_consumer_index0; @@ -1824,7 +1823,7 @@ reuse_rx: if ((len > (bp->dev->mtu + ETH_HLEN)) && (ntohs(skb->protocol) != 0x8100)) { - dev_kfree_skb_irq(skb); + dev_kfree_skb(skb); goto next_rx; } @@ -3643,7 +3642,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp) skb_shinfo(skb)->frags[j].size, PCI_DMA_TODEVICE); } - dev_kfree_skb_any(skb); + dev_kfree_skb(skb); i += j + 1; } @@ -3669,7 +3668,7 @@ bnx2_free_rx_skbs(struct bnx2 *bp) rx_buf->skb = NULL; - dev_kfree_skb_any(skb); + dev_kfree_skb(skb); } } @@ -3999,7 +3998,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) udelay(5); pci_unmap_single(bp->pdev, map, pkt_size, PCI_DMA_TODEVICE); - dev_kfree_skb_irq(skb); + dev_kfree_skb(skb); if (bp->status_blk->status_tx_quick_consumer_index0 != bp->tx_prod) { goto loopback_test_done; @@ -4541,7 +4540,7 @@ bnx2_close(struct net_device *dev) bnx2_netif_stop(bp); del_timer_sync(&bp->timer); if (bp->flags & NO_WOL_FLAG) - reset_code = BNX2_DRV_MSG_CODE_UNLOAD; + reset_code = BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN; else if (bp->wol) reset_code = BNX2_DRV_MSG_CODE_SUSPEND_WOL; else @@ -5128,6 +5127,16 @@ bnx2_set_rx_csum(struct net_device *dev, u32 data) return 0; } +static int +bnx2_set_tso(struct net_device *dev, u32 data) +{ + if (data) + dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; + else + dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO_ECN); + return 0; +} + #define BNX2_NUM_STATS 46 static struct { @@ -5445,7 +5454,7 @@ static struct ethtool_ops bnx2_ethtool_ops = { .set_sg = ethtool_op_set_sg, #ifdef BCM_TSO .get_tso = ethtool_op_get_tso, - .set_tso = ethtool_op_set_tso, + .set_tso = bnx2_set_tso, #endif .self_test_count = bnx2_self_test_count, .self_test = bnx2_self_test, @@ -5926,7 +5935,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; #endif #ifdef BCM_TSO - dev->features |= NETIF_F_TSO; + dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN; #endif netif_carrier_off(bp->dev); @@ -5968,7 +5977,7 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state) netif_device_detach(dev); del_timer_sync(&bp->timer); if (bp->flags & NO_WOL_FLAG) - reset_code = BNX2_DRV_MSG_CODE_UNLOAD; + reset_code = BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN; else if (bp->wol) reset_code = BNX2_DRV_MSG_CODE_SUSPEND_WOL; else diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 5845e33..658c5ee 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h @@ -4174,6 +4174,7 @@ struct fw_info { #define BNX2_DRV_MSG_CODE_PULSE 0x06000000 #define BNX2_DRV_MSG_CODE_DIAG 0x07000000 #define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL 0x09000000 +#define BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN 0x0b000000 #define BNX2_DRV_MSG_DATA 0x00ff0000 #define BNX2_DRV_MSG_DATA_WAIT0 0x00010000 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8171cae..8b95123 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -33,7 +33,6 @@ //#define BONDING_DEBUG 1 -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/sched.h> diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 5a9bd95..cfe4dc3 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -20,7 +20,6 @@ * file called LICENSE. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/sched.h> diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 565a54f..b89c7bb 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c @@ -66,7 +66,6 @@ * by default, the selective clear mask is set up to process rx packets. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index bf3e7b6..5d9dd14 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h @@ -39,7 +39,6 @@ #ifndef _CXGB_COMMON_H_ #define _CXGB_COMMON_H_ -#include <linux/config.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/types.h> diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 7fe2638..c490a86 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c @@ -37,7 +37,6 @@ ****************************************************************************/ #include "common.h" -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/pci.h> diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 53efff6..87f94d9 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c @@ -39,7 +39,6 @@ #include "common.h" -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/pci.h> diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 64105e4..d3654fd 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c @@ -218,7 +218,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index ef54ebe..47eecce 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -100,7 +100,6 @@ /* Always include 'config.h' first in case the user wants to turn on or override something. */ -#include <linux/config.h> #include <linux/module.h> /* diff --git a/drivers/net/cs89x0.h b/drivers/net/cs89x0.h index bd954aa..968fe11 100644 --- a/drivers/net/cs89x0.h +++ b/drivers/net/cs89x0.h @@ -14,7 +14,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */ /* offset 2h -> Model/Product Number */ diff --git a/drivers/net/declance.c b/drivers/net/declance.c index d3d958e..2038ca7 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -42,7 +42,6 @@ * bits. macro */ -#include <linux/config.h> #include <linux/crc32.h> #include <linux/delay.h> #include <linux/errno.h> diff --git a/drivers/net/depca.c b/drivers/net/depca.c index e946c43d..b1cbe99 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c @@ -235,7 +235,6 @@ ========================================================================= */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 038447fb..2977805 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c @@ -390,7 +390,7 @@ parse_eeprom (struct net_device *dev) for (i = 0; i < 6; i++) dev->dev_addr[i] = psrom->mac_addr[i]; - /* Parse Software Infomation Block */ + /* Parse Software Information Block */ i = 0x30; psib = (u8 *) sromdata; do { diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index dd8c15a..36d5117 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -28,7 +28,6 @@ Alan Cox, 30th May 1994 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 93a2865..a1d676a 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -138,7 +138,6 @@ * - Stratus87247: protect MDI control register manipulations */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 2bc34fb..3042d33 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -34,7 +34,6 @@ #define _E1000_H_ #include <linux/stddef.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <asm/byteorder.h> diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index ecf5ad8..1e2fbbb 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -87,7 +87,6 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/ #define PKT_BUF_SZ 1536 -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index a74b207..33291bc 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c @@ -97,7 +97,6 @@ #define LOCKUP16 0 #endif -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index ee34a16..b160abe 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c @@ -114,7 +114,6 @@ static int rx_copybreak; #define TX_FIFO_THRESH 256 #define RX_FIFO_THRESH 1 /* 0-3, 0==32, 64,96, or 3==128 bytes */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/fec.c b/drivers/net/fec.c index db694c8..9b40300 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -25,7 +25,6 @@ * Copyright (c) 2004-2006 Macq Electronique SA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/fec_8xx/fec_8xx-netta.c b/drivers/net/fec_8xx/fec_8xx-netta.c index 29c275e..790d9db 100644 --- a/drivers/net/fec_8xx/fec_8xx-netta.c +++ b/drivers/net/fec_8xx/fec_8xx-netta.c @@ -2,7 +2,6 @@ * FEC instantatiation file for NETTA */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/sched.h> diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 7e43380..282b145 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c @@ -10,7 +10,6 @@ * Released under the GPL */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c index 3b44ac1..d3c16b8 100644 --- a/drivers/net/fec_8xx/fec_mii.c +++ b/drivers/net/fec_8xx/fec_mii.c @@ -10,7 +10,6 @@ * Released under the GPL */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 196298f..e96a93c 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -15,7 +15,6 @@ * kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/fs_enet/fs_enet-mii.c b/drivers/net/fs_enet/fs_enet-mii.c index 0cd0715..b7e6e21 100644 --- a/drivers/net/fs_enet/fs_enet-mii.c +++ b/drivers/net/fs_enet/fs_enet-mii.c @@ -16,7 +16,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index 95e2bb8..64e2098 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c @@ -12,7 +12,6 @@ * kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 3dad69d..e095470 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c @@ -12,7 +12,6 @@ * kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index a772b28..eaa24fa 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c @@ -12,7 +12,6 @@ * kind, whether express or implied. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c index 24a5e2e..48f9cf8 100644 --- a/drivers/net/fs_enet/mii-bitbang.c +++ b/drivers/net/fs_enet/mii-bitbang.c @@ -13,7 +13,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/net/fs_enet/mii-fixed.c b/drivers/net/fs_enet/mii-fixed.c index b3e192d..ae4a9c3 100644 --- a/drivers/net/fs_enet/mii-fixed.c +++ b/drivers/net/fs_enet/mii-fixed.c @@ -13,7 +13,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 218d317..ebbbd6c 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -64,7 +64,6 @@ * The driver then cleans up the buffer. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index 127c98c..f87bbc4 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h @@ -22,7 +22,6 @@ #ifndef __GIANFAR_H #define __GIANFAR_H -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index d69698c..e0f5052 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c @@ -15,7 +15,6 @@ * by reference. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index c6b7255..c92e659 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c @@ -16,7 +16,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c index a6d5c43..e8a18f1 100644 --- a/drivers/net/gianfar_sysfs.c +++ b/drivers/net/gianfar_sysfs.c @@ -19,7 +19,6 @@ * Sysfs file creation and management */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/gt96100eth.h b/drivers/net/gt96100eth.h index 395869c..2a833193 100644 --- a/drivers/net/gt96100eth.h +++ b/drivers/net/gt96100eth.h @@ -27,7 +27,6 @@ #ifndef _GT96100ETH_H #define _GT96100ETH_H -#include <linux/config.h> #include <asm/galileo-boards/gt96100.h> #define dbg(lvl, format, arg...) \ diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index d12605f..86b3bb9 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -12,7 +12,6 @@ * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> */ -#include <linux/config.h> #include <linux/module.h> #include <asm/system.h> #include <asm/uaccess.h> diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index cb43a9d..0641f54 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c @@ -54,7 +54,6 @@ * BPQ 004 Joerg(DL1BKE) Fixed to not lock up on ifconfig. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 3ebbbe5..d8715b2 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -16,7 +16,6 @@ * Copyright (C) 2004, 05 Ralf Baechle DL5RB <ralf@linux-mips.org> * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de> */ -#include <linux/config.h> #include <linux/module.h> #include <asm/system.h> #include <linux/bitops.h> diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 5927784..b9b10ca 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c @@ -148,7 +148,6 @@ /* ----------------------------------------------------------------------- */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index b498840..dd2f11c 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c @@ -42,7 +42,6 @@ /*****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/net.h> diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h index c2dae60..97ed22b 100644 --- a/drivers/net/ibm_emac/ibm_emac.h +++ b/drivers/net/ibm_emac/ibm_emac.h @@ -20,7 +20,6 @@ #ifndef __IBM_EMAC_H_ #define __IBM_EMAC_H_ -#include <linux/config.h> #include <linux/types.h> /* This is a simple check to prevent use of this driver on non-tested SoCs */ diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 7e49522..82468e2 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c @@ -19,7 +19,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h index f61273b..dabb94a 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.h +++ b/drivers/net/ibm_emac/ibm_emac_core.h @@ -20,7 +20,6 @@ #ifndef __IBM_EMAC_CORE_H_ #define __IBM_EMAC_CORE_H_ -#include <linux/config.h> #include <linux/netdevice.h> #include <linux/dma-mapping.h> #include <asm/ocp.h> diff --git a/drivers/net/ibm_emac/ibm_emac_debug.c b/drivers/net/ibm_emac/ibm_emac_debug.c index c7e1ecf..c364590 100644 --- a/drivers/net/ibm_emac/ibm_emac_debug.c +++ b/drivers/net/ibm_emac/ibm_emac_debug.c @@ -12,7 +12,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/net/ibm_emac/ibm_emac_debug.h b/drivers/net/ibm_emac/ibm_emac_debug.h index e85fbe0..5761389 100644 --- a/drivers/net/ibm_emac/ibm_emac_debug.h +++ b/drivers/net/ibm_emac/ibm_emac_debug.h @@ -15,7 +15,6 @@ #ifndef __IBM_EMAC_DEBUG_H_ #define __IBM_EMAC_DEBUG_H_ -#include <linux/config.h> #include <linux/init.h> #include "ibm_emac_core.h" #include "ibm_emac_mal.h" diff --git a/drivers/net/ibm_emac/ibm_emac_mal.c b/drivers/net/ibm_emac/ibm_emac_mal.c index da88d43..af50e7b 100644 --- a/drivers/net/ibm_emac/ibm_emac_mal.c +++ b/drivers/net/ibm_emac/ibm_emac_mal.c @@ -19,7 +19,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h index 2a2d3b2..f73f10a 100644 --- a/drivers/net/ibm_emac/ibm_emac_mal.h +++ b/drivers/net/ibm_emac/ibm_emac_mal.h @@ -19,7 +19,6 @@ #ifndef __IBM_EMAC_MAL_H_ #define __IBM_EMAC_MAL_H_ -#include <linux/config.h> #include <linux/init.h> #include <linux/list.h> #include <linux/netdevice.h> diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c index 67935dd..4a97024 100644 --- a/drivers/net/ibm_emac/ibm_emac_phy.c +++ b/drivers/net/ibm_emac/ibm_emac_phy.c @@ -12,7 +12,6 @@ * (c) 2004-2005, Eugene Surovegin <ebs@ebshome.net> * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.c b/drivers/net/ibm_emac/ibm_emac_rgmii.c index f0b1ffb..53d281c 100644 --- a/drivers/net/ibm_emac/ibm_emac_rgmii.c +++ b/drivers/net/ibm_emac/ibm_emac_rgmii.c @@ -16,7 +16,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/ethtool.h> #include <asm/io.h> diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h index 7f03d53..94abde5 100644 --- a/drivers/net/ibm_emac/ibm_emac_rgmii.h +++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h @@ -21,7 +21,6 @@ #ifndef _IBM_EMAC_RGMII_H_ #define _IBM_EMAC_RGMII_H_ -#include <linux/config.h> /* RGMII bridge */ struct rgmii_regs { diff --git a/drivers/net/ibm_emac/ibm_emac_tah.c b/drivers/net/ibm_emac/ibm_emac_tah.c index af08afc..e287b45 100644 --- a/drivers/net/ibm_emac/ibm_emac_tah.c +++ b/drivers/net/ibm_emac/ibm_emac_tah.c @@ -13,7 +13,6 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ -#include <linux/config.h> #include <asm/io.h> #include "ibm_emac_core.h" diff --git a/drivers/net/ibm_emac/ibm_emac_tah.h b/drivers/net/ibm_emac/ibm_emac_tah.h index 9299b5d..3815394 100644 --- a/drivers/net/ibm_emac/ibm_emac_tah.h +++ b/drivers/net/ibm_emac/ibm_emac_tah.h @@ -17,7 +17,6 @@ #ifndef _IBM_EMAC_TAH_H #define _IBM_EMAC_TAH_H -#include <linux/config.h> #include <linux/init.h> #include <asm/ocp.h> diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c index e129e0a..37dc8f3 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.c +++ b/drivers/net/ibm_emac/ibm_emac_zmii.c @@ -16,7 +16,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/ethtool.h> #include <asm/io.h> diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h index 92c8544..972e3a4 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.h +++ b/drivers/net/ibm_emac/ibm_emac_zmii.h @@ -19,7 +19,6 @@ #ifndef _IBM_EMAC_ZMII_H_ #define _IBM_EMAC_ZMII_H_ -#include <linux/config.h> #include <linux/init.h> #include <asm/ocp.h> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 4c2e727..0464e78 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -33,7 +33,6 @@ - possibly remove procfs support */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 2e222ef..3a42afa 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c @@ -27,7 +27,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index e76e6e7..dbf6775 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -30,7 +30,6 @@ #define IOC3_NAME "ioc3-eth" #define IOC3_VERSION "2.6.3-3" -#include <linux/config.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/kernel.h> diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig index d2ce489..e9e6d99 100644 --- a/drivers/net/irda/Kconfig +++ b/drivers/net/irda/Kconfig @@ -350,7 +350,7 @@ config TOSHIBA_FIR config AU1000_FIR tristate "Alchemy Au1000 SIR/FIR" - depends on MIPS_AU1000 && IRDA + depends on SOC_AU1000 && IRDA config SMC_IRCC_FIR tristate "SMSC IrCC (EXPERIMENTAL)" diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index e6b1985..7b2b413 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c @@ -18,7 +18,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 754297f..47f6f64 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c @@ -101,7 +101,7 @@ static int transceiver_type = MCS_TSC_VISHAY; module_param(transceiver_type, int, 0444); MODULE_PARM_DESC(transceiver_type, "IR transceiver type, see mcs7780.h."); -struct usb_driver mcs_driver = { +static struct usb_driver mcs_driver = { .name = "mcs7780", .probe = mcs_probe, .disconnect = mcs_disconnect, diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index e1aa991..afb19e8 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c @@ -12,7 +12,6 @@ * Infra-red driver (SIR/FIR) for the PXA2xx embedded microprocessor * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index f530686..8d5a288 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c @@ -18,7 +18,6 @@ * power_leve:level - set the transmitter power level * tx_lpm:0|1 - set transmit low power mode */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index d70b9e8..b9f28b1 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c @@ -21,7 +21,6 @@ * ********************************************************************/ -#include <linux/config.h> #include <linux/module.h> #define DRIVER_NAME "vlsi_ir" diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 93394d7..cdc1440 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -56,7 +56,6 @@ * number of packets outstanding to a remote partition at a time. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h index a83ef28..82b67af 100644 --- a/drivers/net/ixgb/ixgb.h +++ b/drivers/net/ixgb/ixgb.h @@ -30,7 +30,6 @@ #define _IXGB_H_ #include <linux/stddef.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <asm/byteorder.h> diff --git a/drivers/net/ixp2000/caleb.c b/drivers/net/ixp2000/caleb.c index 3595e10..7dea5b9 100644 --- a/drivers/net/ixp2000/caleb.c +++ b/drivers/net/ixp2000/caleb.c @@ -9,7 +9,6 @@ * (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/delay.h> #include <asm/io.h> diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c index b67f586..d3f4235 100644 --- a/drivers/net/ixp2000/enp2611.c +++ b/drivers/net/ixp2000/enp2611.c @@ -9,7 +9,6 @@ * (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/ixp2000/ixp2400-msf.c b/drivers/net/ixp2000/ixp2400-msf.c index 48a3a89..9ec38ee 100644 --- a/drivers/net/ixp2000/ixp2400-msf.c +++ b/drivers/net/ixp2000/ixp2400-msf.c @@ -11,7 +11,6 @@ * License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <asm/hardware.h> diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c index fbc2d21..99229a0 100644 --- a/drivers/net/ixp2000/ixpdev.c +++ b/drivers/net/ixp2000/ixpdev.c @@ -9,7 +9,6 @@ * (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c index 5224651..e08d3f9 100644 --- a/drivers/net/ixp2000/pm3386.c +++ b/drivers/net/ixp2000/pm3386.c @@ -9,7 +9,6 @@ * (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/netdevice.h> diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 77792b2..f2c0bf8 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c @@ -5,7 +5,6 @@ * Copyright (C) 1996 Paul Mackerras. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/mv643xx_eth.h b/drivers/net/mv643xx_eth.h index 4262c1d..33c5faf 100644 --- a/drivers/net/mv643xx_eth.h +++ b/drivers/net/mv643xx_eth.h @@ -258,7 +258,7 @@ struct pkt_info { struct sk_buff *return_info; /* User resource return information */ }; -/* Ethernet port specific infomation */ +/* Ethernet port specific information */ struct mv643xx_mib_counters { u64 good_octets_received; diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index d9f616f..1998106 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c @@ -7,7 +7,6 @@ static char version[] = "myri_sbus.c:v2.0 June 23, 2006 David S. Miller (davem@davemloft.net)\n"; #include <linux/module.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 5657049..438c63f 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c @@ -138,7 +138,6 @@ * big endian support with CFG:BEM instead of cpu_to_le32 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 706aed7..deedd7b 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -96,7 +96,6 @@ //#define dprintk printk #define dprintk(x...) do { } while (0) -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index a7bb54d..978b95a 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c @@ -85,7 +85,6 @@ IVc. Errata */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 441de82..48434d79 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c @@ -387,7 +387,10 @@ static int com20020_resume(struct pcmcia_device *link) } static struct pcmcia_device_id com20020_ids[] = { - PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf), + PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", + "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf), + PCMCIA_DEVICE_PROD_ID12("SoHard AG", + "SH ARC PCMCIA", 0xf8991729, 0x69dff0c7), PCMCIA_DEVICE_NULL }; MODULE_DEVICE_TABLE(pcmcia, com20020_ids); diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c index 7d8d534..3efb715 100644 --- a/drivers/net/phy/cicada.c +++ b/drivers/net/phy/cicada.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c index 5e9002e..aa7983f 100644 --- a/drivers/net/phy/davicom.c +++ b/drivers/net/phy/davicom.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c index 3f702c5..69d2325 100644 --- a/drivers/net/phy/lxt.c +++ b/drivers/net/phy/lxt.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index a2d6386..0ad2532 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 1b236bd..1dde390 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 33cec2d..44bcd3e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -14,7 +14,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 7da0e3d..1bc1e03 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -14,7 +14,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/phy/qsemi.c b/drivers/net/phy/qsemi.c index 65d995b..2b50e17 100644 --- a/drivers/net/phy/qsemi.c +++ b/drivers/net/phy/qsemi.c @@ -13,7 +13,6 @@ * option) any later version. * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 425ff5b..0ec6e9d 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -22,7 +22,6 @@ * ==FILEVERSION 20041108== */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/kmod.h> diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index 1985d1b..51ff9a9 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c @@ -43,7 +43,6 @@ * deprecated in 2.6 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/version.h> diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index 19c2df9..757c542 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c @@ -28,7 +28,6 @@ #define RX_DMA_SKBUFF 1 #define PKT_COPY_THRESHOLD 512 -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> diff --git a/drivers/net/rrunner.h b/drivers/net/rrunner.h index 10baae5..2c3c91e 100644 --- a/drivers/net/rrunner.h +++ b/drivers/net/rrunner.h @@ -1,7 +1,6 @@ #ifndef _RRUNNER_H_ #define _RRUNNER_H_ -#include <linux/config.h> #include <linux/interrupt.h> #if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64)) diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 3defe5d..001344c 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -44,7 +44,6 @@ * aggregated as a single large packet ************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> @@ -3960,7 +3959,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Control_2 = 0; #ifdef NETIF_F_TSO mss = skb_shinfo(skb)->gso_size; - if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) { + if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { txdp->Control_1 |= TXD_TCP_LSO_EN; txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); } @@ -3980,7 +3979,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) } frg_len = skb->len - skb->data_len; - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) { + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) { int ufo_size; ufo_size = skb_shinfo(skb)->gso_size; @@ -4009,7 +4008,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Host_Control = (unsigned long) skb; txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) txdp->Control_1 |= TXD_UFO_EN; frg_cnt = skb_shinfo(skb)->nr_frags; @@ -4024,12 +4023,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) (sp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) txdp->Control_1 |= TXD_UFO_EN; } txdp->Control_1 |= TXD_GATHER_CODE_LAST; - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) frg_cnt++; /* as Txd0 was used for inband header */ tx_fifo = mac_control->tx_FIFO_start[queue]; @@ -4043,7 +4042,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) if (mss) val64 |= TX_FIFO_SPECIAL_FUNC; #endif - if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) + if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) val64 |= TX_FIFO_SPECIAL_FUNC; writeq(val64, &tx_fifo->List_Control); @@ -7021,6 +7020,9 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) #ifdef NETIF_F_TSO dev->features |= NETIF_F_TSO; #endif +#ifdef NETIF_F_TSO6 + dev->features |= NETIF_F_TSO6; +#endif if (sp->device_type & XFRAME_II_DEVICE) { dev->features |= NETIF_F_UFO; dev->features |= NETIF_F_HW_CSUM; diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 3203732..c43f521 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -652,7 +652,7 @@ typedef struct fifo_info { nic_t *nic; }fifo_info_t; -/* Infomation related to the Tx and Rx FIFOs and Rings of Xena +/* Information related to the Tx and Rx FIFOs and Rings of Xena * is maintained in this structure. */ typedef struct mac_info { diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index f2be9f8..c7b5f00 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c @@ -31,7 +31,6 @@ #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/bitops.h> #include <asm/processor.h> /* Processor type for cache alignment. */ #include <asm/io.h> diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index 88e2120..c7832e6 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c @@ -69,7 +69,6 @@ * 2000/03 Andi Kleen */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/fcntl.h> diff --git a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c index 1778605..1e662aa 100644 --- a/drivers/net/sk98lin/skvpd.c +++ b/drivers/net/sk98lin/skvpd.c @@ -22,7 +22,7 @@ ******************************************************************************/ /* - Please refer skvpd.txt for infomation how to include this module + Please refer skvpd.txt for information how to include this module */ static const char SysKonnectFileId[] = "@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK"; diff --git a/drivers/net/skfp/h/sba.h b/drivers/net/skfp/h/sba.h index df716cd..638cf02 100644 --- a/drivers/net/skfp/h/sba.h +++ b/drivers/net/skfp/h/sba.h @@ -13,7 +13,7 @@ ******************************************************************************/ /* - * Synchronous Bandwith Allocation (SBA) structs + * Synchronous Bandwidth Allocation (SBA) structs */ #ifndef _SBA_ diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 1608efa..82df13b 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -24,7 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/in.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index e122007..3f1b0fe 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -23,7 +23,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/crc32.h> #include <linux/kernel.h> #include <linux/version.h> diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index c6fbb1e..3a1b713 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -50,7 +50,6 @@ * driver code belonging close to PPP and SLIP */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/net/slip.c b/drivers/net/slip.c index b2e18d2..1588cb7 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -55,7 +55,6 @@ */ #define SL_CHECK_TRANSMIT -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/net/slip.h b/drivers/net/slip.h index ab3efe6..29d87dd 100644 --- a/drivers/net/slip.h +++ b/drivers/net/slip.h @@ -22,7 +22,6 @@ #ifndef _LINUX_SLIP_H #define _LINUX_SLIP_H -#include <linux/config.h> #if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED) # define SL_INCLUDE_CSLIP diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index 5b4e852..4544935 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c @@ -57,7 +57,6 @@ static const char version[] = "smc-ultra.c:v2.02 2/3/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n"; -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 0e9833a..3d8dcb6 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -66,7 +66,6 @@ static const char version[] = #endif -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/net/sonic.h b/drivers/net/sonic.h index cede969a..7f5c4eb 100644 --- a/drivers/net/sonic.h +++ b/drivers/net/sonic.h @@ -22,7 +22,6 @@ #ifndef SONIC_H #define SONIC_H -#include <linux/config.h> /* * SONIC register offsets diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 394339d..e0b7267 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -21,7 +21,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/compiler.h> #include <linux/crc32.h> #include <linux/delay.h> diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index c158eed..f91be95 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c @@ -146,7 +146,6 @@ TODO: - fix forced speed/duplexing code (broken a long time ago, when #define DRV_VERSION "1.03+LK1.4.2.1" #define DRV_RELDATE "October 3, 2005" -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/net/stnic.c b/drivers/net/stnic.c index b6dfdf8..7422834 100644 --- a/drivers/net/stnic.c +++ b/drivers/net/stnic.c @@ -7,7 +7,6 @@ * Copyright (C) 1999 kaz Kojima */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index 9282b4b..278c7cb 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c @@ -19,7 +19,6 @@ * of darwin, still need to reverse engineer that */ -#include <linux/config.h> #include <linux/module.h> diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index c33ead3..d85b832 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -13,7 +13,6 @@ * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> @@ -2523,7 +2522,7 @@ static struct ethtool_ops hme_ethtool_ops = { static int hme_version_printed; #ifdef CONFIG_SBUS -void __init quattro_get_ranges(struct quattro *qp) +void __devinit quattro_get_ranges(struct quattro *qp) { struct sbus_dev *sdev = qp->quattro_dev; int err; @@ -2539,7 +2538,7 @@ void __init quattro_get_ranges(struct quattro *qp) qp->nranges = (err / sizeof(struct linux_prom_ranges)); } -static void __init quattro_apply_ranges(struct quattro *qp, struct happy_meal *hp) +static void __devinit quattro_apply_ranges(struct quattro *qp, struct happy_meal *hp) { struct sbus_dev *sdev = hp->happy_dev; int rng; @@ -2566,7 +2565,7 @@ static void __init quattro_apply_ranges(struct quattro *qp, struct happy_meal *h * * Return NULL on failure. */ -static struct quattro * __init quattro_sbus_find(struct sbus_dev *goal_sdev) +static struct quattro * __devinit quattro_sbus_find(struct sbus_dev *goal_sdev) { struct sbus_dev *sdev; struct quattro *qp; @@ -2618,7 +2617,7 @@ static void __init quattro_sbus_register_irqs(void) } } -static void __devexit quattro_sbus_free_irqs(void) +static void quattro_sbus_free_irqs(void) { struct quattro *qp; @@ -2662,7 +2661,7 @@ static struct quattro * __init quattro_pci_find(struct pci_dev *pdev) #endif /* CONFIG_PCI */ #ifdef CONFIG_SBUS -static int __init happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe) +static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe) { struct device_node *dp = sdev->ofdev.node; struct quattro *qp = NULL; diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h index 9b7ccae..90f446d 100644 --- a/drivers/net/sunhme.h +++ b/drivers/net/sunhme.h @@ -8,7 +8,6 @@ #ifndef _SUNHME_H #define _SUNHME_H -#include <linux/config.h> #include <linux/pci.h> /* Happy Meal global registers. */ diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 2c239ab..5b0b60f4 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -71,7 +71,6 @@ static char lancestr[] = "LANCE"; -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 35f9316..953255e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -15,7 +15,6 @@ * notice is accompanying it. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -69,8 +68,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.60" -#define DRV_MODULE_RELDATE "June 17, 2006" +#define DRV_MODULE_VERSION "3.61" +#define DRV_MODULE_RELDATE "June 29, 2006" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -3195,7 +3194,7 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) */ static int tg3_rx(struct tg3 *tp, int budget) { - u32 work_mask; + u32 work_mask, rx_std_posted = 0; u32 sw_idx = tp->rx_rcb_ptr; u16 hw_idx; int received; @@ -3222,6 +3221,7 @@ static int tg3_rx(struct tg3 *tp, int budget) mapping); skb = tp->rx_std_buffers[desc_idx].skb; post_ptr = &tp->rx_std_ptr; + rx_std_posted++; } else if (opaque_key == RXD_OPAQUE_RING_JUMBO) { dma_addr = pci_unmap_addr(&tp->rx_jumbo_buffers[desc_idx], mapping); @@ -3309,6 +3309,15 @@ static int tg3_rx(struct tg3 *tp, int budget) next_pkt: (*post_ptr)++; + + if (unlikely(rx_std_posted >= tp->rx_std_max_post)) { + u32 idx = *post_ptr % TG3_RX_RING_SIZE; + + tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + + TG3_64BIT_REG_LOW, idx); + work_mask &= ~RXD_OPAQUE_RING_STD; + rx_std_posted = 0; + } next_pkt_nopost: sw_idx++; sw_idx %= TG3_RX_RCB_RING_SIZE(tp); @@ -3870,6 +3879,40 @@ out_unlock: return NETDEV_TX_OK; } +#if TG3_TSO_SUPPORT != 0 +static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *); + +/* Use GSO to workaround a rare TSO bug that may be triggered when the + * TSO header is greater than 80 bytes. + */ +static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) +{ + struct sk_buff *segs, *nskb; + + /* Estimate the number of fragments in the worst case */ + if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->gso_segs * 3))) { + netif_stop_queue(tp->dev); + return NETDEV_TX_BUSY; + } + + segs = skb_gso_segment(skb, tp->dev->features & ~NETIF_F_TSO); + if (unlikely(IS_ERR(segs))) + goto tg3_tso_bug_end; + + do { + nskb = segs; + segs = segs->next; + nskb->next = NULL; + tg3_start_xmit_dma_bug(nskb, tp->dev); + } while (segs); + +tg3_tso_bug_end: + dev_kfree_skb(skb); + + return NETDEV_TX_OK; +} +#endif + /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and * support TG3_FLG2_HW_TSO_1 or firmware TSO only. */ @@ -3906,7 +3949,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) mss = 0; if (skb->len > (tp->dev->mtu + ETH_HLEN) && (mss = skb_shinfo(skb)->gso_size) != 0) { - int tcp_opt_len, ip_tcp_len; + int tcp_opt_len, ip_tcp_len, hdr_len; if (skb_header_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { @@ -3917,11 +3960,16 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) tcp_opt_len = ((skb->h.th->doff - 5) * 4); ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); + hdr_len = ip_tcp_len + tcp_opt_len; + if (unlikely((ETH_HLEN + hdr_len) > 80) && + (tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG)) + return (tg3_tso_bug(tp, skb)); + base_flags |= (TXD_FLAG_CPU_PRE_DMA | TXD_FLAG_CPU_POST_DMA); skb->nh.iph->check = 0; - skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); + skb->nh.iph->tot_len = htons(mss + hdr_len); if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { skb->h.th->check = 0; base_flags &= ~TXD_FLAG_TCPUDP_CSUM; @@ -5981,7 +6029,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) } /* Setup replenish threshold. */ - tw32(RCVBDI_STD_THRESH, tp->rx_pending / 8); + val = tp->rx_pending / 8; + if (val == 0) + val = 1; + else if (val > tp->rx_std_max_post) + val = tp->rx_std_max_post; + + tw32(RCVBDI_STD_THRESH, val); /* Initialize TG3_BDINFO's at: * RCVDBDI_STD_BD: standard eth size rx ring @@ -6141,8 +6195,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) #endif /* Receive/send statistics. */ - if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && - (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { + if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { + val = tr32(RCVLPC_STATS_ENABLE); + val &= ~RCVLPC_STATSENAB_DACK_FIX; + tw32(RCVLPC_STATS_ENABLE, val); + } else if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && + (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { val = tr32(RCVLPC_STATS_ENABLE); val &= ~RCVLPC_STATSENAB_LNGBRST_RFIX; tw32(RCVLPC_STATS_ENABLE, val); @@ -8738,6 +8796,9 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) { struct tg3 *tp = netdev_priv(dev); + if (netif_running(dev)) + tg3_netif_stop(tp); + tg3_full_lock(tp, 0); tp->vlgrp = grp; @@ -8746,16 +8807,25 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) __tg3_set_rx_mode(dev); tg3_full_unlock(tp); + + if (netif_running(dev)) + tg3_netif_start(tp); } static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) { struct tg3 *tp = netdev_priv(dev); + if (netif_running(dev)) + tg3_netif_stop(tp); + tg3_full_lock(tp, 0); if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; tg3_full_unlock(tp); + + if (netif_running(dev)) + tg3_netif_start(tp); } #endif @@ -10160,8 +10230,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; - } else - tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1; + } else { + tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | + TG3_FLG2_HW_TSO_1_BUG; + if (GET_ASIC_REV(tp->pci_chip_rev_id) == + ASIC_REV_5750 && + tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2) + tp->tg3_flags2 &= ~TG3_FLG2_HW_TSO_1_BUG; + } } if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 && @@ -10533,6 +10609,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) (tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) tp->rx_offset = 0; + tp->rx_std_max_post = TG3_RX_RING_SIZE; + + /* Increment the rx prod index on the rx std ring by at most + * 8 for these chips to workaround hw errata. + */ + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) + tp->rx_std_max_post = 8; + /* By default, disable wake-on-lan. User can change this * using ETHTOOL_SWOL. */ diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 8209da5..ba2c987 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h @@ -125,6 +125,7 @@ #define CHIPREV_ID_5750_A0 0x4000 #define CHIPREV_ID_5750_A1 0x4001 #define CHIPREV_ID_5750_A3 0x4003 +#define CHIPREV_ID_5750_C2 0x4202 #define CHIPREV_ID_5752_A0_HW 0x5000 #define CHIPREV_ID_5752_A0 0x6000 #define CHIPREV_ID_5752_A1 0x6001 @@ -760,6 +761,7 @@ #define RCVLPC_STATSCTRL_ENABLE 0x00000001 #define RCVLPC_STATSCTRL_FASTUPD 0x00000002 #define RCVLPC_STATS_ENABLE 0x00002018 +#define RCVLPC_STATSENAB_DACK_FIX 0x00040000 #define RCVLPC_STATSENAB_LNGBRST_RFIX 0x00400000 #define RCVLPC_STATS_INCMASK 0x0000201c /* 0x2020 --> 0x2100 unused */ @@ -2137,6 +2139,7 @@ struct tg3 { struct tg3_rx_buffer_desc *rx_std; struct ring_info *rx_std_buffers; dma_addr_t rx_std_mapping; + u32 rx_std_max_post; struct tg3_rx_buffer_desc *rx_jumbo; struct ring_info *rx_jumbo_buffers; @@ -2191,7 +2194,7 @@ struct tg3 { #define TG3_FLAG_INIT_COMPLETE 0x80000000 u32 tg3_flags2; #define TG3_FLG2_RESTART_TIMER 0x00000001 -/* 0x00000002 available */ +#define TG3_FLG2_HW_TSO_1_BUG 0x00000002 #define TG3_FLG2_NO_ETH_WIRE_SPEED 0x00000004 #define TG3_FLG2_IS_5788 0x00000008 #define TG3_FLG2_MAX_RXPEND_64 0x00000010 diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 41e0cd8..77bb298 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c @@ -42,7 +42,6 @@ #define XL_DEBUG 0 -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index c58a4c3..30dcdae 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c @@ -100,7 +100,6 @@ #define STREAMER_IOCTL 0 -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index c3cb8d2..d7a30d9 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c @@ -80,7 +80,6 @@ #define OLYMPIC_DEBUG 0 -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 67d2b59..f2807ab 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -29,7 +29,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/fcntl.h> diff --git a/drivers/net/tokenring/smctr_firmware.h b/drivers/net/tokenring/smctr_firmware.h index 48994b0..292e50ddf 100644 --- a/drivers/net/tokenring/smctr_firmware.h +++ b/drivers/net/tokenring/smctr_firmware.h @@ -17,7 +17,6 @@ * - Jay Schulist <jschlst@samba.org> */ -#include <linux/config.h> #if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE) diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index fc2468e..354294c 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -31,7 +31,6 @@ #define DRV_VERSION "0.7" #define DRV_RELDATE "Mar 17, 2004" -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index da8bd0d..2647a5b 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -443,7 +443,6 @@ ========================================================================= */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index da4f759..99ccf2e 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c @@ -16,7 +16,6 @@ #include <linux/pci.h> #include "tulip.h" -#include <linux/config.h> #include <linux/etherdevice.h> int tulip_rx_copybreak; diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h index d25020d..3bcfbf3 100644 --- a/drivers/net/tulip/tulip.h +++ b/drivers/net/tulip/tulip.h @@ -16,7 +16,6 @@ #ifndef __NET_TULIP_H__ #define __NET_TULIP_H__ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/spinlock.h> diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 53fd9b5..8f4f484 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -14,7 +14,6 @@ */ -#include <linux/config.h> #define DRV_NAME "tulip" #ifdef CONFIG_TULIP_NAPI diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index 887d724..aecafda 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c @@ -98,7 +98,6 @@ static int csr0 = 0x00A00000 | 0x4800; /* PCI registers */ #define PCI_POWERMGMT 0x40 -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 732c5ed..329d9fe 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -39,7 +39,6 @@ #define DRV_DESCRIPTION "Universal TUN/TAP device driver" #define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>" -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/kernel.h> diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 09e05fe..857d71c 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -47,7 +47,6 @@ #include <linux/module.h> #include <linux/types.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/errno.h> @@ -65,7 +64,6 @@ #include <linux/wait.h> #include <asm/io.h> #include <linux/if.h> -#include <linux/config.h> #include <asm/uaccess.h> #include <linux/proc_fs.h> #include <linux/inetdevice.h> diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index be5e3381..1f95b48 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -79,7 +79,6 @@ /* ---------- Headers, macros, data structures ---------- */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c index 57f9538..b7da551 100644 --- a/drivers/net/wan/hdlc_generic.c +++ b/drivers/net/wan/hdlc_generic.c @@ -22,7 +22,6 @@ * - proto.start() and stop() are called with spin_lock_irq held. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index af8b55f..ae01555 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c @@ -1,6 +1,5 @@ /* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/timer.h> diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 175ba13..f2d0712 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c @@ -37,7 +37,6 @@ * Known problem: this driver wasn't tested on multiprocessor machine. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ptrace.h> diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 2d1bba0..c13b459 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c @@ -37,7 +37,6 @@ */ #undef DEBUG -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 4069b79..89328d1 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -19,7 +19,6 @@ ======================================================================*/ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index af0cbb6..ac9437d 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c @@ -20,7 +20,6 @@ ======================================================================*/ -#include <linux/config.h> #ifdef __IN_PCMCIA_PACKAGE__ #include <pcmcia/k_compat.h> #endif diff --git a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c index 7b321f7..38fac3b 100644 --- a/drivers/net/wireless/airport.c +++ b/drivers/net/wireless/airport.c @@ -14,7 +14,6 @@ #define DRIVER_NAME "airport" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index bed6823..bb6bea4 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c @@ -5,7 +5,6 @@ * This module provides support for the Arlan 655 card made by Aironet */ -#include <linux/config.h> #include "arlan.h" #if BITS_PER_LONG != 32 diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c index a2cca52..5fa9854 100644 --- a/drivers/net/wireless/arlan-proc.c +++ b/drivers/net/wireless/arlan-proc.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include "arlan.h" #include <linux/sysctl.h> diff --git a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h index 70a6d7b..3ed1df7 100644 --- a/drivers/net/wireless/arlan.h +++ b/drivers/net/wireless/arlan.h @@ -5,7 +5,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/skbuff.h> diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 8606c88..54e31fa 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c @@ -39,7 +39,6 @@ ******************************************************************************/ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 26bf112..7856640 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c @@ -29,7 +29,6 @@ ******************************************************************************/ -#include <linux/config.h> #ifdef __IN_PCMCIA_PACKAGE__ #include <pcmcia/k_compat.h> #endif diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c index a61b3bc..d425c3c 100644 --- a/drivers/net/wireless/atmel_pci.c +++ b/drivers/net/wireless/atmel_pci.c @@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ -#include <linux/config.h> #include <linux/pci.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/net/wireless/hermes.c b/drivers/net/wireless/hermes.c index 2aa2f38..29d3910 100644 --- a/drivers/net/wireless/hermes.c +++ b/drivers/net/wireless/hermes.c @@ -38,7 +38,6 @@ * under either the MPL or the GPL. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index db03dc2..52e6df5 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c @@ -1,6 +1,5 @@ #define PRISM2_PCCARD -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/if.h> @@ -844,7 +843,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = { PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001), PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), - PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), +/* PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), conflict with pcnet_cs */ PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 328e9a1..b764cfd 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c @@ -30,7 +30,6 @@ */ -#include <linux/config.h> #include <asm/delay.h> #include <asm/uaccess.h> diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 93786f4..53374fc 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c @@ -12,7 +12,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index 194f070..5ea8ac8 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c @@ -4,7 +4,6 @@ * driver patches from Reyk Floeter <reyk@vantronix.net> and * Andy Warner <andyw@pobox.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/if.h> diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c index edaaa94..4ee6abb 100644 --- a/drivers/net/wireless/hostap/hostap_plx.c +++ b/drivers/net/wireless/hostap/hostap_plx.c @@ -7,7 +7,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/if.h> diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 94aeb23..27f744e 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -134,7 +134,6 @@ that only one external action is invoked at a time. */ #include <linux/compiler.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/if_arp.h> #include <linux/in6.h> @@ -5358,7 +5357,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv, idx, keylen, len); /* NOTE: We don't check cached values in case the firmware was reset - * or some other problem is occuring. If the user is setting the key, + * or some other problem is occurring. If the user is setting the key, * then we push the change */ wep_key->idx = idx; diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index ea12ad6..8b1cd7c 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h @@ -31,7 +31,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/mutex.h> diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 9343d97..36b5e00 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c @@ -37,7 +37,6 @@ /* To have statistics (just packets sent) define this */ #undef NETWAVE_STATS -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 8a31b59..d6ed578 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -76,7 +76,6 @@ #define DRIVER_NAME "orinoco" -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index b2aec4d..bc14689 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c @@ -13,7 +13,6 @@ #define DRIVER_NAME "orinoco_cs" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c index 74b9d5b..4597fe1 100644 --- a/drivers/net/wireless/orinoco_nortel.c +++ b/drivers/net/wireless/orinoco_nortel.c @@ -40,7 +40,6 @@ #define DRIVER_NAME "orinoco_nortel" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c index 1c105f4..de3eae0 100644 --- a/drivers/net/wireless/orinoco_pci.c +++ b/drivers/net/wireless/orinoco_pci.c @@ -44,7 +44,6 @@ #define DRIVER_NAME "orinoco_pci" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c index 84f696c..3f928b8 100644 --- a/drivers/net/wireless/orinoco_plx.c +++ b/drivers/net/wireless/orinoco_plx.c @@ -86,7 +86,6 @@ #define DRIVER_NAME "orinoco_plx" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c index d2b4dec..160a642 100644 --- a/drivers/net/wireless/orinoco_tmd.c +++ b/drivers/net/wireless/orinoco_tmd.c @@ -40,7 +40,6 @@ #define DRIVER_NAME "orinoco_tmd" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index 6a60c59..2e061a8 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c @@ -18,7 +18,6 @@ * */ -#include <linux/config.h> #include <linux/netdevice.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/net/wireless/prism54/prismcompat.h b/drivers/net/wireless/prism54/prismcompat.h index 55541c0..d71eca5 100644 --- a/drivers/net/wireless/prism54/prismcompat.h +++ b/drivers/net/wireless/prism54/prismcompat.h @@ -29,7 +29,6 @@ #include <linux/device.h> #include <linux/firmware.h> -#include <linux/config.h> #include <linux/moduleparam.h> #include <linux/workqueue.h> #include <linux/compiler.h> diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index a915fe6..61b83a5 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -30,7 +30,6 @@ * =============================================================================*/ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/proc_fs.h> diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index 7f9aa13..1546527 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c @@ -21,7 +21,6 @@ #define DRIVER_NAME "spectrum_cs" #define PFX DRIVER_NAME ": " -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index 18a4458..fd31885 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c @@ -81,7 +81,6 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE"; /************************************************************************/ /* Header files */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h index c65fe7a..f34a36b 100644 --- a/drivers/net/wireless/wavelan_cs.p.h +++ b/drivers/net/wireless/wavelan_cs.p.h @@ -411,7 +411,6 @@ /***************************** INCLUDES *****************************/ /* Linux headers that we need */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index e52a650..c03e400 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -28,7 +28,6 @@ */ #undef REALLY_SLOW_IO /* most systems can safely undef this */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/types.h> #include <linux/ethtool.h> diff --git a/drivers/net/znet.c b/drivers/net/znet.c index a7c089d..9f0291f 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c @@ -85,7 +85,6 @@ - Understand why some traffic patterns add a 1s latency... */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c index 14cbe34..3a0a3a7 100644 --- a/drivers/nubus/nubus.c +++ b/drivers/nubus/nubus.c @@ -7,7 +7,6 @@ * and others. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/nubus/nubus_syms.c b/drivers/nubus/nubus_syms.c index 22c1dc9..9204f04 100644 --- a/drivers/nubus/nubus_syms.c +++ b/drivers/nubus/nubus_syms.c @@ -2,7 +2,6 @@ (c) 1999 David Huggins-Daines <dhd@debian.org> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/nubus.h> diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index a5d8262..68cb3a0 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -31,7 +31,6 @@ ** the coherency design originally worked out. Only PCX-W does. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/init.h> #include <linux/mm.h> diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index ce0a6eb..0d96c50 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -43,7 +43,6 @@ ** for PCI drivers devices which implement/use MMIO registers. */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c index 5476ba7..b45aa5c 100644 --- a/drivers/parisc/gsc.c +++ b/drivers/parisc/gsc.c @@ -14,7 +14,6 @@ */ #include <linux/bitops.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 298f2dd..bf00fa2 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -23,7 +23,6 @@ * David Pye <dmp@davidmpye.dyndns.org> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/stddef.h> /* for offsetof() */ #include <linux/init.h> @@ -411,16 +410,17 @@ static __inline__ int led_get_net_activity(void) static __inline__ int led_get_diskio_activity(void) { static unsigned long last_pgpgin, last_pgpgout; - struct page_state pgstat; + unsigned long events[NR_VM_EVENT_ITEMS]; int changed; - get_full_page_state(&pgstat); /* get no of sectors in & out */ + all_vm_events(events); /* Just use a very simple calculation here. Do not care about overflow, since we only want to know if there was activity or not. */ - changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout); - last_pgpgin = pgstat.pgpgin; - last_pgpgout = pgstat.pgpgout; + changed = (events[PGPGIN] != last_pgpgin) || + (events[PGPGOUT] != last_pgpgout); + last_pgpgin = events[PGPGIN]; + last_pgpgout = events[PGPGOUT]; return (changed ? LED_DISK_IO : 0); } diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index 0bcab83..fad5a33 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -35,7 +35,6 @@ * runtime through the "/proc/sys/kernel/power" procfs entry. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index d09e39e..8b47328 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -19,7 +19,6 @@ ** FIXME: add DMA hint support programming in both sba and lba modules. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/spinlock.h> diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index 690b239..7ff09f0 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -16,7 +16,6 @@ * Various hacks, Fred Barnes <frmb2@ukc.ac.uk>, 04/2000 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/threads.h> #include <linux/parport.h> diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index d6c7765..525312f 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -14,7 +14,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/parport.h> #include <linux/delay.h> diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 7318e4a..fe800dc 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -42,7 +42,6 @@ * but rather will start at port->base_hi. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/sched.h> diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 8610ae8..2e744a2 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -13,7 +13,6 @@ */ #include <linux/string.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 2cb22c8..94dc506 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -17,7 +17,6 @@ #undef PARPORT_DEBUG_SHARING /* undef for production */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/threads.h> diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 037ce4c..30d8714 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -25,7 +25,6 @@ * Send feedback to <scottm@somanetworks.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c index 225b5e5..02be74c 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c @@ -23,7 +23,6 @@ * Send feedback to <scottm@somanetworks.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c index 2d4639d6..e847f0d 100644 --- a/drivers/pci/hotplug/cpcihp_generic.c +++ b/drivers/pci/hotplug/cpcihp_generic.c @@ -34,7 +34,6 @@ * Send feedback to <scottm@somanetworks.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c index 1ec165d..584f853 100644 --- a/drivers/pci/hotplug/cpcihp_zt5550.c +++ b/drivers/pci/hotplug/cpcihp_zt5550.c @@ -30,7 +30,6 @@ * Send feedback to <scottm@somanetworks.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index f8658d6..e6e171f 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -29,7 +29,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 55d2dc7..ae2dd36 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c @@ -26,7 +26,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index ac98a11..cf08789 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c @@ -26,7 +26,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 00b81a7..0d96889 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c @@ -26,7 +26,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c index bbfeed7..8b3da00 100644 --- a/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/drivers/pci/hotplug/cpqphp_sysfs.c @@ -26,7 +26,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 71b80c2..dd2b762 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c @@ -32,7 +32,6 @@ * Enabling PCI devices is left as an exercise for the reader... * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index c428290..b7b378d 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c index 0a46f54..8ad4466 100644 --- a/drivers/pci/hotplug/pcihp_skeleton.c +++ b/drivers/pci/hotplug/pcihp_skeleton.c @@ -28,7 +28,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index 6380045..076bd6d 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -22,7 +22,6 @@ * Send feedback to <lxie@us.ibm.com> * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 76d023d..36bc7c4 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -10,7 +10,6 @@ #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/ioport.h> #include <linux/smp_lock.h> #include <linux/pci.h> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 606f9b6..fdefa7d 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -15,7 +15,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/stat.h> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 4364d79..d1d7333 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -15,7 +15,6 @@ * use the PowerTweak utility (see http://powertweak.sourceforge.net). */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index cbb69cf..f5ee7ce 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c @@ -6,7 +6,6 @@ * * PCI ROM access routines */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/slab.h> diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index a4d5094..5256342 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -214,11 +214,10 @@ static struct pccard_operations at91_cf_ops = { /*--------------------------------------------------------------------------*/ -static int __init at91_cf_probe(struct device *dev) +static int __init at91_cf_probe(struct platform_device *pdev) { struct at91_cf_socket *cf; - struct at91_cf_data *board = dev->platform_data; - struct platform_device *pdev = to_platform_device(dev); + struct at91_cf_data *board = pdev->dev.platform_data; struct resource *io; unsigned int csa; int status; @@ -236,7 +235,7 @@ static int __init at91_cf_probe(struct device *dev) cf->board = board; cf->pdev = pdev; - dev_set_drvdata(dev, cf); + platform_set_drvdata(pdev, cf); /* CF takes over CS4, CS5, CS6 */ csa = at91_sys_read(AT91_EBI_CSA); @@ -271,6 +270,7 @@ static int __init at91_cf_probe(struct device *dev) SA_SAMPLE_RANDOM, driver_name, cf); if (status < 0) goto fail0; + device_init_wakeup(&pdev->dev, 1); /* * The card driver will request this irq later as needed. @@ -301,7 +301,7 @@ static int __init at91_cf_probe(struct device *dev) board->det_pin, board->irq_pin); cf->socket.owner = THIS_MODULE; - cf->socket.dev.dev = dev; + cf->socket.dev.dev = &pdev->dev; cf->socket.ops = &at91_cf_ops; cf->socket.resource_ops = &pccard_static_ops; cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP @@ -323,21 +323,25 @@ fail1: free_irq(board->irq_pin, cf); fail0a: free_irq(board->det_pin, cf); + device_init_wakeup(&pdev->dev, 0); fail0: at91_sys_write(AT91_EBI_CSA, csa); kfree(cf); return status; } -static int __exit at91_cf_remove(struct device *dev) +static int __exit at91_cf_remove(struct platform_device *pdev) { - struct at91_cf_socket *cf = dev_get_drvdata(dev); + struct at91_cf_socket *cf = platform_get_drvdata(pdev); + struct at91_cf_data *board = cf->board; struct resource *io = cf->socket.io[0].res; unsigned int csa; pcmcia_unregister_socket(&cf->socket); - free_irq(cf->board->irq_pin, cf); - free_irq(cf->board->det_pin, cf); + if (board->irq_pin) + free_irq(board->irq_pin, cf); + free_irq(board->det_pin, cf); + device_init_wakeup(&pdev->dev, 0); iounmap((void __iomem *) cf->socket.io_offset); release_mem_region(io->start, io->end + 1 - io->start); @@ -348,26 +352,65 @@ static int __exit at91_cf_remove(struct device *dev) return 0; } -static struct device_driver at91_cf_driver = { - .name = (char *) driver_name, - .bus = &platform_bus_type, +#ifdef CONFIG_PM + +static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg) +{ + struct at91_cf_socket *cf = platform_get_drvdata(pdev); + struct at91_cf_data *board = cf->board; + + pcmcia_socket_dev_suspend(&pdev->dev, mesg); + if (device_may_wakeup(&pdev->dev)) + enable_irq_wake(board->det_pin); + else { + disable_irq_wake(board->det_pin); + disable_irq(board->det_pin); + } + if (board->irq_pin) + disable_irq(board->irq_pin); + return 0; +} + +static int at91_cf_resume(struct platform_device *pdev) +{ + struct at91_cf_socket *cf = platform_get_drvdata(pdev); + struct at91_cf_data *board = cf->board; + + if (board->irq_pin) + enable_irq(board->irq_pin); + if (!device_may_wakeup(&pdev->dev)) + enable_irq(board->det_pin); + pcmcia_socket_dev_resume(&pdev->dev); + return 0; +} + +#else +#define at91_cf_suspend NULL +#define at91_cf_resume NULL +#endif + +static struct platform_driver at91_cf_driver = { + .driver = { + .name = (char *) driver_name, + .owner = THIS_MODULE, + }, .probe = at91_cf_probe, .remove = __exit_p(at91_cf_remove), - .suspend = pcmcia_socket_dev_suspend, - .resume = pcmcia_socket_dev_resume, + .suspend = at91_cf_suspend, + .resume = at91_cf_resume, }; /*--------------------------------------------------------------------------*/ static int __init at91_cf_init(void) { - return driver_register(&at91_cf_driver); + return platform_driver_register(&at91_cf_driver); } module_init(at91_cf_init); static void __exit at91_cf_exit(void) { - driver_unregister(&at91_cf_driver); + platform_driver_unregister(&at91_cf_driver); } module_exit(at91_cf_exit); diff --git a/drivers/pcmcia/au1000_db1x00.c b/drivers/pcmcia/au1000_db1x00.c index abc13f2..74e0515 100644 --- a/drivers/pcmcia/au1000_db1x00.c +++ b/drivers/pcmcia/au1000_db1x00.c @@ -30,7 +30,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> @@ -296,7 +295,7 @@ struct pcmcia_low_level db1x00_pcmcia_ops = { .socket_suspend = db1x00_socket_suspend }; -int __init au1x_board_init(struct device *dev) +int au1x_board_init(struct device *dev) { int ret = -ENODEV; bcsr->pcmcia = 0; /* turn off power, if it's not already off */ diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index 971a352..d5dd0ce 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c @@ -33,7 +33,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/cpufreq.h> #include <linux/ioport.h> #include <linux/kernel.h> diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h index f2c970b..1e467bb 100644 --- a/drivers/pcmcia/au1000_generic.h +++ b/drivers/pcmcia/au1000_generic.h @@ -22,7 +22,6 @@ #define __ASM_AU1000_PCMCIA_H /* include the world */ -#include <linux/config.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c index fd5522e..86c0808 100644 --- a/drivers/pcmcia/au1000_pb1x00.c +++ b/drivers/pcmcia/au1000_pb1x00.c @@ -21,7 +21,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/delay.h> diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 3162998..f9cd831 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -28,6 +28,7 @@ #include <linux/pm.h> #include <linux/pci.h> #include <linux/device.h> +#include <linux/kthread.h> #include <asm/system.h> #include <asm/irq.h> @@ -176,6 +177,7 @@ static int pccardd(void *__skt); */ int pcmcia_register_socket(struct pcmcia_socket *socket) { + struct task_struct *tsk; int ret; if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops) @@ -239,15 +241,18 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) mutex_init(&socket->skt_mutex); spin_lock_init(&socket->thread_lock); - ret = kernel_thread(pccardd, socket, CLONE_KERNEL); - if (ret < 0) + tsk = kthread_run(pccardd, socket, "pccardd"); + if (IS_ERR(tsk)) { + ret = PTR_ERR(tsk); goto err; + } wait_for_completion(&socket->thread_done); - if(!socket->thread) { + if (!socket->thread) { printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket); return -EIO; } + pcmcia_parse_events(socket, SS_DETECT); return 0; @@ -272,10 +277,8 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket) cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops); if (socket->thread) { - init_completion(&socket->thread_done); - socket->thread = NULL; wake_up(&socket->thread_wait); - wait_for_completion(&socket->thread_done); + kthread_stop(socket->thread); } release_cis_mem(socket); @@ -630,8 +633,6 @@ static int pccardd(void *__skt) DECLARE_WAITQUEUE(wait, current); int ret; - daemonize("pccardd"); - skt->thread = current; skt->socket = dead_socket; skt->ops->init(skt); @@ -643,7 +644,8 @@ static int pccardd(void *__skt) printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n", skt); skt->thread = NULL; - complete_and_exit(&skt->thread_done, 0); + complete(&skt->thread_done); + return 0; } add_wait_queue(&skt->thread_wait, &wait); @@ -674,7 +676,7 @@ static int pccardd(void *__skt) continue; } - if (!skt->thread) + if (kthread_should_stop()) break; schedule(); @@ -688,7 +690,7 @@ static int pccardd(void *__skt) /* remove from the device core */ class_device_unregister(&skt->dev); - complete_and_exit(&skt->thread_done, 0); + return 0; } /* @@ -697,11 +699,12 @@ static int pccardd(void *__skt) */ void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) { + unsigned long flags; cs_dbg(s, 4, "parse_events: events %08x\n", events); if (s->thread) { - spin_lock(&s->thread_lock); + spin_lock_irqsave(&s->thread_lock, flags); s->thread_events |= events; - spin_unlock(&s->thread_lock); + spin_unlock_irqrestore(&s->thread_lock, flags); wake_up(&s->thread_wait); } diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c index 071cf48..9e768ea 100644 --- a/drivers/pcmcia/m32r_cfc.c +++ b/drivers/pcmcia/m32r_cfc.c @@ -10,7 +10,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/fcntl.h> #include <linux/string.h> diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 70d5f07..61d50b5 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c @@ -10,7 +10,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/fcntl.h> #include <linux/string.h> diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 3131bb0..3281e51 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -788,6 +788,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) struct pcmcia_socket *s = p_dev->socket; config_t *c; int ret = CS_IN_USE, irq = 0; + int type; if (!(s->state & SOCKET_PRESENT)) return CS_NO_CARD; @@ -797,6 +798,13 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) if (c->state & CONFIG_IRQ_REQ) return CS_IN_USE; + /* Decide what type of interrupt we are registering */ + type = 0; + if (s->functions > 1) /* All of this ought to be handled higher up */ + type = SA_SHIRQ; + if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) + type = SA_SHIRQ; + #ifdef CONFIG_PCMCIA_PROBE if (s->irq.AssignedIRQ != 0) { /* If the interrupt is already assigned, it must be the same */ @@ -822,9 +830,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) * marked as used by the kernel resource management core */ ret = request_irq(irq, (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action, - ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || - (s->functions > 1) || - (irq == s->pci_irq)) ? SA_SHIRQ : 0, + type, p_dev->devname, (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); if (!ret) { @@ -839,18 +845,21 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) if (ret && !s->irq.AssignedIRQ) { if (!s->pci_irq) return ret; + type = SA_SHIRQ; irq = s->pci_irq; } - if (ret && req->Attributes & IRQ_HANDLE_PRESENT) { - if (request_irq(irq, req->Handler, - ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || - (s->functions > 1) || - (irq == s->pci_irq)) ? SA_SHIRQ : 0, - p_dev->devname, req->Instance)) + if (ret && (req->Attributes & IRQ_HANDLE_PRESENT)) { + if (request_irq(irq, req->Handler, type, p_dev->devname, req->Instance)) return CS_IN_USE; } + /* Make sure the fact the request type was overridden is passed back */ + if (type == SA_SHIRQ && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) { + req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING; + printk(KERN_WARNING "pcmcia: request for exclusive IRQ could not be fulfilled.\n"); + printk(KERN_WARNING "pcmcia: the driver needs updating to supported shared IRQ lines.\n"); + } c->irq.Attributes = req->Attributes; s->irq.AssignedIRQ = req->AssignedIRQ = irq; s->irq.Config++; diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 7fa18fb..b351813 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c @@ -18,7 +18,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/cpufreq.h> #include <linux/ioport.h> #include <linux/kernel.h> diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 6d441ec..c5b2a44 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c @@ -32,7 +32,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/platform_device.h> #include <pcmcia/cs_types.h> diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 81ded52..658cddf 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c @@ -5,7 +5,6 @@ * basically means we handle everything except controlling the * power. Power is machine specific... */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 59c5d96..31a7abc 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -32,7 +32,6 @@ #include <linux/module.h> #include <linux/init.h> -#include <linux/config.h> #include <linux/cpufreq.h> #include <linux/ioport.h> #include <linux/kernel.h> diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index ea7d9ca..ecf65d4 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -31,7 +31,6 @@ ======================================================================*/ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h index 7a3d1b8..62e9ebf 100644 --- a/drivers/pcmcia/ti113x.h +++ b/drivers/pcmcia/ti113x.h @@ -647,6 +647,7 @@ static int ti12xx_2nd_slot_empty(struct yenta_socket *socket) */ break; + case PCI_DEVICE_ID_TI_XX12: case PCI_DEVICE_ID_TI_X515: case PCI_DEVICE_ID_TI_X420: case PCI_DEVICE_ID_TI_X620: diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 4145eb8..47e5760 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -287,7 +287,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); u16 bridge; - yenta_set_power(socket, state); + /* if powering down: do it immediately */ + if (state->Vcc == 0) + yenta_set_power(socket, state); + socket->io_irq = state->io_irq; bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR); if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) { @@ -339,6 +342,10 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) /* Socket event mask: get card insert/remove events.. */ cb_writel(socket, CB_SOCKET_EVENT, -1); cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK); + + /* if powering up: do it as the last step when the socket is configured */ + if (state->Vcc != 0) + yenta_set_power(socket, state); return 0; } @@ -998,6 +1005,77 @@ static void yenta_config_init(struct yenta_socket *socket) config_writew(socket, CB_BRIDGE_CONTROL, bridge); } +/** + * yenta_fixup_parent_bridge - Fix subordinate bus# of the parent bridge + * @cardbus_bridge: The PCI bus which the CardBus bridge bridges to + * + * Checks if devices on the bus which the CardBus bridge bridges to would be + * invisible during PCI scans because of a misconfigured subordinate number + * of the parent brige - some BIOSes seem to be too lazy to set it right. + * Does the fixup carefully by checking how far it can go without conflicts. + * See http://bugzilla.kernel.org/show_bug.cgi?id=2944 for more information. + */ +static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) +{ + struct list_head *tmp; + unsigned char upper_limit; + /* + * We only check and fix the parent bridge: All systems which need + * this fixup that have been reviewed are laptops and the only bridge + * which needed fixing was the parent bridge of the CardBus bridge: + */ + struct pci_bus *bridge_to_fix = cardbus_bridge->parent; + + /* Check bus numbers are already set up correctly: */ + if (bridge_to_fix->subordinate >= cardbus_bridge->subordinate) + return; /* The subordinate number is ok, nothing to do */ + + if (!bridge_to_fix->parent) + return; /* Root bridges are ok */ + + /* stay within the limits of the bus range of the parent: */ + upper_limit = bridge_to_fix->parent->subordinate; + + /* check the bus ranges of all silbling bridges to prevent overlap */ + list_for_each(tmp, &bridge_to_fix->parent->children) { + struct pci_bus * silbling = pci_bus_b(tmp); + /* + * If the silbling has a higher secondary bus number + * and it's secondary is equal or smaller than our + * current upper limit, set the new upper limit to + * the bus number below the silbling's range: + */ + if (silbling->secondary > bridge_to_fix->subordinate + && silbling->secondary <= upper_limit) + upper_limit = silbling->secondary - 1; + } + + /* Show that the wanted subordinate number is not possible: */ + if (cardbus_bridge->subordinate > upper_limit) + printk(KERN_WARNING "Yenta: Upper limit for fixing this " + "bridge's parent bridge: #%02x\n", upper_limit); + + /* If we have room to increase the bridge's subordinate number, */ + if (bridge_to_fix->subordinate < upper_limit) { + + /* use the highest number of the hidden bus, within limits */ + unsigned char subordinate_to_assign = + min(cardbus_bridge->subordinate, upper_limit); + + printk(KERN_INFO "Yenta: Raising subordinate bus# of parent " + "bus (#%02x) from #%02x to #%02x\n", + bridge_to_fix->number, + bridge_to_fix->subordinate, subordinate_to_assign); + + /* Save the new subordinate in the bus struct of the bridge */ + bridge_to_fix->subordinate = subordinate_to_assign; + + /* and update the PCI config space with the new subordinate */ + pci_write_config_byte(bridge_to_fix->self, + PCI_SUBORDINATE_BUS, bridge_to_fix->subordinate); + } +} + /* * Initialize a cardbus controller. Make sure we have a usable * interrupt, and that we can map the cardbus area. Fill in the @@ -1113,6 +1191,8 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i yenta_get_socket_capabilities(socket, isa_interrupts); printk(KERN_INFO "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); + yenta_fixup_parent_bridge(dev->subordinate); + /* Register it with the pcmcia layer.. */ ret = pcmcia_register_socket(&socket->socket); if (ret == 0) { @@ -1232,6 +1312,7 @@ static struct pci_device_id yenta_table [] = { CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X515, TI12XX), + CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X420, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_X620, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7410, TI12XX), diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index 0b4adcb..227600c 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/pnp.h> diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index e54c153..e161423 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/string.h> #include <linux/list.h> #include <linux/module.h> diff --git a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c index 3ff7e76..0697ab8 100644 --- a/drivers/pnp/isapnp/compat.c +++ b/drivers/pnp/isapnp/compat.c @@ -8,7 +8,6 @@ /* TODO: see if more isapnp functions are needed here */ -#include <linux/config.h> #include <linux/module.h> #include <linux/isapnp.h> #include <linux/string.h> diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index ac7c2bb..f2e0179 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -34,7 +34,6 @@ * 2003-08-11 Resource Management Updates - Adam Belay <ambx1@neo.rr.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index cf54b0a..958c11b 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c @@ -19,7 +19,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/isapnp.h> #include <linux/proc_fs.h> diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 1d7a5b8..5026b34 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index f104577..6cf34a6 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -19,7 +19,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/acpi.h> #include <linux/pnp.h> #include <acpi/acpi_bus.h> diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index c89c98a..ef508a4 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c @@ -3,7 +3,6 @@ * */ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/pnp.h> #include <linux/pnpbios.h> diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 8936b0c..e97ecef 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -11,7 +11,6 @@ * Copyright (c) 1999 Martin Mares <mj@ucw.cz> */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 7bb892f..e7cf6be 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/interrupt.h> diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c index 61fe998..946a0dc 100644 --- a/drivers/pnp/support.c +++ b/drivers/pnp/support.c @@ -5,7 +5,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/ctype.h> #include <linux/pnp.h> diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c index 94e30fe..7bf7b2c 100644 --- a/drivers/rapidio/rio-scan.c +++ b/drivers/rapidio/rio-scan.c @@ -10,7 +10,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c index bef9316..5687b8f 100644 --- a/drivers/rapidio/rio-sysfs.c +++ b/drivers/rapidio/rio-sysfs.c @@ -10,7 +10,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/rio.h> #include <linux/rio_drv.h> diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 5e38247..f644807 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -11,7 +11,6 @@ * option) any later version. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index f2fc81a..d51afbe 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -15,7 +15,7 @@ config RTC_CLASS help Generic RTC class support. If you say yes here, you will be allowed to plug one or more RTCs to your system. You will - probably want to enable one of more of the interfaces below. + probably want to enable one or more of the interfaces below. This driver can also be built as a module. If so, the module will be called rtc-class. diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 2dc179b..4bf03fb 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/kmod.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 9e9ae71..d729538 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -13,7 +13,6 @@ * */ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/init.h> #include <linux/module.h> diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 4002f6c..23fa0b2 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 0dfab30..2e655f4 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c index 4108d96..58a6509 100644 --- a/drivers/s390/block/dasd_erp.c +++ b/drivers/s390/block/dasd_erp.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/init.h> diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index bb7755b..808434d 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c @@ -6,7 +6,6 @@ * */ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <asm/debug.h> diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 61ffde7..12c7d29 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/fs.h> #include <linux/blkpg.h> diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 302bcd0..e97f531 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -9,7 +9,6 @@ * * i/o controls for the dasd driver. */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/major.h> #include <linux/fs.h> diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index ad23aed..bfa010f 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/seq_file.h> #include <linux/vmalloc.h> diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 606f6ad..f25c6d1 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -11,7 +11,6 @@ * Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kdev_t.h> diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index ef607a1..7566be8 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -8,7 +8,6 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ -#include <linux/config.h> #include <linux/bootmem.h> #include <linux/console.h> #include <linux/init.h> diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c index be46324..0ea6f36 100644 --- a/drivers/s390/char/ctrlchar.c +++ b/drivers/s390/char/ctrlchar.c @@ -7,7 +7,6 @@ * */ -#include <linux/config.h> #include <linux/stddef.h> #include <asm/errno.h> #include <linux/sysrq.h> diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index a641537..6099c14 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -8,7 +8,6 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ -#include <linux/config.h> #include <linux/bootmem.h> #include <linux/console.h> #include <linux/init.h> diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index d4d2ff0..547ef90 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -7,7 +7,6 @@ * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), */ -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/sysrq.h> diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 3c1314b..e95b56f 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c @@ -8,7 +8,6 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ -#include <linux/config.h> #include <linux/bootmem.h> #include <linux/module.h> #include <linux/err.h> diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c index 10ef22f..86864f6 100644 --- a/drivers/s390/char/sclp_con.c +++ b/drivers/s390/char/sclp_con.c @@ -8,7 +8,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/kmod.h> #include <linux/console.h> #include <linux/init.h> diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c index 80f7f31..732dfbd 100644 --- a/drivers/s390/char/sclp_cpi.c +++ b/drivers/s390/char/sclp_cpi.c @@ -5,7 +5,6 @@ * SCLP Control-Program Identification. */ -#include <linux/config.h> #include <linux/version.h> #include <linux/kmod.h> #include <linux/module.h> diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c index a4c53c1..32004aa 100644 --- a/drivers/s390/char/sclp_quiesce.c +++ b/drivers/s390/char/sclp_quiesce.c @@ -7,7 +7,6 @@ * Peter Oberparleiter <peter.oberparleiter@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/cpumask.h> diff --git a/drivers/s390/char/sclp_rw.c b/drivers/s390/char/sclp_rw.c index 91e93c7..0c92d39 100644 --- a/drivers/s390/char/sclp_rw.c +++ b/drivers/s390/char/sclp_rw.c @@ -8,7 +8,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/kmod.h> #include <linux/types.h> #include <linux/err.h> diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index 6cbf067..f6cf902 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c @@ -8,7 +8,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kmod.h> #include <linux/tty.h> diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 9e02625..54fba6f 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -7,7 +7,6 @@ * Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/spinlock.h> #include <linux/list.h> diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h index cd51ace..1f4c899 100644 --- a/drivers/s390/char/tape.h +++ b/drivers/s390/char/tape.h @@ -16,7 +16,6 @@ #include <asm/ccwdev.h> #include <asm/debug.h> #include <asm/idals.h> -#include <linux/config.h> #include <linux/blkdev.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index d4f2da7..48b4d30 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c @@ -8,7 +8,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/bio.h> diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index d71ef1a..928cbef 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c @@ -8,7 +8,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/bio.h> diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index b70d926..3225fcd 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c @@ -11,7 +11,6 @@ */ #include <linux/fs.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/blkdev.h> #include <linux/interrupt.h> diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 5ce7ca3..97f7523 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c @@ -10,7 +10,6 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/proc_fs.h> diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index e6e4086..122b4d8 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -11,7 +11,6 @@ * Stefan Bader <shbader@de.ibm.com> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> // for kernel parameters #include <linux/kmod.h> // for requesting modules diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c index 5fec0a1..655d375 100644 --- a/drivers/s390/char/tape_proc.c +++ b/drivers/s390/char/tape_proc.c @@ -11,7 +11,6 @@ * PROCFS Functions */ -#include <linux/config.h> #include <linux/module.h> #include <linux/vmalloc.h> #include <linux/seq_file.h> diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c index 99cf881..7a76ec4 100644 --- a/drivers/s390/char/tape_std.c +++ b/drivers/s390/char/tape_std.c @@ -11,7 +11,6 @@ * Stefan Bader <shbader@de.ibm.com> */ -#include <linux/config.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/bio.h> diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index 7d26a3e..f496f23 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c @@ -8,7 +8,6 @@ * -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kdev_t.h> diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index 15b8954..12c2d6b 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c @@ -9,7 +9,6 @@ * Arnd Bergmann (arndb@de.ibm.com) */ -#include <linux/config.h> #include <linux/init.h> #include <linux/vmalloc.h> #include <linux/slab.h> diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index b00f3ed..a01f3bb 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -10,7 +10,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/device.h> diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 5b20d8c..a342326 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -11,7 +11,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/device.h> diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index eafde43..67f0de6 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -8,7 +8,6 @@ * Cornelia Huck (cornelia.huck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/spinlock.h> diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 7d0dd72..cb1af0b 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -9,7 +9,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/jiffies.h> #include <linux/string.h> diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index e60b2d8..438db48 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c @@ -10,7 +10,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/init.h> #include <asm/ccwdev.h> diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index b266ad8..a601242 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -6,7 +6,6 @@ * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) * Cornelia Huck (cornelia.huck@de.ibm.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c index 85b1020..54cb64e 100644 --- a/drivers/s390/cio/device_pgid.c +++ b/drivers/s390/cio/device_pgid.c @@ -9,7 +9,6 @@ * Path Group ID functions. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c index 6c762b4..14bef2c 100644 --- a/drivers/s390/cio/device_status.c +++ b/drivers/s390/cio/device_status.c @@ -9,7 +9,6 @@ * Status accumulation and basic sense functions. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 96f5192..b70039a 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -30,7 +30,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c index 7145e21..2c1db80 100644 --- a/drivers/s390/net/fsm.c +++ b/drivers/s390/net/fsm.c @@ -4,7 +4,6 @@ */ #include "fsm.h" -#include <linux/config.h> #include <linux/module.h> #include <linux/timer.h> diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index e0c7deb..189a492 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -33,7 +33,6 @@ #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/config.h> #include <linux/spinlock.h> #include <linux/kernel.h> diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 38aad83..8491598f 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -8,7 +8,6 @@ * Author(s): Thomas Spatzier <tspat@de.ibm.com> * */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/ip.h> #include <linux/inetdevice.h> diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 56009d7..36733b9 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -27,7 +27,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/string.h> diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index 8dc7500..432136f 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c @@ -8,7 +8,6 @@ * Martin Schwidefsky (schwidefsky@de.ibm.com) */ -#include <linux/config.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/errno.h> diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c index 66da840..d1c1e75 100644 --- a/drivers/s390/sysinfo.c +++ b/drivers/s390/sysinfo.c @@ -5,7 +5,6 @@ * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/proc_fs.h> diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index cf97e9e..063e676 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -22,7 +22,6 @@ #define __KERNEL_SYSCALLS__ static int errno; -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/kthread.h> diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 31b8a5f..fa2418f 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -4,7 +4,6 @@ * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index d7e4bb4..293bb2f 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -29,7 +29,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c index 378a1d6..57e1526 100644 --- a/drivers/sbus/dvma.c +++ b/drivers/sbus/dvma.c @@ -3,7 +3,6 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c index 387a6aa..16b5977 100644 --- a/drivers/sbus/sbus.c +++ b/drivers/sbus/sbus.c @@ -5,7 +5,6 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/config.h> #include <linux/init.h> #include <linux/pci.h> diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 3c683dc..eb7a6a4d 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -114,7 +114,6 @@ * */ #define NCR_700_VERSION "2.8" -#include <linux/config.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c index 765769a..c9bd033 100644 --- a/drivers/scsi/53c7xx.c +++ b/drivers/scsi/53c7xx.c @@ -232,7 +232,6 @@ #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <asm/setup.h> diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index bde3d58..259b47e 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -29,7 +29,6 @@ #define BusLogic_DriverVersion "2.1.16" #define BusLogic_DriverDate "18 July 2002" -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h index 1aaa656..9792e5a 100644 --- a/drivers/scsi/BusLogic.h +++ b/drivers/scsi/BusLogic.h @@ -28,7 +28,6 @@ #ifndef _BUSLOGIC_H #define _BUSLOGIC_H -#include <linux/config.h> #ifndef PACKED #define PACKED __attribute__((packed)) diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index 8e3d949..7c00680 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -15,7 +15,6 @@ */ -#include <linux/config.h> #ifndef CONFIG_SCSI_OMIT_FLASHPOINT diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c index c7dd015..8a4659e 100644 --- a/drivers/scsi/NCR53C9x.c +++ b/drivers/scsi/NCR53C9x.c @@ -23,7 +23,6 @@ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/types.h> diff --git a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h index 65a9b37..481653c 100644 --- a/drivers/scsi/NCR53C9x.h +++ b/drivers/scsi/NCR53C9x.h @@ -13,7 +13,6 @@ #ifndef NCR53C9X_H #define NCR53C9X_H -#include <linux/config.h> #include <linux/interrupt.h> /* djweis for mac driver */ diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index dd9fb3d..5371364 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -754,7 +754,6 @@ * --- Linux Include Files */ -#include <linux/config.h> #include <linux/module.h> #if defined(CONFIG_X86) && !defined(CONFIG_ISA) diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 86c6bd2..24f0f54 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -25,7 +25,6 @@ * Added proper detection of the AHA-1640 (MCA version of AHA-1540) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/kernel.h> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index 2b83316..92c6154 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -42,7 +42,6 @@ #ifndef _AIC79XX_LINUX_H_ #define _AIC79XX_LINUX_H_ -#include <linux/config.h> #include <linux/types.h> #include <linux/blkdev.h> #include <linux/delay.h> diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index a20b08c..d42a71e 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -59,7 +59,6 @@ #ifndef _AIC7XXX_LINUX_H_ #define _AIC7XXX_LINUX_H_ -#include <linux/config.h> #include <linux/types.h> #include <linux/blkdev.h> #include <linux/delay.h> diff --git a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c index 3bf3349..b07e4f0 100644 --- a/drivers/scsi/aic7xxx_old/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx_old/aic7xxx_proc.c @@ -29,7 +29,6 @@ * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $ *-M*************************************************************************/ -#include <linux/config.h> #define BLS (&aic7xxx_buffer[size]) #define HDRB \ diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c index c0844fa..9099d53 100644 --- a/drivers/scsi/amiga7xx.c +++ b/drivers/scsi/amiga7xx.c @@ -11,7 +11,6 @@ #include <linux/mm.h> #include <linux/blkdev.h> #include <linux/sched.h> -#include <linux/config.h> #include <linux/zorro.h> #include <linux/stat.h> diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index dda5a5f..1b9900b 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -129,7 +129,6 @@ #define STRx(x) STRINGIFY(x) #define NO_WRITE_STR STRx(NO_WRITE) -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 57295bce..007a14e 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -524,7 +524,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd) } } -#include <linux/config.h> #include <linux/delay.h> #if NDEBUG diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index f677c5a..e1be4a4 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -65,7 +65,6 @@ -#include <linux/config.h> #include <linux/module.h> #define NDEBUG (0) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index d9abd16..f6caa43 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -7,7 +7,6 @@ #define VERSION "0.25" -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/fs.h> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index d92d504..dddd2ac 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -7,7 +7,6 @@ * Additions for SPC-3 T10/1416-D Rev 21 22 Sept 2004, D. Gilbert 20041025 */ -#include <linux/config.h> #include <linux/blkdev.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/scsi/dpt/dpti_i2o.h b/drivers/scsi/dpt/dpti_i2o.h index a9585f5..d84a281 100644 --- a/drivers/scsi/dpt/dpti_i2o.h +++ b/drivers/scsi/dpt/dpti_i2o.h @@ -23,7 +23,6 @@ #include <asm/semaphore.h> /* Needed for MUTEX init macros */ #include <linux/version.h> -#include <linux/config.h> #include <linux/notifier.h> #include <asm/atomic.h> diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 059eeee..67c4194 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -477,7 +477,6 @@ * the driver sets host->wish_block = 1 for all ISA boards. */ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index 23beb48..d8c9ec2 100644 --- a/drivers/scsi/eata_pio.c +++ b/drivers/scsi/eata_pio.c @@ -46,7 +46,6 @@ * last change: 2002/11/02 OS: Linux 2.5.45 * ************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c index ddb5124..36c50b6 100644 --- a/drivers/scsi/esp.c +++ b/drivers/scsi/esp.c @@ -12,7 +12,6 @@ * 3) Add tagged queueing. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/types.h> diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c index 0341654..7f89102 100644 --- a/drivers/scsi/fcal.c +++ b/drivers/scsi/fcal.c @@ -13,7 +13,6 @@ #include <linux/proc_fs.h> #include <linux/stat.h> #include <linux/init.h> -#include <linux/config.h> #ifdef CONFIG_KMOD #include <linux/kmod.h> #endif diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index e16013f..0335688 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -266,7 +266,6 @@ **************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h> diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 5f313c9..fbc8e16 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -91,7 +91,6 @@ #define AUTOPROBE_IRQ #define AUTOSENSE -#include <linux/config.h> #ifdef CONFIG_SCSI_GENERIC_NCR53C400 #define NCR53C400_PSEUDO_DMA 1 diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h index d60a89c..df0b3f6 100644 --- a/drivers/scsi/g_NCR5380.h +++ b/drivers/scsi/g_NCR5380.h @@ -32,7 +32,6 @@ #ifndef GENERIC_NCR5380_H #define GENERIC_NCR5380_H -#include <linux/config.h> #define GENERIC_NCR5380_PUBLIC_RELEASE 1 diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c index 497f664..1cbc948 100644 --- a/drivers/scsi/ibmmca.c +++ b/drivers/scsi/ibmmca.c @@ -17,7 +17,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 988e6f7..f7b5d73 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -34,7 +34,6 @@ #define IDESCSI_VERSION "0.92" #include <linux/module.h> -#include <linux/config.h> #include <linux/types.h> #include <linux/string.h> #include <linux/kernel.h> diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 681bd18..2d95ac9 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -8,7 +8,6 @@ * future expansion to five letters. */ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 913ba95..43acb1f 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -118,7 +118,6 @@ #include <linux/blkdev.h> #include <linux/spinlock.h> #include <linux/stat.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/proc_fs.h> #include <linux/string.h> diff --git a/drivers/scsi/initio.h b/drivers/scsi/initio.h index 3efb118..acb67a4 100644 --- a/drivers/scsi/initio.h +++ b/drivers/scsi/initio.h @@ -54,7 +54,6 @@ **************************************************************************/ -#include <linux/config.h> #include <linux/types.h> #define ULONG unsigned long @@ -193,13 +192,13 @@ typedef struct { #define TSC_SEL_ATN_DIRECT_OUT 0x15 /* Select With ATN Sequence */ #define TSC_SEL_ATN3_DIRECT_IN 0xB5 /* Select With ATN3 Sequence */ #define TSC_SEL_ATN3_DIRECT_OUT 0x35 /* Select With ATN3 Sequence */ -#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Infomation out */ -#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Infomation in */ +#define TSC_XF_DMA_OUT_DIRECT 0x06 /* DMA Xfer Information out */ +#define TSC_XF_DMA_IN_DIRECT 0x86 /* DMA Xfer Information in */ -#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Infomation out */ -#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Infomation in */ -#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Infomation out */ -#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Infomation in */ +#define TSC_XF_DMA_OUT 0x43 /* DMA Xfer Information out */ +#define TSC_XF_DMA_IN 0xC3 /* DMA Xfer Information in */ +#define TSC_XF_FIFO_OUT 0x03 /* FIFO Xfer Information out */ +#define TSC_XF_FIFO_IN 0x83 /* FIFO Xfer Information in */ #define TSC_MSG_ACCEPT 0x0F /* Message Accept */ diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 96b65b3..e19bf69 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -54,7 +54,6 @@ * */ -#include <linux/config.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/types.h> diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 78f2ff7..7436793 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -196,7 +196,6 @@ #include <linux/module.h> #include <linux/stat.h> -#include <linux/config.h> #include <linux/spinlock.h> #include <linux/init.h> diff --git a/drivers/scsi/libata-bmdma.c b/drivers/scsi/libata-bmdma.c index 004e1a0..38bfebf 100644 --- a/drivers/scsi/libata-bmdma.c +++ b/drivers/scsi/libata-bmdma.c @@ -32,7 +32,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/libata.h> diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index d1c1c30..82caba4 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -32,7 +32,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index f852421..c887177 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -18,7 +18,6 @@ * - retry arbitration if lost (unless higher levels do this for us) * - power down the chip when no device is detected */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/scsi/ncr53c8xx.h b/drivers/scsi/ncr53c8xx.h index 0e4e46a..78818b6 100644 --- a/drivers/scsi/ncr53c8xx.h +++ b/drivers/scsi/ncr53c8xx.h @@ -53,10 +53,8 @@ #ifndef NCR53C8XX_H #define NCR53C8XX_H -#include <linux/config.h> #include <scsi/scsi_host.h> -#include <linux/config.h> /* ** If you want a driver as small as possible, donnot define the diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c index dee426f..d7a0bcc 100644 --- a/drivers/scsi/oktagon_esp.c +++ b/drivers/scsi/oktagon_esp.c @@ -6,7 +6,6 @@ * Based on cyber_esp.c */ -#include <linux/config.h> #if defined(CONFIG_AMIGA) || defined(CONFIG_APUS) #define USE_BOTTOM_HALF diff --git a/drivers/scsi/oktagon_io.S b/drivers/scsi/oktagon_io.S index 08ce8d8..8a7340b 100644 --- a/drivers/scsi/oktagon_io.S +++ b/drivers/scsi/oktagon_io.S @@ -23,7 +23,6 @@ int oktag_from_io(long *addr,long *paddr,long len) * is moved to/from the IO register. */ -#include <linux/config.h> #ifdef CONFIG_APUS diff --git a/drivers/scsi/osst.h b/drivers/scsi/osst.h index 011d4d6..1e426f5 100644 --- a/drivers/scsi/osst.h +++ b/drivers/scsi/osst.h @@ -3,7 +3,6 @@ */ #include <asm/byteorder.h> -#include <linux/config.h> #include <linux/completion.h> /* FIXME - rename and use the following two types or delete them! diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index 83a6717..7abf64d 100644 --- a/drivers/scsi/pluto.c +++ b/drivers/scsi/pluto.c @@ -13,7 +13,6 @@ #include <linux/proc_fs.h> #include <linux/stat.h> #include <linux/init.h> -#include <linux/config.h> #ifdef CONFIG_KMOD #include <linux/kmod.h> #endif diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index d58ac5a..b0eba39 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 680f606..a7e4183 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -331,7 +331,6 @@ *****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/version.h> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d6f6579..6734453 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2134,7 +2134,7 @@ typedef struct scsi_qla_host { mempool_t *srb_mempool; /* This spinlock is used to protect "io transactions", you must - * aquire it before doing any IO to the card, eg with RD_REG*() and + * acquire it before doing any IO to the card, eg with RD_REG*() and * WRT_REG*() for the duration of your entire commandtransaction. * * This spinlock is of lower priority than the io request lock. diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c index 5cc42c6..56da255 100644 --- a/drivers/scsi/sata_nv.c +++ b/drivers/scsi/sata_nv.c @@ -31,7 +31,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index 809d337..ee6b5df 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c @@ -30,7 +30,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c index 7566c2ca..a958b45 100644 --- a/drivers/scsi/sata_svw.c +++ b/drivers/scsi/sata_svw.c @@ -36,7 +36,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c index 64f3c1a..33cdb48 100644 --- a/drivers/scsi/sata_uli.c +++ b/drivers/scsi/sata_uli.c @@ -24,7 +24,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5a5d2af..e116886 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -24,7 +24,6 @@ * module options to "modprobe scsi_debug num_tgts=2" [20021221] */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/scsi/scsi_logging.h b/drivers/scsi/scsi_logging.h index a3e2af6..1f65139 100644 --- a/drivers/scsi/scsi_logging.h +++ b/drivers/scsi/scsi_logging.h @@ -1,7 +1,6 @@ #ifndef _SCSI_LOGGING_H #define _SCSI_LOGGING_H -#include <linux/config.h> /* * This defines the scsi logging feature. It is a means by which the user diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index a1727a0..015c90c 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -1,7 +1,6 @@ #ifndef _SCSI_PRIV_H #define _SCSI_PRIV_H -#include <linux/config.h> #include <linux/device.h> struct request_queue; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 0f7e6f9..1341608 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -25,7 +25,6 @@ * or a LUN is seen that cannot have a device attached to it. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 5ec7a4f..e7fe565 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -6,7 +6,6 @@ * Created to pull SCSI mid layer sysfs routines into one file. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/blkdev.h> diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index ace49d5..29a9a53 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -18,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/ctype.h> #include <linux/init.h> #include <linux/module.h> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3541990..ea38757 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -32,7 +32,6 @@ * than the level indicated above to trigger output. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/kernel.h> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 98b9312..4e607d3 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -28,7 +28,6 @@ static int sg_version_num = 30533; /* 2 digits for each component */ * (otherwise the macros compile to empty statements). * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index 255886a..2b27893 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c @@ -26,7 +26,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/blkdev.h> diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c index 9dde8df..a3e9d0f 100644 --- a/drivers/scsi/sr_vendor.c +++ b/drivers/scsi/sr_vendor.c @@ -34,7 +34,6 @@ * HP 6020 writers now supported. */ -#include <linux/config.h> #include <linux/cdrom.h> #include <linux/errno.h> #include <linux/string.h> diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 25cced9..2ebe0d6 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c @@ -535,7 +535,6 @@ static __inline__ void initialize_SCp(Scsi_Cmnd *cmd) } -#include <linux/config.h> #include <linux/delay.h> #if 1 diff --git a/drivers/scsi/sym53c8xx_2/sym53c8xx.h b/drivers/scsi/sym53c8xx_2/sym53c8xx.h index 4811037..7519728 100644 --- a/drivers/scsi/sym53c8xx_2/sym53c8xx.h +++ b/drivers/scsi/sym53c8xx_2/sym53c8xx.h @@ -40,7 +40,6 @@ #ifndef SYM53C8XX_H #define SYM53C8XX_H -#include <linux/config.h> /* * DMA addressing mode. diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h index a446cda..e022d3c 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.h +++ b/drivers/scsi/sym53c8xx_2/sym_glue.h @@ -40,7 +40,6 @@ #ifndef SYM_GLUE_H #define SYM_GLUE_H -#include <linux/config.h> #include <linux/delay.h> #include <linux/ioport.h> #include <linux/pci.h> diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c index 91322af..7540f6a 100644 --- a/drivers/scsi/tmscsim.c +++ b/drivers/scsi/tmscsim.c @@ -218,7 +218,6 @@ #endif #define DCBDEBUG1(x) C_NOP -#include <linux/config.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/signal.h> diff --git a/drivers/scsi/tmscsim.h b/drivers/scsi/tmscsim.h index d449527..9b66fa8 100644 --- a/drivers/scsi/tmscsim.h +++ b/drivers/scsi/tmscsim.h @@ -9,7 +9,6 @@ #define _TMSCSIM_H #include <linux/types.h> -#include <linux/config.h> #define SCSI_IRQ_NONE 255 diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index 33cd90f..35c043e 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c @@ -405,7 +405,6 @@ * the driver sets host->wish_block = TRUE for all ISA boards. */ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index 27307fe..680f38a 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c @@ -71,7 +71,6 @@ * Richard Hirst <richard@sleepie.demon.co.uk> August 2000 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h index 193ec51..edcb036 100644 --- a/drivers/scsi/wd33c93.h +++ b/drivers/scsi/wd33c93.h @@ -22,7 +22,6 @@ #ifndef WD33C93_H #define WD33C93_H -#include <linux/config.h> #define PROC_INTERFACE /* add code for /proc/scsi/wd33c93/xxx interface */ #ifdef PROC_INTERFACE diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 9fd0de4..5743832 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -7,7 +7,6 @@ * * $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index bff9454..993a702 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c @@ -23,7 +23,6 @@ #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/tty_flip.h> -#include <linux/config.h> #include <linux/major.h> #include <linux/string.h> #include <linux/fcntl.h> diff --git a/drivers/serial/68328serial.h b/drivers/serial/68328serial.h index 978f8a6..58aa215 100644 --- a/drivers/serial/68328serial.h +++ b/drivers/serial/68328serial.h @@ -11,7 +11,6 @@ #ifndef _MC683XX_SERIAL_H #define _MC683XX_SERIAL_H -#include <linux/config.h> struct serial_struct { int type; diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 9843ae3..e80e70e 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -20,7 +20,6 @@ * int rs_360_init(void); */ -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index f361b35..9c5d36f 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -19,7 +19,6 @@ * mapbase is the physical address of the IO port. * membase is an 'ioremapped' cookie. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 490606b..91bd28f 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h @@ -15,7 +15,6 @@ * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $ */ -#include <linux/config.h> #include <linux/serial_8250.h> struct old_serial_port { diff --git a/drivers/serial/8250_mca.c b/drivers/serial/8250_mca.c index ac20525..d10be94 100644 --- a/drivers/serial/8250_mca.c +++ b/drivers/serial/8250_mca.c @@ -8,7 +8,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/mca.h> diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index e920d19..7311d84 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c @@ -31,7 +31,6 @@ * required, these have to be supplied via some other means (eg, GPIO) * and hooked into this driver. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 3d966cfc..a8d7124 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -31,7 +31,6 @@ * required, these have to be supplied via some other means (eg, GPIO) * and hooked into this driver. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/at91_serial.c b/drivers/serial/at91_serial.c index df9500b..7b3b3f3 100644 --- a/drivers/serial/at91_serial.c +++ b/drivers/serial/at91_serial.c @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index 2691112..f27d852 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -25,7 +25,6 @@ * $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $ * */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 5cba59a..90ff96e 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -31,7 +31,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 17406a0..95afc37 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index cdba128..ef3bb47 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index b84137c..901be34 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c @@ -425,7 +425,6 @@ static char *serial_version = "$Revision: 1.25 $"; -#include <linux/config.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/crisv10.h b/drivers/serial/crisv10.h index 1800c0e7..f30b93d 100644 --- a/drivers/serial/crisv10.h +++ b/drivers/serial/crisv10.h @@ -7,7 +7,6 @@ #ifndef _ETRAX_SERIAL_H #define _ETRAX_SERIAL_H -#include <linux/config.h> #include <linux/circ_buf.h> #include <asm/termios.h> diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 466d06c..ecf824b 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -26,7 +26,6 @@ #undef DEBUG_DZ -#include <linux/config.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/init.h> diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c index 144a7a3..ad1e753 100644 --- a/drivers/serial/icom.c +++ b/drivers/serial/icom.c @@ -24,7 +24,6 @@ */ #define SERIAL_DO_RESTART #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index da85baf..0b5f39d 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c @@ -25,7 +25,6 @@ * [29-Mar-2005] Mike Lee * Added hardware handshake */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index 56b093e..3420428 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c @@ -12,7 +12,6 @@ * Copyright (C) 2002 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2002 David S. Miller (davem@redhat.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index 6a2a25d..fbaae96 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c @@ -25,7 +25,6 @@ * membase is an 'ioremapped' cookie. This is compatible with the old * serial.c driver, and is currently the preferred form. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_M32R_SIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/m32r_sio.h b/drivers/serial/m32r_sio.h index 7c3ec24..849f1b2 100644 --- a/drivers/serial/m32r_sio.h +++ b/drivers/serial/m32r_sio.h @@ -15,7 +15,6 @@ * (at your option) any later version. */ -#include <linux/config.h> struct m32r_sio_probe { struct module *owner; diff --git a/drivers/serial/m32r_sio_reg.h b/drivers/serial/m32r_sio_reg.h index 9c86452..4671473 100644 --- a/drivers/serial/m32r_sio_reg.h +++ b/drivers/serial/m32r_sio_reg.h @@ -15,7 +15,6 @@ #ifndef _M32R_SIO_REG_H #define _M32R_SIO_REG_H -#include <linux/config.h> #ifdef CONFIG_SERIAL_M32R_PLDSIO diff --git a/drivers/serial/mcfserial.h b/drivers/serial/mcfserial.h index a2b28e8..56420e2 100644 --- a/drivers/serial/mcfserial.h +++ b/drivers/serial/mcfserial.h @@ -14,7 +14,6 @@ #ifndef _MCF_SERIAL_H #define _MCF_SERIAL_H -#include <linux/config.h> #include <linux/serial.h> #ifdef __KERNEL__ diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 1aa3484..1b8e554 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -44,7 +44,6 @@ * will be mapped to. */ -#include <linux/config.h> #include <linux/platform_device.h> #include <linux/module.h> #include <linux/tty.h> diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index 1cd102f..8c498f7 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c @@ -50,7 +50,6 @@ * 4) AFAICT, hardware flow control isn't supported by the controller --MAG. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_MPSC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index 64c0e89..4a1c998 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c @@ -16,7 +16,6 @@ ** */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/ioport.h> diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index e3ba7e1..4d94354 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c @@ -42,7 +42,6 @@ #undef DEBUG_HARD #undef USE_CTRL_O_SYSRQ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 0fa0ccc..a720953 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c @@ -24,7 +24,6 @@ * with the serial core maintainer satisfaction to appear soon. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -390,7 +389,7 @@ static int serial_pxa_startup(struct uart_port *port) /* * Finally, enable interrupts. Note: Modem status interrupts - * are set via set_termios(), which will be occuring imminently + * are set via set_termios(), which will be occurring imminently * anyway, so we don't enable them here. */ up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE; diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 4c62ab94..392bffc 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c @@ -55,7 +55,6 @@ * BJD, 04-Nov-2004 */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 8bbd856..db3486d 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -24,7 +24,6 @@ * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $ * */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 7dc1e67..c54af877 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/slab.h> diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 2c70773..cbf260b 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c @@ -786,6 +786,7 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"), + PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"), /* too generic */ /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */ /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */ diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index 776d4ff..23ddedb 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_LH7A40X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index a901a7e..28c1881 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c @@ -38,7 +38,6 @@ * Fix some spin_locks. * Do not call uart_add_one_port for absent ports. */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index d97f3ca..2509c32 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -20,7 +20,6 @@ #undef DEBUG -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h> diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 1f14bb4..ab320fa 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h @@ -10,7 +10,6 @@ * Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003). * Modified to support H8/300 Series Yoshinori Sato (Feb 2004). */ -#include <linux/config.h> #include <linux/serial_core.h> #if defined(__H8300H__) || defined(__H8300S__) diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 60ea4a3..4b0afc8 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -37,7 +37,6 @@ * http://oss.sgi.com/projects/GenInfo/NoticeExplan */ -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/serial.h> diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c index fa4ae94..e35d9ab 100644 --- a/drivers/serial/suncore.c +++ b/drivers/serial/suncore.c @@ -10,7 +10,6 @@ * Copyright (C) 2002 David S. Miller (davem@redhat.com) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/console.h> diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index d36bc40..f851f0f 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c @@ -20,8 +20,8 @@ #include <asm/hypervisor.h> #include <asm/spitfire.h> -#include <asm/vdev.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/irq.h> #if defined(CONFIG_MAGIC_SYSRQ) @@ -407,144 +407,120 @@ static inline struct console *SUNHV_CONSOLE(void) return &sunhv_console; } -static int __init hv_console_compatible(char *buf, int len) -{ - while (len) { - int this_len; - - if (!strcmp(buf, "qcn")) - return 1; - - this_len = strlen(buf) + 1; - - buf += this_len; - len -= this_len; - } - - return 0; -} - -static unsigned int __init get_interrupt(void) -{ - struct device_node *dev_node; - - dev_node = sun4v_vdev_root->child; - while (dev_node != NULL) { - struct property *prop; - - if (strcmp(dev_node->name, "console")) - goto next_sibling; - - prop = of_find_property(dev_node, "compatible", NULL); - if (!prop) - goto next_sibling; - - if (hv_console_compatible(prop->value, prop->length)) - break; - - next_sibling: - dev_node = dev_node->sibling; - } - if (!dev_node) - return 0; - - /* Ok, the this is the OBP node for the sun4v hypervisor - * console device. Decode the interrupt. - */ - return sun4v_vdev_device_interrupt(dev_node); -} - -static int __init sunhv_init(void) +static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) { struct uart_port *port; - int ret; + int err; - if (tlb_type != hypervisor) + if (op->irqs[0] == 0xffffffff) return -ENODEV; - port = kmalloc(sizeof(struct uart_port), GFP_KERNEL); + port = kzalloc(sizeof(struct uart_port), GFP_KERNEL); if (unlikely(!port)) return -ENOMEM; - memset(port, 0, sizeof(struct uart_port)); + sunhv_port = port; port->line = 0; port->ops = &sunhv_pops; port->type = PORT_SUNHV; port->uartclk = ( 29491200 / 16 ); /* arbitrary */ - /* Set this just to make uart_configure_port() happy. */ port->membase = (unsigned char __iomem *) __pa(port); - port->irq = get_interrupt(); - if (!port->irq) { - kfree(port); - return -ENODEV; - } + port->irq = op->irqs[0]; + + port->dev = &op->dev; sunhv_reg.minor = sunserial_current_minor; sunhv_reg.nr = 1; - ret = uart_register_driver(&sunhv_reg); - if (ret < 0) { - printk(KERN_ERR "SUNHV: uart_register_driver() failed %d\n", - ret); - kfree(port); - - return ret; - } + err = uart_register_driver(&sunhv_reg); + if (err) + goto out_free_port; sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; sunserial_current_minor += 1; sunhv_reg.cons = SUNHV_CONSOLE(); - sunhv_port = port; + err = uart_add_one_port(&sunhv_reg, port); + if (err) + goto out_unregister_driver; - ret = uart_add_one_port(&sunhv_reg, port); - if (ret < 0) { - printk(KERN_ERR "SUNHV: uart_add_one_port() failed %d\n", ret); - sunserial_current_minor -= 1; - uart_unregister_driver(&sunhv_reg); - kfree(port); - sunhv_port = NULL; - return -ENODEV; - } + err = request_irq(port->irq, sunhv_interrupt, 0, "hvcons", port); + if (err) + goto out_remove_port; - if (request_irq(port->irq, sunhv_interrupt, - SA_SHIRQ, "serial(sunhv)", port)) { - printk(KERN_ERR "sunhv: Cannot register IRQ\n"); - uart_remove_one_port(&sunhv_reg, port); - sunserial_current_minor -= 1; - uart_unregister_driver(&sunhv_reg); - kfree(port); - sunhv_port = NULL; - return -ENODEV; - } + dev_set_drvdata(&op->dev, port); return 0; + +out_remove_port: + uart_remove_one_port(&sunhv_reg, port); + +out_unregister_driver: + sunserial_current_minor -= 1; + uart_unregister_driver(&sunhv_reg); + +out_free_port: + kfree(port); + sunhv_port = NULL; + return err; } -static void __exit sunhv_exit(void) +static int __devexit hv_remove(struct of_device *dev) { - struct uart_port *port = sunhv_port; - - BUG_ON(!port); + struct uart_port *port = dev_get_drvdata(&dev->dev); free_irq(port->irq, port); uart_remove_one_port(&sunhv_reg, port); - sunserial_current_minor -= 1; + sunserial_current_minor -= 1; uart_unregister_driver(&sunhv_reg); - kfree(sunhv_port); + kfree(port); sunhv_port = NULL; + + dev_set_drvdata(&dev->dev, NULL); + + return 0; +} + +static struct of_device_id hv_match[] = { + { + .name = "console", + .compatible = "qcn", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, hv_match); + +static struct of_platform_driver hv_driver = { + .name = "hv", + .match_table = hv_match, + .probe = hv_probe, + .remove = __devexit_p(hv_remove), +}; + +static int __init sunhv_init(void) +{ + if (tlb_type != hypervisor) + return -ENODEV; + + return of_register_driver(&hv_driver, &of_bus_type); +} + +static void __exit sunhv_exit(void) +{ + of_unregister_driver(&hv_driver); } module_init(sunhv_init); module_exit(sunhv_exit); MODULE_AUTHOR("David S. Miller"); -MODULE_DESCRIPTION("SUN4V Hypervisor console driver") +MODULE_DESCRIPTION("SUN4V Hypervisor console driver"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 7da02d1..20a4869 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -1,7 +1,7 @@ /* sunsab.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) - * Copyright (C) 2002 David S. Miller (davem@redhat.com) + * Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net) * * Rewrote buffer handling to use CIRC(Circular Buffer) macros. * Maxim Krasnyanskiy <maxk@qualcomm.com> @@ -12,10 +12,9 @@ * Theodore Ts'o <tytso@mit.edu>, 2001-Oct-12 * * Ported to new 2.5.x UART layer. - * David S. Miller <davem@redhat.com> + * David S. Miller <davem@davemloft.net> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -37,8 +36,8 @@ #include <asm/io.h> #include <asm/irq.h> -#include <asm/oplib.h> -#include <asm/ebus.h> +#include <asm/prom.h> +#include <asm/of_device.h> #if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -976,199 +975,188 @@ static inline struct console *SUNSAB_CONSOLE(void) #define sunsab_console_init() do { } while (0) #endif -static void __init for_each_sab_edev(void (*callback)(struct linux_ebus_device *, void *), void *arg) +static int __devinit sunsab_init_one(struct uart_sunsab_port *up, + struct of_device *op, + unsigned long offset, + int line) { - struct linux_ebus *ebus; - struct linux_ebus_device *edev = NULL; - - for_each_ebus(ebus) { - for_each_ebusdev(edev, ebus) { - if (!strcmp(edev->prom_node->name, "se")) { - callback(edev, arg); - continue; - } else if (!strcmp(edev->prom_node->name, "serial")) { - char *compat; - int clen; - - /* On RIO this can be an SE, check it. We could - * just check ebus->is_rio, but this is more portable. - */ - compat = of_get_property(edev->prom_node, - "compatible", &clen); - if (compat && clen > 0) { - if (strncmp(compat, "sab82532", 8) == 0) { - callback(edev, arg); - continue; - } - } - } - } - } -} + up->port.line = line; + up->port.dev = &op->dev; + + up->port.mapbase = op->resource[0].start + offset; + up->port.membase = of_ioremap(&op->resource[0], offset, + sizeof(union sab82532_async_regs), + "sab"); + if (!up->port.membase) + return -ENOMEM; + up->regs = (union sab82532_async_regs __iomem *) up->port.membase; -static void __init sab_count_callback(struct linux_ebus_device *edev, void *arg) -{ - int *count_p = arg; + up->port.irq = op->irqs[0]; - (*count_p)++; -} + up->port.fifosize = SAB82532_XMIT_FIFO_SIZE; + up->port.iotype = UPIO_MEM; -static void __init sab_attach_callback(struct linux_ebus_device *edev, void *arg) -{ - int *instance_p = arg; - struct uart_sunsab_port *up; - unsigned long regs, offset; - int i; + writeb(SAB82532_IPC_IC_ACT_LOW, &up->regs->w.ipc); - /* Note: ports are located in reverse order */ - regs = edev->resource[0].start; - offset = sizeof(union sab82532_async_regs); - for (i = 0; i < 2; i++) { - up = &sunsab_ports[(*instance_p * 2) + 1 - i]; + up->port.ops = &sunsab_pops; + up->port.type = PORT_SUNSAB; + up->port.uartclk = SAB_BASE_BAUD; - memset(up, 0, sizeof(*up)); - up->regs = ioremap(regs + offset, sizeof(union sab82532_async_regs)); - up->port.irq = edev->irqs[0]; - up->port.fifosize = SAB82532_XMIT_FIFO_SIZE; - up->port.mapbase = (unsigned long)up->regs; - up->port.iotype = UPIO_MEM; + up->type = readb(&up->regs->r.vstr) & 0x0f; + writeb(~((1 << 1) | (1 << 2) | (1 << 4)), &up->regs->w.pcr); + writeb(0xff, &up->regs->w.pim); + if ((up->port.line & 0x1) == 0) { + up->pvr_dsr_bit = (1 << 0); + up->pvr_dtr_bit = (1 << 1); + } else { + up->pvr_dsr_bit = (1 << 3); + up->pvr_dtr_bit = (1 << 2); + } + up->cached_pvr = (1 << 1) | (1 << 2) | (1 << 4); + writeb(up->cached_pvr, &up->regs->w.pvr); + up->cached_mode = readb(&up->regs->rw.mode); + up->cached_mode |= SAB82532_MODE_FRTS; + writeb(up->cached_mode, &up->regs->rw.mode); + up->cached_mode |= SAB82532_MODE_RTS; + writeb(up->cached_mode, &up->regs->rw.mode); - writeb(SAB82532_IPC_IC_ACT_LOW, &up->regs->w.ipc); + up->tec_timeout = SAB82532_MAX_TEC_TIMEOUT; + up->cec_timeout = SAB82532_MAX_CEC_TIMEOUT; - offset -= sizeof(union sab82532_async_regs); + if (!(up->port.line & 0x01)) { + int err; + + err = request_irq(up->port.irq, sunsab_interrupt, + SA_SHIRQ, "sab", up); + if (err) { + of_iounmap(up->port.membase, + sizeof(union sab82532_async_regs)); + return err; + } } - - (*instance_p)++; + + return 0; } -static int __init probe_for_sabs(void) +static int __devinit sab_probe(struct of_device *op, const struct of_device_id *match) { - int this_sab = 0; + static int inst; + struct uart_sunsab_port *up; + int err; + + up = &sunsab_ports[inst * 2]; + + err = sunsab_init_one(&up[0], op, + sizeof(union sab82532_async_regs), + (inst * 2) + 0); + if (err) + return err; + + err = sunsab_init_one(&up[0], op, 0, + (inst * 2) + 1); + if (err) { + of_iounmap(up[0].port.membase, + sizeof(union sab82532_async_regs)); + free_irq(up[0].port.irq, &up[0]); + return err; + } - /* Find device instances. */ - for_each_sab_edev(&sab_count_callback, &this_sab); - if (!this_sab) - return -ENODEV; + uart_add_one_port(&sunsab_reg, &up[0].port); + uart_add_one_port(&sunsab_reg, &up[1].port); - /* Allocate tables. */ - sunsab_ports = kmalloc(sizeof(struct uart_sunsab_port) * this_sab * 2, - GFP_KERNEL); - if (!sunsab_ports) - return -ENOMEM; + dev_set_drvdata(&op->dev, &up[0]); - num_channels = this_sab * 2; + inst++; - this_sab = 0; - for_each_sab_edev(&sab_attach_callback, &this_sab); return 0; } -static void __init sunsab_init_hw(void) +static void __devexit sab_remove_one(struct uart_sunsab_port *up) { - int i; - - for (i = 0; i < num_channels; i++) { - struct uart_sunsab_port *up = &sunsab_ports[i]; - - up->port.line = i; - up->port.ops = &sunsab_pops; - up->port.type = PORT_SUNSAB; - up->port.uartclk = SAB_BASE_BAUD; - - up->type = readb(&up->regs->r.vstr) & 0x0f; - writeb(~((1 << 1) | (1 << 2) | (1 << 4)), &up->regs->w.pcr); - writeb(0xff, &up->regs->w.pim); - if (up->port.line == 0) { - up->pvr_dsr_bit = (1 << 0); - up->pvr_dtr_bit = (1 << 1); - } else { - up->pvr_dsr_bit = (1 << 3); - up->pvr_dtr_bit = (1 << 2); - } - up->cached_pvr = (1 << 1) | (1 << 2) | (1 << 4); - writeb(up->cached_pvr, &up->regs->w.pvr); - up->cached_mode = readb(&up->regs->rw.mode); - up->cached_mode |= SAB82532_MODE_FRTS; - writeb(up->cached_mode, &up->regs->rw.mode); - up->cached_mode |= SAB82532_MODE_RTS; - writeb(up->cached_mode, &up->regs->rw.mode); - - up->tec_timeout = SAB82532_MAX_TEC_TIMEOUT; - up->cec_timeout = SAB82532_MAX_CEC_TIMEOUT; - - if (!(up->port.line & 0x01)) { - if (request_irq(up->port.irq, sunsab_interrupt, - SA_SHIRQ, "serial(sab82532)", up)) { - printk("sunsab%d: can't get IRQ %x\n", - i, up->port.irq); - continue; - } - } - } + uart_remove_one_port(&sunsab_reg, &up->port); + if (!(up->port.line & 1)) + free_irq(up->port.irq, up); + of_iounmap(up->port.membase, + sizeof(union sab82532_async_regs)); } -static int __init sunsab_init(void) +static int __devexit sab_remove(struct of_device *op) { - int ret = probe_for_sabs(); - int i; - - if (ret < 0) - return ret; + struct uart_sunsab_port *up = dev_get_drvdata(&op->dev); - sunsab_init_hw(); + sab_remove_one(&up[0]); + sab_remove_one(&up[1]); - sunsab_reg.minor = sunserial_current_minor; - sunsab_reg.nr = num_channels; + dev_set_drvdata(&op->dev, NULL); - ret = uart_register_driver(&sunsab_reg); - if (ret < 0) { - int i; + return 0; +} - for (i = 0; i < num_channels; i++) { - struct uart_sunsab_port *up = &sunsab_ports[i]; +static struct of_device_id sab_match[] = { + { + .name = "se", + }, + { + .name = "serial", + .compatible = "sab82532", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, sab_match); - if (!(up->port.line & 0x01)) - free_irq(up->port.irq, up); - iounmap(up->regs); - } - kfree(sunsab_ports); - sunsab_ports = NULL; +static struct of_platform_driver sab_driver = { + .name = "sab", + .match_table = sab_match, + .probe = sab_probe, + .remove = __devexit_p(sab_remove), +}; - return ret; +static int __init sunsab_init(void) +{ + struct device_node *dp; + int err; + + num_channels = 0; + for_each_node_by_name(dp, "su") + num_channels += 2; + for_each_node_by_name(dp, "serial") { + if (of_device_is_compatible(dp, "sab82532")) + num_channels += 2; } - sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; + if (num_channels) { + sunsab_ports = kzalloc(sizeof(struct uart_sunsab_port) * + num_channels, GFP_KERNEL); + if (!sunsab_ports) + return -ENOMEM; - sunsab_reg.cons = SUNSAB_CONSOLE(); + sunsab_reg.minor = sunserial_current_minor; + sunsab_reg.nr = num_channels; - sunserial_current_minor += num_channels; - - for (i = 0; i < num_channels; i++) { - struct uart_sunsab_port *up = &sunsab_ports[i]; + err = uart_register_driver(&sunsab_reg); + if (err) { + kfree(sunsab_ports); + sunsab_ports = NULL; - uart_add_one_port(&sunsab_reg, &up->port); + return err; + } + + sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64; + sunsab_reg.cons = SUNSAB_CONSOLE(); + sunserial_current_minor += num_channels; } - return 0; + return of_register_driver(&sab_driver, &of_bus_type); } static void __exit sunsab_exit(void) { - int i; - - for (i = 0; i < num_channels; i++) { - struct uart_sunsab_port *up = &sunsab_ports[i]; - - uart_remove_one_port(&sunsab_reg, &up->port); - - if (!(up->port.line & 0x01)) - free_irq(up->port.irq, up); - iounmap(up->regs); + of_unregister_driver(&sab_driver); + if (num_channels) { + sunserial_current_minor -= num_channels; + uart_unregister_driver(&sunsab_reg); } - sunserial_current_minor -= num_channels; - uart_unregister_driver(&sunsab_reg); - kfree(sunsab_ports); sunsab_ports = NULL; } diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 6e28c25..eabf477 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -12,10 +12,9 @@ * Theodore Ts'o <tytso@mit.edu>, 2001-Oct-12 * * Converted to new 2.5.x UART layer. - * David S. Miller (davem@redhat.com), 2002-Jul-29 + * David S. Miller (davem@davemloft.net), 2002-Jul-29 */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -40,11 +39,8 @@ #include <asm/io.h> #include <asm/irq.h> -#include <asm/oplib.h> -#include <asm/ebus.h> -#ifdef CONFIG_SPARC64 -#include <asm/isa.h> -#endif +#include <asm/prom.h> +#include <asm/of_device.h> #if defined(CONFIG_SERIAL_SUNSU_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -94,10 +90,10 @@ struct uart_sunsu_port { /* Probing information. */ enum su_type su_type; unsigned int type_probed; /* XXX Stupid */ - int port_node; + unsigned long reg_size; #ifdef CONFIG_SERIO - struct serio *serio; + struct serio serio; int serio_open; #endif }; @@ -509,7 +505,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg /* Stop-A is handled by drivers/char/keyboard.c now. */ if (up->su_type == SU_PORT_KBD) { #ifdef CONFIG_SERIO - serio_interrupt(up->serio, ch, 0, regs); + serio_interrupt(&up->serio, ch, 0, regs); #endif } else if (up->su_type == SU_PORT_MS) { int ret = suncore_mouse_baud_detection(ch, is_break); @@ -523,7 +519,7 @@ static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *reg case 0: #ifdef CONFIG_SERIO - serio_interrupt(up->serio, ch, 0, regs); + serio_interrupt(&up->serio, ch, 0, regs); #endif break; }; @@ -1031,99 +1027,14 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up) { unsigned char status1, status2, scratch, scratch2, scratch3; unsigned char save_lcr, save_mcr; - struct linux_ebus_device *dev = NULL; - struct linux_ebus *ebus; -#ifdef CONFIG_SPARC64 - struct sparc_isa_bridge *isa_br; - struct sparc_isa_device *isa_dev; -#endif -#ifndef CONFIG_SPARC64 - struct linux_prom_registers reg0; -#endif unsigned long flags; - if (!up->port_node || !up->su_type) + if (up->su_type == SU_PORT_NONE) return; up->type_probed = PORT_UNKNOWN; up->port.iotype = UPIO_MEM; - /* - * First we look for Ebus-bases su's - */ - for_each_ebus(ebus) { - for_each_ebusdev(dev, ebus) { - if (dev->prom_node->node == up->port_node) { - /* - * The EBus is broken on sparc; it delivers - * virtual addresses in resources. Oh well... - * This is correct on sparc64, though. - */ - up->port.membase = (char *) dev->resource[0].start; - /* - * This is correct on both architectures. - */ - up->port.mapbase = dev->resource[0].start; - up->port.irq = dev->irqs[0]; - goto ebus_done; - } - } - } - -#ifdef CONFIG_SPARC64 - for_each_isa(isa_br) { - for_each_isadev(isa_dev, isa_br) { - if (isa_dev->prom_node->node == up->port_node) { - /* Same on sparc64. Cool architecure... */ - up->port.membase = (char *) isa_dev->resource.start; - up->port.mapbase = isa_dev->resource.start; - up->port.irq = isa_dev->irq; - goto ebus_done; - } - } - } -#endif - -#ifdef CONFIG_SPARC64 - /* - * Not on Ebus, bailing. - */ - return; -#else - /* - * Not on Ebus, must be OBIO. - */ - if (prom_getproperty(up->port_node, "reg", - (char *)®0, sizeof(reg0)) == -1) { - prom_printf("sunsu: no \"reg\" property\n"); - return; - } - prom_apply_obio_ranges(®0, 1); - if (reg0.which_io != 0) { /* Just in case... */ - prom_printf("sunsu: bus number nonzero: 0x%x:%x\n", - reg0.which_io, reg0.phys_addr); - return; - } - up->port.mapbase = reg0.phys_addr; - if ((up->port.membase = ioremap(reg0.phys_addr, reg0.reg_size)) == 0) { - prom_printf("sunsu: Cannot map registers.\n"); - return; - } - - /* - * 0x20 is sun4m thing, Dave Redman heritage. - * See arch/sparc/kernel/irq.c. - */ -#define IRQ_4M(n) ((n)|0x20) - - /* - * There is no intr property on MrCoffee, so hardwire it. - */ - up->port.irq = IRQ_4M(13); -#endif - -ebus_done: - spin_lock_irqsave(&up->port.lock, flags); if (!(up->port.flags & UPF_BUGGY_UART)) { @@ -1269,18 +1180,13 @@ static struct uart_driver sunsu_reg = { .major = TTY_MAJOR, }; -static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel) +static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up) { int quot, baud; #ifdef CONFIG_SERIO struct serio *serio; #endif - spin_lock_init(&up->port.lock); - up->port.line = channel; - up->port.type = PORT_UNKNOWN; - up->port.uartclk = (SU_BASE_BAUD * 16); - if (up->su_type == SU_PORT_KBD) { up->cflag = B1200 | CS8 | CLOCAL | CREAD; baud = 1200; @@ -1292,41 +1198,31 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel) sunsu_autoconfig(up); if (up->port.type == PORT_UNKNOWN) - return -1; - - printk(KERN_INFO "su%d at 0x%p (irq = %d) is a %s\n", - channel, - up->port.membase, up->port.irq, - sunsu_type(&up->port)); + return -ENODEV; #ifdef CONFIG_SERIO - up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL); - if (serio) { - memset(serio, 0, sizeof(*serio)); - - serio->port_data = up; - - serio->id.type = SERIO_RS232; - if (up->su_type == SU_PORT_KBD) { - serio->id.proto = SERIO_SUNKBD; - strlcpy(serio->name, "sukbd", sizeof(serio->name)); - } else { - serio->id.proto = SERIO_SUN; - serio->id.extra = 1; - strlcpy(serio->name, "sums", sizeof(serio->name)); - } - strlcpy(serio->phys, (channel == 0 ? "su/serio0" : "su/serio1"), - sizeof(serio->phys)); - - serio->write = sunsu_serio_write; - serio->open = sunsu_serio_open; - serio->close = sunsu_serio_close; + serio = &up->serio; + serio->port_data = up; - serio_register_port(serio); + serio->id.type = SERIO_RS232; + if (up->su_type == SU_PORT_KBD) { + serio->id.proto = SERIO_SUNKBD; + strlcpy(serio->name, "sukbd", sizeof(serio->name)); } else { - printk(KERN_WARNING "su%d: not enough memory for serio port\n", - channel); + serio->id.proto = SERIO_SUN; + serio->id.extra = 1; + strlcpy(serio->name, "sums", sizeof(serio->name)); } + strlcpy(serio->phys, + (!(up->port.line & 1) ? "su/serio0" : "su/serio1"), + sizeof(serio->phys)); + + serio->write = sunsu_serio_write; + serio->open = sunsu_serio_open; + serio->close = sunsu_serio_close; + serio->dev.parent = up->port.dev; + + serio_register_port(serio); #endif sunsu_change_speed(&up->port, up->cflag, 0, quot); @@ -1458,22 +1354,20 @@ static struct console sunsu_cons = { * Register console. */ -static inline struct console *SUNSU_CONSOLE(void) +static inline struct console *SUNSU_CONSOLE(int num_uart) { int i; if (con_is_present()) return NULL; - for (i = 0; i < UART_NR; i++) { + for (i = 0; i < num_uart; i++) { int this_minor = sunsu_reg.minor + i; if ((this_minor - 64) == (serial_console - 1)) break; } - if (i == UART_NR) - return NULL; - if (sunsu_ports[i].port_node == 0) + if (i == num_uart) return NULL; sunsu_cons.index = i; @@ -1481,252 +1375,186 @@ static inline struct console *SUNSU_CONSOLE(void) return &sunsu_cons; } #else -#define SUNSU_CONSOLE() (NULL) +#define SUNSU_CONSOLE(num_uart) (NULL) #define sunsu_serial_console_init() do { } while (0) #endif -static int __init sunsu_serial_init(void) +static enum su_type __devinit su_get_type(struct device_node *dp) { - int instance, ret, i; + struct device_node *ap = of_find_node_by_path("/aliases"); - /* How many instances do we need? */ - instance = 0; - for (i = 0; i < UART_NR; i++) { - struct uart_sunsu_port *up = &sunsu_ports[i]; + if (ap) { + char *keyb = of_get_property(ap, "keyboard", NULL); + char *ms = of_get_property(ap, "mouse", NULL); - if (up->su_type == SU_PORT_MS || - up->su_type == SU_PORT_KBD) - continue; + if (keyb) { + if (dp == of_find_node_by_path(keyb)) + return SU_PORT_KBD; + } + if (ms) { + if (dp == of_find_node_by_path(ms)) + return SU_PORT_MS; + } + } - spin_lock_init(&up->port.lock); - up->port.flags |= UPF_BOOT_AUTOCONF; - up->port.type = PORT_UNKNOWN; - up->port.uartclk = (SU_BASE_BAUD * 16); + return SU_PORT_PORT; +} - sunsu_autoconfig(up); - if (up->port.type == PORT_UNKNOWN) - continue; +static int __devinit su_probe(struct of_device *op, const struct of_device_id *match) +{ + static int inst; + struct device_node *dp = op->node; + struct uart_sunsu_port *up; + struct resource *rp; + int err; - up->port.line = instance++; - up->port.ops = &sunsu_pops; - } + if (inst >= UART_NR) + return -EINVAL; - sunsu_reg.minor = sunserial_current_minor; + up = &sunsu_ports[inst]; + up->port.line = inst; - sunsu_reg.nr = instance; + spin_lock_init(&up->port.lock); - ret = uart_register_driver(&sunsu_reg); - if (ret < 0) - return ret; + up->su_type = su_get_type(dp); - sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; + rp = &op->resource[0]; + up->port.mapbase = op->resource[0].start; - sunserial_current_minor += instance; + up->reg_size = (rp->end - rp->start) + 1; + up->port.membase = of_ioremap(rp, 0, up->reg_size, "su"); + if (!up->port.membase) + return -ENOMEM; - sunsu_reg.cons = SUNSU_CONSOLE(); + up->port.irq = op->irqs[0]; - for (i = 0; i < UART_NR; i++) { - struct uart_sunsu_port *up = &sunsu_ports[i]; + up->port.dev = &op->dev; - /* Do not register Keyboard/Mouse lines with UART - * layer. - */ - if (up->su_type == SU_PORT_MS || - up->su_type == SU_PORT_KBD) - continue; + up->port.type = PORT_UNKNOWN; + up->port.uartclk = (SU_BASE_BAUD * 16); - if (up->port.type == PORT_UNKNOWN) - continue; + err = 0; + if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) { + err = sunsu_kbd_ms_init(up); + if (err) + goto out_unmap; - uart_add_one_port(&sunsu_reg, &up->port); + return 0; } - return 0; -} + up->port.flags |= UPF_BOOT_AUTOCONF; -static int su_node_ok(int node, char *name, int namelen) -{ - if (strncmp(name, "su", namelen) == 0 || - strncmp(name, "su_pnp", namelen) == 0) - return 1; - - if (strncmp(name, "serial", namelen) == 0) { - char compat[32]; - int clen; - - /* Is it _really_ a 'su' device? */ - clen = prom_getproperty(node, "compatible", compat, sizeof(compat)); - if (clen > 0) { - if (strncmp(compat, "sab82532", 8) == 0) { - /* Nope, Siemens serial, not for us. */ - return 0; - } - } - return 1; - } + sunsu_autoconfig(up); - return 0; -} + err = -ENODEV; + if (up->port.type == PORT_UNKNOWN) + goto out_unmap; -#define SU_PROPSIZE 128 + up->port.ops = &sunsu_pops; -/* - * Scan status structure. - * "prop" is a local variable but it eats stack to keep it in each - * stack frame of a recursive procedure. - */ -struct su_probe_scan { - int msnode, kbnode; /* PROM nodes for mouse and keyboard */ - int msx, kbx; /* minors for mouse and keyboard */ - int devices; /* scan index */ - char prop[SU_PROPSIZE]; -}; + err = uart_add_one_port(&sunsu_reg, &up->port); + if (err) + goto out_unmap; -/* - * We have several platforms which present 'su' in different parts - * of the device tree. 'su' may be found under obio, ebus, isa and pci. - * We walk over the tree and find them wherever PROM hides them. - */ -static void __init su_probe_any(struct su_probe_scan *t, int sunode) -{ - struct uart_sunsu_port *up; - int len; + dev_set_drvdata(&op->dev, up); - if (t->devices >= UART_NR) - return; + inst++; - for (; sunode != 0; sunode = prom_getsibling(sunode)) { - len = prom_getproperty(sunode, "name", t->prop, SU_PROPSIZE); - if (len <= 1) - continue; /* Broken PROM node */ - - if (su_node_ok(sunode, t->prop, len)) { - up = &sunsu_ports[t->devices]; - if (t->kbnode != 0 && sunode == t->kbnode) { - t->kbx = t->devices; - up->su_type = SU_PORT_KBD; - } else if (t->msnode != 0 && sunode == t->msnode) { - t->msx = t->devices; - up->su_type = SU_PORT_MS; - } else { -#ifdef CONFIG_SPARC64 - /* - * Do not attempt to use the truncated - * keyboard/mouse ports as serial ports - * on Ultras with PC keyboard attached. - */ - if (prom_getbool(sunode, "mouse")) - continue; - if (prom_getbool(sunode, "keyboard")) - continue; -#endif - up->su_type = SU_PORT_PORT; - } - up->port_node = sunode; - ++t->devices; - } else { - su_probe_any(t, prom_getchild(sunode)); - } - } + return 0; + +out_unmap: + of_iounmap(up->port.membase, up->reg_size); + return err; } -static int __init sunsu_probe(void) +static int __devexit su_remove(struct of_device *dev) { - int node; - int len; - struct su_probe_scan scan; + struct uart_sunsu_port *up = dev_get_drvdata(&dev->dev);; - /* - * First, we scan the tree. - */ - scan.devices = 0; - scan.msx = -1; - scan.kbx = -1; - scan.kbnode = 0; - scan.msnode = 0; + if (up->su_type == SU_PORT_MS || + up->su_type == SU_PORT_KBD) { +#ifdef CONFIG_SERIO + serio_unregister_port(&up->serio); +#endif + } else if (up->port.type != PORT_UNKNOWN) + uart_remove_one_port(&sunsu_reg, &up->port); - /* - * Get the nodes for keyboard and mouse from 'aliases'... - */ - node = prom_getchild(prom_root_node); - node = prom_searchsiblings(node, "aliases"); - if (node != 0) { - len = prom_getproperty(node, "keyboard", scan.prop, SU_PROPSIZE); - if (len > 0) { - scan.prop[len] = 0; - scan.kbnode = prom_finddevice(scan.prop); - } + return 0; +} - len = prom_getproperty(node, "mouse", scan.prop, SU_PROPSIZE); - if (len > 0) { - scan.prop[len] = 0; - scan.msnode = prom_finddevice(scan.prop); - } - } +static struct of_device_id su_match[] = { + { + .name = "su", + }, + { + .name = "su_pnp", + }, + { + .name = "serial", + .compatible = "su", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, su_match); - su_probe_any(&scan, prom_getchild(prom_root_node)); +static struct of_platform_driver su_driver = { + .name = "su", + .match_table = su_match, + .probe = su_probe, + .remove = __devexit_p(su_remove), +}; - /* - * Second, we process the special case of keyboard and mouse. - * - * Currently if we got keyboard and mouse hooked to "su" ports - * we do not use any possible remaining "su" as a serial port. - * Thus, we ignore values of .msx and .kbx, then compact ports. - */ - if (scan.msx != -1 && scan.kbx != -1) { - sunsu_ports[0].su_type = SU_PORT_MS; - sunsu_ports[0].port_node = scan.msnode; - sunsu_kbd_ms_init(&sunsu_ports[0], 0); +static int num_uart; - sunsu_ports[1].su_type = SU_PORT_KBD; - sunsu_ports[1].port_node = scan.kbnode; - sunsu_kbd_ms_init(&sunsu_ports[1], 1); +static int __init sunsu_init(void) +{ + struct device_node *dp; + int err; - return 0; + num_uart = 0; + for_each_node_by_name(dp, "su") { + if (su_get_type(dp) == SU_PORT_PORT) + num_uart++; } - - if (scan.msx != -1 || scan.kbx != -1) { - printk("sunsu_probe: cannot match keyboard and mouse, confused\n"); - return -ENODEV; + for_each_node_by_name(dp, "su_pnp") { + if (su_get_type(dp) == SU_PORT_PORT) + num_uart++; + } + for_each_node_by_name(dp, "serial") { + if (of_device_is_compatible(dp, "su")) { + if (su_get_type(dp) == SU_PORT_PORT) + num_uart++; + } } - if (scan.devices == 0) - return -ENODEV; + if (num_uart) { + sunsu_reg.minor = sunserial_current_minor; + sunsu_reg.nr = num_uart; + err = uart_register_driver(&sunsu_reg); + if (err) + return err; + sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; + sunserial_current_minor += num_uart; + sunsu_reg.cons = SUNSU_CONSOLE(num_uart); + } - /* - * Console must be initiated after the generic initialization. - */ - sunsu_serial_init(); + err = of_register_driver(&su_driver, &of_bus_type); + if (err && num_uart) + uart_unregister_driver(&sunsu_reg); - return 0; + return err; } static void __exit sunsu_exit(void) { - int i, saw_uart; - - saw_uart = 0; - for (i = 0; i < UART_NR; i++) { - struct uart_sunsu_port *up = &sunsu_ports[i]; - - if (up->su_type == SU_PORT_MS || - up->su_type == SU_PORT_KBD) { -#ifdef CONFIG_SERIO - if (up->serio) { - serio_unregister_port(up->serio); - up->serio = NULL; - } -#endif - } else if (up->port.type != PORT_UNKNOWN) { - uart_remove_one_port(&sunsu_reg, &up->port); - saw_uart++; - } - } - - if (saw_uart) + if (num_uart) uart_unregister_driver(&sunsu_reg); } -module_init(sunsu_probe); +module_init(sunsu_init); module_exit(sunsu_exit); + +MODULE_AUTHOR("Eddie C. Dost, Peter Zaitcev, and David S. Miller"); +MODULE_DESCRIPTION("Sun SU serial port driver"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 9f42677..9ee7f3a 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1,5 +1,4 @@ -/* - * sunzilog.c +/* sunzilog.c: Zilog serial driver for Sparc systems. * * Driver for Zilog serial chips found on Sun workstations and * servers. This driver could actually be made more generic. @@ -10,10 +9,9 @@ * C. Dost, Pete Zaitcev, Ted Ts'o and Alex Buell for their * work there. * - * Copyright (C) 2002 David S. Miller (davem@redhat.com) + * Copyright (C) 2002, 2006 David S. Miller (davem@davemloft.net) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -38,10 +36,8 @@ #include <asm/io.h> #include <asm/irq.h> -#ifdef CONFIG_SPARC64 -#include <asm/fhc.h> -#endif -#include <asm/sbus.h> +#include <asm/prom.h> +#include <asm/of_device.h> #if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ @@ -65,7 +61,7 @@ #define ZSDELAY() #define ZSDELAY_LONG() #define ZS_WSYNC(__channel) \ - sbus_readb(&((__channel)->control)) + readb(&((__channel)->control)) #endif static int num_sunzilog; @@ -107,7 +103,7 @@ struct uart_sunzilog_port { unsigned char prev_status; #ifdef CONFIG_SERIO - struct serio *serio; + struct serio serio; int serio_open; #endif }; @@ -138,9 +134,9 @@ static unsigned char read_zsreg(struct zilog_channel __iomem *channel, { unsigned char retval; - sbus_writeb(reg, &channel->control); + writeb(reg, &channel->control); ZSDELAY(); - retval = sbus_readb(&channel->control); + retval = readb(&channel->control); ZSDELAY(); return retval; @@ -149,9 +145,9 @@ static unsigned char read_zsreg(struct zilog_channel __iomem *channel, static void write_zsreg(struct zilog_channel __iomem *channel, unsigned char reg, unsigned char value) { - sbus_writeb(reg, &channel->control); + writeb(reg, &channel->control); ZSDELAY(); - sbus_writeb(value, &channel->control); + writeb(value, &channel->control); ZSDELAY(); } @@ -162,17 +158,17 @@ static void sunzilog_clear_fifo(struct zilog_channel __iomem *channel) for (i = 0; i < 32; i++) { unsigned char regval; - regval = sbus_readb(&channel->control); + regval = readb(&channel->control); ZSDELAY(); if (regval & Rx_CH_AV) break; regval = read_zsreg(channel, R1); - sbus_readb(&channel->data); + readb(&channel->data); ZSDELAY(); if (regval & (PAR_ERR | Rx_OVR | CRC_ERR)) { - sbus_writeb(ERR_RES, &channel->control); + writeb(ERR_RES, &channel->control); ZSDELAY(); ZS_WSYNC(channel); } @@ -194,7 +190,7 @@ static void __load_zsregs(struct zilog_channel __iomem *channel, unsigned char * udelay(100); } - sbus_writeb(ERR_RES, &channel->control); + writeb(ERR_RES, &channel->control); ZSDELAY(); ZS_WSYNC(channel); @@ -291,7 +287,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up, /* Stop-A is handled by drivers/char/keyboard.c now. */ #ifdef CONFIG_SERIO if (up->serio_open) - serio_interrupt(up->serio, ch, 0, regs); + serio_interrupt(&up->serio, ch, 0, regs); #endif } else if (ZS_IS_MOUSE(up)) { int ret = suncore_mouse_baud_detection(ch, is_break); @@ -306,7 +302,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up, case 0: #ifdef CONFIG_SERIO if (up->serio_open) - serio_interrupt(up->serio, ch, 0, regs); + serio_interrupt(&up->serio, ch, 0, regs); #endif break; }; @@ -330,12 +326,12 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, r1 = read_zsreg(channel, R1); if (r1 & (PAR_ERR | Rx_OVR | CRC_ERR)) { - sbus_writeb(ERR_RES, &channel->control); + writeb(ERR_RES, &channel->control); ZSDELAY(); ZS_WSYNC(channel); } - ch = sbus_readb(&channel->control); + ch = readb(&channel->control); ZSDELAY(); /* This funny hack depends upon BRK_ABRT not interfering @@ -347,7 +343,7 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, if (!(ch & Rx_CH_AV)) break; - ch = sbus_readb(&channel->data); + ch = readb(&channel->data); ZSDELAY(); ch &= up->parity_mask; @@ -406,10 +402,10 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up, { unsigned char status; - status = sbus_readb(&channel->control); + status = readb(&channel->control); ZSDELAY(); - sbus_writeb(RES_EXT_INT, &channel->control); + writeb(RES_EXT_INT, &channel->control); ZSDELAY(); ZS_WSYNC(channel); @@ -421,7 +417,7 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up, * confusing the PROM. */ while (1) { - status = sbus_readb(&channel->control); + status = readb(&channel->control); ZSDELAY(); if (!(status & BRK_ABRT)) break; @@ -458,7 +454,7 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, struct circ_buf *xmit; if (ZS_IS_CONS(up)) { - unsigned char status = sbus_readb(&channel->control); + unsigned char status = readb(&channel->control); ZSDELAY(); /* TX still busy? Just wait for the next TX done interrupt. @@ -487,7 +483,7 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, if (up->port.x_char) { up->flags |= SUNZILOG_FLAG_TX_ACTIVE; - sbus_writeb(up->port.x_char, &channel->data); + writeb(up->port.x_char, &channel->data); ZSDELAY(); ZS_WSYNC(channel); @@ -506,7 +502,7 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, goto ack_tx_int; up->flags |= SUNZILOG_FLAG_TX_ACTIVE; - sbus_writeb(xmit->buf[xmit->tail], &channel->data); + writeb(xmit->buf[xmit->tail], &channel->data); ZSDELAY(); ZS_WSYNC(channel); @@ -519,7 +515,7 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, return; ack_tx_int: - sbus_writeb(RES_Tx_P, &channel->control); + writeb(RES_Tx_P, &channel->control); ZSDELAY(); ZS_WSYNC(channel); } @@ -540,7 +536,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg /* Channel A */ tty = NULL; if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { - sbus_writeb(RES_H_IUS, &channel->control); + writeb(RES_H_IUS, &channel->control); ZSDELAY(); ZS_WSYNC(channel); @@ -563,7 +559,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id, struct pt_regs *reg spin_lock(&up->port.lock); tty = NULL; if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { - sbus_writeb(RES_H_IUS, &channel->control); + writeb(RES_H_IUS, &channel->control); ZSDELAY(); ZS_WSYNC(channel); @@ -594,7 +590,7 @@ static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *p unsigned char status; channel = ZILOG_CHANNEL_FROM_PORT(port); - status = sbus_readb(&channel->control); + status = readb(&channel->control); ZSDELAY(); return status; @@ -682,7 +678,7 @@ static void sunzilog_start_tx(struct uart_port *port) up->flags |= SUNZILOG_FLAG_TX_ACTIVE; up->flags &= ~SUNZILOG_FLAG_TX_STOPPED; - status = sbus_readb(&channel->control); + status = readb(&channel->control); ZSDELAY(); /* TX busy? Just wait for the TX done interrupt. */ @@ -693,7 +689,7 @@ static void sunzilog_start_tx(struct uart_port *port) * IRQ sending engine. */ if (port->x_char) { - sbus_writeb(port->x_char, &channel->data); + writeb(port->x_char, &channel->data); ZSDELAY(); ZS_WSYNC(channel); @@ -702,7 +698,7 @@ static void sunzilog_start_tx(struct uart_port *port) } else { struct circ_buf *xmit = &port->info->xmit; - sbus_writeb(xmit->buf[xmit->tail], &channel->data); + writeb(xmit->buf[xmit->tail], &channel->data); ZSDELAY(); ZS_WSYNC(channel); @@ -779,7 +775,7 @@ static void __sunzilog_startup(struct uart_sunzilog_port *up) struct zilog_channel __iomem *channel; channel = ZILOG_CHANNEL_FROM_PORT(&up->port); - up->prev_status = sbus_readb(&channel->control); + up->prev_status = readb(&channel->control); /* Enable receiver and transmitter. */ up->curregs[R3] |= RxENAB; @@ -963,7 +959,7 @@ sunzilog_set_termios(struct uart_port *port, struct termios *termios, static const char *sunzilog_type(struct uart_port *port) { - return "SunZilog"; + return "zs"; } /* We do not request/release mappings of the registers here, this @@ -1012,7 +1008,6 @@ static struct uart_sunzilog_port *sunzilog_port_table; static struct zilog_layout __iomem **sunzilog_chip_regs; static struct uart_sunzilog_port *sunzilog_irq_chain; -static int zilog_irq = -1; static struct uart_driver sunzilog_reg = { .owner = THIS_MODULE, @@ -1021,232 +1016,47 @@ static struct uart_driver sunzilog_reg = { .major = TTY_MAJOR, }; -static void * __init alloc_one_table(unsigned long size) -{ - void *ret; - - ret = kmalloc(size, GFP_KERNEL); - if (ret != NULL) - memset(ret, 0, size); - - return ret; -} - -static void __init sunzilog_alloc_tables(void) -{ - sunzilog_port_table = - alloc_one_table(NUM_CHANNELS * sizeof(struct uart_sunzilog_port)); - sunzilog_chip_regs = - alloc_one_table(NUM_SUNZILOG * sizeof(struct zilog_layout __iomem *)); - - if (sunzilog_port_table == NULL || sunzilog_chip_regs == NULL) { - prom_printf("SunZilog: Cannot allocate tables.\n"); - prom_halt(); - } -} - -#ifdef CONFIG_SPARC64 - -/* We used to attempt to use the address property of the Zilog device node - * but that totally is not necessary on sparc64. - */ -static struct zilog_layout __iomem * __init get_zs_sun4u(int chip, int zsnode) +static int __init sunzilog_alloc_tables(void) { - void __iomem *mapped_addr; - unsigned int sun4u_ino; - struct sbus_bus *sbus = NULL; - struct sbus_dev *sdev = NULL; - int err; - - if (central_bus == NULL) { - for_each_sbus(sbus) { - for_each_sbusdev(sdev, sbus) { - if (sdev->prom_node == zsnode) - goto found; - } - } - } - found: - if (sdev == NULL && central_bus == NULL) { - prom_printf("SunZilog: sdev&¢ral == NULL for " - "Zilog %d in get_zs_sun4u.\n", chip); - prom_halt(); - } - if (central_bus == NULL) { - mapped_addr = - sbus_ioremap(&sdev->resource[0], 0, - PAGE_SIZE, - "Zilog Registers"); - } else { - struct linux_prom_registers zsregs[1]; - - err = prom_getproperty(zsnode, "reg", - (char *) &zsregs[0], - sizeof(zsregs)); - if (err == -1) { - prom_printf("SunZilog: Cannot map " - "Zilog %d regs on " - "central bus.\n", chip); - prom_halt(); - } - apply_fhc_ranges(central_bus->child, - &zsregs[0], 1); - apply_central_ranges(central_bus, &zsregs[0], 1); - mapped_addr = (void __iomem *) - ((((u64)zsregs[0].which_io)<<32UL) | - ((u64)zsregs[0].phys_addr)); - } - - if (zilog_irq == -1) { - if (central_bus) { - unsigned long iclr, imap; - - iclr = central_bus->child->fhc_regs.uregs - + FHC_UREGS_ICLR; - imap = central_bus->child->fhc_regs.uregs - + FHC_UREGS_IMAP; - zilog_irq = build_irq(0, iclr, imap); - } else { - err = prom_getproperty(zsnode, "interrupts", - (char *) &sun4u_ino, - sizeof(sun4u_ino)); - zilog_irq = sbus_build_irq(sbus_root, sun4u_ino); - } - } - - return (struct zilog_layout __iomem *) mapped_addr; -} -#else /* CONFIG_SPARC64 */ - -/* - * XXX The sun4d case is utterly screwed: it tries to re-walk the tree - * (for the 3rd time) in order to find bootbus and cpu. Streamline it. - */ -static struct zilog_layout __iomem * __init get_zs_sun4cmd(int chip, int node) -{ - struct linux_prom_irqs irq_info[2]; - void __iomem *mapped_addr = NULL; - int zsnode, cpunode, bbnode; - struct linux_prom_registers zsreg[4]; - struct resource res; - - if (sparc_cpu_model == sun4d) { - int walk; - - zsnode = 0; - bbnode = 0; - cpunode = 0; - for (walk = prom_getchild(prom_root_node); - (walk = prom_searchsiblings(walk, "cpu-unit")) != 0; - walk = prom_getsibling(walk)) { - bbnode = prom_getchild(walk); - if (bbnode && - (bbnode = prom_searchsiblings(bbnode, "bootbus"))) { - if ((zsnode = prom_getchild(bbnode)) == node) { - cpunode = walk; - break; - } - } - } - if (!walk) { - prom_printf("SunZilog: Cannot find the %d'th bootbus on sun4d.\n", - (chip / 2)); - prom_halt(); - } + struct uart_sunzilog_port *up; + unsigned long size; + int i; - if (prom_getproperty(zsnode, "reg", - (char *) zsreg, sizeof(zsreg)) == -1) { - prom_printf("SunZilog: Cannot map Zilog %d\n", chip); - prom_halt(); - } - /* XXX Looks like an off by one? */ - prom_apply_generic_ranges(bbnode, cpunode, zsreg, 1); - res.start = zsreg[0].phys_addr; - res.end = res.start + (8 - 1); - res.flags = zsreg[0].which_io | IORESOURCE_IO; - mapped_addr = sbus_ioremap(&res, 0, 8, "Zilog Serial"); + size = NUM_CHANNELS * sizeof(struct uart_sunzilog_port); + sunzilog_port_table = kzalloc(size, GFP_KERNEL); + if (!sunzilog_port_table) + return -ENOMEM; - } else { - zsnode = node; + for (i = 0; i < NUM_CHANNELS; i++) { + up = &sunzilog_port_table[i]; -#if 0 /* XXX When was this used? */ - if (prom_getintdefault(zsnode, "slave", -1) != chipid) { - zsnode = prom_getsibling(zsnode); - continue; - } -#endif + spin_lock_init(&up->port.lock); - /* - * "address" is only present on ports that OBP opened - * (from Mitch Bradley's "Hitchhiker's Guide to OBP"). - * We do not use it. - */ + if (i == 0) + sunzilog_irq_chain = up; - if (prom_getproperty(zsnode, "reg", - (char *) zsreg, sizeof(zsreg)) == -1) { - prom_printf("SunZilog: Cannot map Zilog %d\n", chip); - prom_halt(); - } - if (sparc_cpu_model == sun4m) /* Crude. Pass parent. XXX */ - prom_apply_obio_ranges(zsreg, 1); - res.start = zsreg[0].phys_addr; - res.end = res.start + (8 - 1); - res.flags = zsreg[0].which_io | IORESOURCE_IO; - mapped_addr = sbus_ioremap(&res, 0, 8, "Zilog Serial"); + if (i < NUM_CHANNELS - 1) + up->next = up + 1; + else + up->next = NULL; } - if (prom_getproperty(zsnode, "intr", - (char *) irq_info, sizeof(irq_info)) - % sizeof(struct linux_prom_irqs)) { - prom_printf("SunZilog: Cannot get IRQ property for Zilog %d.\n", - chip); - prom_halt(); - } - if (zilog_irq == -1) { - zilog_irq = irq_info[0].pri; - } else if (zilog_irq != irq_info[0].pri) { - /* XXX. Dumb. Should handle per-chip IRQ, for add-ons. */ - prom_printf("SunZilog: Inconsistent IRQ layout for Zilog %d.\n", - chip); - prom_halt(); + size = NUM_SUNZILOG * sizeof(struct zilog_layout __iomem *); + sunzilog_chip_regs = kzalloc(size, GFP_KERNEL); + if (!sunzilog_chip_regs) { + kfree(sunzilog_port_table); + sunzilog_irq_chain = NULL; + return -ENOMEM; } - return (struct zilog_layout __iomem *) mapped_addr; + return 0; } -#endif /* !(CONFIG_SPARC64) */ -/* Get the address of the registers for SunZilog instance CHIP. */ -static struct zilog_layout __iomem * __init get_zs(int chip, int node) +static void sunzilog_free_tables(void) { - if (chip < 0 || chip >= NUM_SUNZILOG) { - prom_printf("SunZilog: Illegal chip number %d in get_zs.\n", chip); - prom_halt(); - } - -#ifdef CONFIG_SPARC64 - return get_zs_sun4u(chip, node); -#else - - if (sparc_cpu_model == sun4) { - struct resource res; - - /* Not probe-able, hard code it. */ - switch (chip) { - case 0: - res.start = 0xf1000000; - break; - case 1: - res.start = 0xf0000000; - break; - }; - zilog_irq = 12; - res.end = (res.start + (8 - 1)); - res.flags = IORESOURCE_IO; - return sbus_ioremap(&res, 0, 8, "SunZilog"); - } - - return get_zs_sun4cmd(chip, node); -#endif + kfree(sunzilog_port_table); + sunzilog_irq_chain = NULL; + kfree(sunzilog_chip_regs); } #define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */ @@ -1260,7 +1070,7 @@ static void sunzilog_putchar(struct uart_port *port, int ch) * udelay with ZSDELAY as that is a NOP on some platforms. -DaveM */ do { - unsigned char val = sbus_readb(&channel->control); + unsigned char val = readb(&channel->control); if (val & Tx_BUF_EMP) { ZSDELAY(); break; @@ -1268,7 +1078,7 @@ static void sunzilog_putchar(struct uart_port *port, int ch) udelay(5); } while (--loops); - sbus_writeb(ch, &channel->data); + writeb(ch, &channel->data); ZSDELAY(); ZS_WSYNC(channel); } @@ -1385,28 +1195,6 @@ static struct console sunzilog_console = { .data = &sunzilog_reg, }; -static int __init sunzilog_console_init(void) -{ - int i; - - if (con_is_present()) - return 0; - - for (i = 0; i < NUM_CHANNELS; i++) { - int this_minor = sunzilog_reg.minor + i; - - if ((this_minor - 64) == (serial_console - 1)) - break; - } - if (i == NUM_CHANNELS) - return 0; - - sunzilog_console.index = i; - sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS; - register_console(&sunzilog_console); - return 0; -} - static inline struct console *SUNZILOG_CONSOLE(void) { int i; @@ -1431,101 +1219,8 @@ static inline struct console *SUNZILOG_CONSOLE(void) #else #define SUNZILOG_CONSOLE() (NULL) -#define sunzilog_console_init() do { } while (0) #endif -/* - * We scan the PROM tree recursively. This is the most reliable way - * to find Zilog nodes on various platforms. However, we face an extreme - * shortage of kernel stack, so we must be very careful. To that end, - * we scan only to a certain depth, and we use a common property buffer - * in the scan structure. - */ -#define ZS_PROPSIZE 128 -#define ZS_SCAN_DEPTH 5 - -struct zs_probe_scan { - int depth; - void (*scanner)(struct zs_probe_scan *t, int node); - - int devices; - char prop[ZS_PROPSIZE]; -}; - -static int __inline__ sunzilog_node_ok(int node, const char *name, int len) -{ - if (strncmp(name, "zs", len) == 0) - return 1; - /* Don't fold this procedure just yet. Compare to su_node_ok(). */ - return 0; -} - -static void __init sunzilog_scan(struct zs_probe_scan *t, int node) -{ - int len; - - for (; node != 0; node = prom_getsibling(node)) { - len = prom_getproperty(node, "name", t->prop, ZS_PROPSIZE); - if (len <= 1) - continue; /* Broken PROM node */ - if (sunzilog_node_ok(node, t->prop, len)) { - (*t->scanner)(t, node); - } else { - if (t->depth < ZS_SCAN_DEPTH) { - t->depth++; - sunzilog_scan(t, prom_getchild(node)); - --t->depth; - } - } - } -} - -static void __init sunzilog_prepare(void) -{ - struct uart_sunzilog_port *up; - struct zilog_layout __iomem *rp; - int channel, chip; - - /* - * Temporary fix. - */ - for (channel = 0; channel < NUM_CHANNELS; channel++) - spin_lock_init(&sunzilog_port_table[channel].port.lock); - - sunzilog_irq_chain = up = &sunzilog_port_table[0]; - for (channel = 0; channel < NUM_CHANNELS - 1; channel++) - up[channel].next = &up[channel + 1]; - up[channel].next = NULL; - - for (chip = 0; chip < NUM_SUNZILOG; chip++) { - rp = sunzilog_chip_regs[chip]; - up[(chip * 2) + 0].port.membase = (void __iomem *)&rp->channelA; - up[(chip * 2) + 1].port.membase = (void __iomem *)&rp->channelB; - - /* Channel A */ - up[(chip * 2) + 0].port.iotype = UPIO_MEM; - up[(chip * 2) + 0].port.irq = zilog_irq; - up[(chip * 2) + 0].port.uartclk = ZS_CLOCK; - up[(chip * 2) + 0].port.fifosize = 1; - up[(chip * 2) + 0].port.ops = &sunzilog_pops; - up[(chip * 2) + 0].port.type = PORT_SUNZILOG; - up[(chip * 2) + 0].port.flags = 0; - up[(chip * 2) + 0].port.line = (chip * 2) + 0; - up[(chip * 2) + 0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A; - - /* Channel B */ - up[(chip * 2) + 1].port.iotype = UPIO_MEM; - up[(chip * 2) + 1].port.irq = zilog_irq; - up[(chip * 2) + 1].port.uartclk = ZS_CLOCK; - up[(chip * 2) + 1].port.fifosize = 1; - up[(chip * 2) + 1].port.ops = &sunzilog_pops; - up[(chip * 2) + 1].port.type = PORT_SUNZILOG; - up[(chip * 2) + 1].port.flags = 0; - up[(chip * 2) + 1].port.line = (chip * 2) + 1; - up[(chip * 2) + 1].flags |= 0; - } -} - static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channel) { int baud, brg; @@ -1539,8 +1234,6 @@ static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channe up->cflag = B4800 | CS8 | CLOCAL | CREAD; baud = 4800; } - printk(KERN_INFO "zs%d at 0x%p (irq = %d) is a SunZilog\n", - channel, up->port.membase, zilog_irq); up->curregs[R15] = BRKIE; brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); @@ -1552,216 +1245,268 @@ static void __init sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channe #ifdef CONFIG_SERIO static void __init sunzilog_register_serio(struct uart_sunzilog_port *up, int channel) { - struct serio *serio; - - up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL); - if (serio) { - memset(serio, 0, sizeof(*serio)); - - serio->port_data = up; - - serio->id.type = SERIO_RS232; - if (channel == KEYBOARD_LINE) { - serio->id.proto = SERIO_SUNKBD; - strlcpy(serio->name, "zskbd", sizeof(serio->name)); - } else { - serio->id.proto = SERIO_SUN; - serio->id.extra = 1; - strlcpy(serio->name, "zsms", sizeof(serio->name)); - } - strlcpy(serio->phys, - (channel == KEYBOARD_LINE ? "zs/serio0" : "zs/serio1"), - sizeof(serio->phys)); + struct serio *serio = &up->serio; - serio->write = sunzilog_serio_write; - serio->open = sunzilog_serio_open; - serio->close = sunzilog_serio_close; + serio->port_data = up; - serio_register_port(serio); + serio->id.type = SERIO_RS232; + if (channel == KEYBOARD_LINE) { + serio->id.proto = SERIO_SUNKBD; + strlcpy(serio->name, "zskbd", sizeof(serio->name)); } else { - printk(KERN_WARNING "zs%d: not enough memory for serio port\n", - channel); + serio->id.proto = SERIO_SUN; + serio->id.extra = 1; + strlcpy(serio->name, "zsms", sizeof(serio->name)); } + strlcpy(serio->phys, + (channel == KEYBOARD_LINE ? "zs/serio0" : "zs/serio1"), + sizeof(serio->phys)); + + serio->write = sunzilog_serio_write; + serio->open = sunzilog_serio_open; + serio->close = sunzilog_serio_close; + serio->dev.parent = up->port.dev; + + serio_register_port(serio); } #endif -static void __init sunzilog_init_hw(void) +static void __init sunzilog_init_hw(struct uart_sunzilog_port *up) { - int i; - - for (i = 0; i < NUM_CHANNELS; i++) { - struct uart_sunzilog_port *up = &sunzilog_port_table[i]; - struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(&up->port); - unsigned long flags; - int baud, brg; + struct zilog_channel __iomem *channel; + unsigned long flags; + int baud, brg; - spin_lock_irqsave(&up->port.lock, flags); + channel = ZILOG_CHANNEL_FROM_PORT(&up->port); - if (ZS_IS_CHANNEL_A(up)) { - write_zsreg(channel, R9, FHWRES); - ZSDELAY_LONG(); - (void) read_zsreg(channel, R0); - } + spin_lock_irqsave(&up->port.lock, flags); + if (ZS_IS_CHANNEL_A(up)) { + write_zsreg(channel, R9, FHWRES); + ZSDELAY_LONG(); + (void) read_zsreg(channel, R0); + } - if (i == KEYBOARD_LINE || i == MOUSE_LINE) { - sunzilog_init_kbdms(up, i); - up->curregs[R9] |= (NV | MIE); - write_zsreg(channel, R9, up->curregs[R9]); - } else { - /* Normal serial TTY. */ - up->parity_mask = 0xff; - up->curregs[R1] = EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB; - up->curregs[R4] = PAR_EVEN | X16CLK | SB1; - up->curregs[R3] = RxENAB | Rx8; - up->curregs[R5] = TxENAB | Tx8; - up->curregs[R9] = NV | MIE; - up->curregs[R10] = NRZ; - up->curregs[R11] = TCBR | RCBR; - baud = 9600; - brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); - up->curregs[R12] = (brg & 0xff); - up->curregs[R13] = (brg >> 8) & 0xff; - up->curregs[R14] = BRSRC | BRENAB; - __load_zsregs(channel, up->curregs); - write_zsreg(channel, R9, up->curregs[R9]); - } + if (up->port.line == KEYBOARD_LINE || + up->port.line == MOUSE_LINE) { + sunzilog_init_kbdms(up, up->port.line); + up->curregs[R9] |= (NV | MIE); + write_zsreg(channel, R9, up->curregs[R9]); + } else { + /* Normal serial TTY. */ + up->parity_mask = 0xff; + up->curregs[R1] = EXT_INT_ENAB | INT_ALL_Rx | TxINT_ENAB; + up->curregs[R4] = PAR_EVEN | X16CLK | SB1; + up->curregs[R3] = RxENAB | Rx8; + up->curregs[R5] = TxENAB | Tx8; + up->curregs[R9] = NV | MIE; + up->curregs[R10] = NRZ; + up->curregs[R11] = TCBR | RCBR; + baud = 9600; + brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); + up->curregs[R12] = (brg & 0xff); + up->curregs[R13] = (brg >> 8) & 0xff; + up->curregs[R14] = BRSRC | BRENAB; + __load_zsregs(channel, up->curregs); + write_zsreg(channel, R9, up->curregs[R9]); + } - spin_unlock_irqrestore(&up->port.lock, flags); + spin_unlock_irqrestore(&up->port.lock, flags); #ifdef CONFIG_SERIO - if (i == KEYBOARD_LINE || i == MOUSE_LINE) - sunzilog_register_serio(up, i); + if (up->port.line == KEYBOARD_LINE || up->port.line == MOUSE_LINE) + sunzilog_register_serio(up, up->port.line); #endif - } -} - -static struct zilog_layout __iomem * __init get_zs(int chip, int node); - -static void __init sunzilog_scan_probe(struct zs_probe_scan *t, int node) -{ - sunzilog_chip_regs[t->devices] = get_zs(t->devices, node); - t->devices++; } -static int __init sunzilog_ports_init(void) +static int __devinit zs_get_instance(struct device_node *dp) { - struct zs_probe_scan scan; int ret; - int uart_count; - int i; - - printk(KERN_DEBUG "SunZilog: %d chips.\n", NUM_SUNZILOG); - - scan.scanner = sunzilog_scan_probe; - scan.depth = 0; - scan.devices = 0; - sunzilog_scan(&scan, prom_getchild(prom_root_node)); - - sunzilog_prepare(); - if (request_irq(zilog_irq, sunzilog_interrupt, SA_SHIRQ, - "SunZilog", sunzilog_irq_chain)) { - prom_printf("SunZilog: Unable to register zs interrupt handler.\n"); - prom_halt(); - } + ret = of_getintprop_default(dp, "slave", -1); + if (ret != -1) + return ret; - sunzilog_init_hw(); + if (of_find_property(dp, "keyboard", NULL)) + ret = 1; + else + ret = 0; - /* We can only init this once we have probed the Zilogs - * in the system. Do not count channels assigned to keyboards - * or mice when we are deciding how many ports to register. - */ - uart_count = 0; - for (i = 0; i < NUM_CHANNELS; i++) { - struct uart_sunzilog_port *up = &sunzilog_port_table[i]; + return ret; +} - if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) - continue; +static int zilog_irq = -1; - uart_count++; - } - - sunzilog_reg.nr = uart_count; - sunzilog_reg.minor = sunserial_current_minor; +static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *match) +{ + struct of_device *op = to_of_device(&dev->dev); + struct uart_sunzilog_port *up; + struct zilog_layout __iomem *rp; + int inst = zs_get_instance(dev->node); + int err; - ret = uart_register_driver(&sunzilog_reg); - if (ret == 0) { - sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; - sunzilog_reg.cons = SUNZILOG_CONSOLE(); + sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0, + sizeof(struct zilog_layout), + "zs"); + if (!sunzilog_chip_regs[inst]) + return -ENOMEM; - sunserial_current_minor += uart_count; + rp = sunzilog_chip_regs[inst]; - for (i = 0; i < NUM_CHANNELS; i++) { - struct uart_sunzilog_port *up = &sunzilog_port_table[i]; + if (zilog_irq == -1) { + zilog_irq = op->irqs[0]; + err = request_irq(zilog_irq, sunzilog_interrupt, SA_SHIRQ, + "zs", sunzilog_irq_chain); + if (err) { + of_iounmap(rp, sizeof(struct zilog_layout)); - if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) - continue; + return err; + } + } - if (uart_add_one_port(&sunzilog_reg, &up->port)) { - printk(KERN_ERR - "SunZilog: failed to add port zs%d\n", i); - } + up = &sunzilog_port_table[inst * 2]; + + /* Channel A */ + up[0].port.mapbase = op->resource[0].start + 0x00; + up[0].port.membase = (void __iomem *) &rp->channelA; + up[0].port.iotype = UPIO_MEM; + up[0].port.irq = op->irqs[0]; + up[0].port.uartclk = ZS_CLOCK; + up[0].port.fifosize = 1; + up[0].port.ops = &sunzilog_pops; + up[0].port.type = PORT_SUNZILOG; + up[0].port.flags = 0; + up[0].port.line = (inst * 2) + 0; + up[0].port.dev = &op->dev; + up[0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A; + if (inst == 1) + up[0].flags |= SUNZILOG_FLAG_CONS_KEYB; + sunzilog_init_hw(&up[0]); + + /* Channel B */ + up[1].port.mapbase = op->resource[0].start + 0x04; + up[1].port.membase = (void __iomem *) &rp->channelB; + up[1].port.iotype = UPIO_MEM; + up[1].port.irq = op->irqs[0]; + up[1].port.uartclk = ZS_CLOCK; + up[1].port.fifosize = 1; + up[1].port.ops = &sunzilog_pops; + up[1].port.type = PORT_SUNZILOG; + up[1].port.flags = 0; + up[1].port.line = (inst * 2) + 1; + up[1].port.dev = &op->dev; + up[1].flags |= 0; + if (inst == 1) + up[1].flags |= SUNZILOG_FLAG_CONS_MOUSE; + sunzilog_init_hw(&up[1]); + + if (inst != 1) { + err = uart_add_one_port(&sunzilog_reg, &up[0].port); + if (err) { + of_iounmap(rp, sizeof(struct zilog_layout)); + return err; + } + err = uart_add_one_port(&sunzilog_reg, &up[1].port); + if (err) { + uart_remove_one_port(&sunzilog_reg, &up[0].port); + of_iounmap(rp, sizeof(struct zilog_layout)); + return err; } } - return ret; + dev_set_drvdata(&dev->dev, &up[0]); + + return 0; } -static void __init sunzilog_scan_count(struct zs_probe_scan *t, int node) +static void __devexit zs_remove_one(struct uart_sunzilog_port *up) { - t->devices++; + if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) { +#ifdef CONFIG_SERIO + serio_unregister_port(&up->serio); +#endif + } else + uart_remove_one_port(&sunzilog_reg, &up->port); } -static int __init sunzilog_ports_count(void) +static int __devexit zs_remove(struct of_device *dev) { - struct zs_probe_scan scan; + struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev); + struct zilog_layout __iomem *regs; - /* Sun4 Zilog setup is hard coded, no probing to do. */ - if (sparc_cpu_model == sun4) - return 2; + zs_remove_one(&up[0]); + zs_remove_one(&up[1]); - scan.scanner = sunzilog_scan_count; - scan.depth = 0; - scan.devices = 0; + regs = sunzilog_chip_regs[up[0].port.line / 2]; + of_iounmap(regs, sizeof(struct zilog_layout)); - sunzilog_scan(&scan, prom_getchild(prom_root_node)); + dev_set_drvdata(&dev->dev, NULL); - return scan.devices; + return 0; } +static struct of_device_id zs_match[] = { + { + .name = "zs", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, zs_match); + +static struct of_platform_driver zs_driver = { + .name = "zs", + .match_table = zs_match, + .probe = zs_probe, + .remove = __devexit_p(zs_remove), +}; + static int __init sunzilog_init(void) { + struct device_node *dp; + int err; - NUM_SUNZILOG = sunzilog_ports_count(); - if (NUM_SUNZILOG == 0) - return -ENODEV; + NUM_SUNZILOG = 0; + for_each_node_by_name(dp, "zs") + NUM_SUNZILOG++; - sunzilog_alloc_tables(); + if (NUM_SUNZILOG) { + int uart_count; - sunzilog_ports_init(); + err = sunzilog_alloc_tables(); + if (err) + return err; - return 0; + /* Subtract 1 for keyboard, 1 for mouse. */ + uart_count = (NUM_SUNZILOG * 2) - 2; + + sunzilog_reg.nr = uart_count; + sunzilog_reg.minor = sunserial_current_minor; + err = uart_register_driver(&sunzilog_reg); + if (err) { + sunzilog_free_tables(); + return err; + } + sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; + sunzilog_reg.cons = SUNZILOG_CONSOLE(); + + sunserial_current_minor += uart_count; + } + + return of_register_driver(&zs_driver, &of_bus_type); } static void __exit sunzilog_exit(void) { - int i; + of_unregister_driver(&zs_driver); - for (i = 0; i < NUM_CHANNELS; i++) { - struct uart_sunzilog_port *up = &sunzilog_port_table[i]; - - if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) { -#ifdef CONFIG_SERIO - if (up->serio) { - serio_unregister_port(up->serio); - up->serio = NULL; - } -#endif - } else - uart_remove_one_port(&sunzilog_reg, &up->port); + if (zilog_irq != -1) { + free_irq(zilog_irq, sunzilog_irq_chain); + zilog_irq = -1; } - uart_unregister_driver(&sunzilog_reg); + if (NUM_SUNZILOG) { + uart_unregister_driver(&sunzilog_reg); + sunzilog_free_tables(); + } } module_init(sunzilog_init); @@ -1769,4 +1514,5 @@ module_exit(sunzilog_exit); MODULE_AUTHOR("David S. Miller"); MODULE_DESCRIPTION("Sun Zilog serial port driver"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index 017571f..e93d0ed 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c @@ -19,7 +19,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c index ed94631..0040f10 100644 --- a/drivers/sn/ioc3.c +++ b/drivers/sn/ioc3.c @@ -7,7 +7,6 @@ * Pat Gefre <pfg@sgi.com> - IOC3 serial port IRQ demuxer */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index dd2f950..a23862e 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/init.h> #include <linux/spinlock.h> #include <linux/workqueue.h> diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c index a006a1e..39d9b20 100644 --- a/drivers/spi/spi_butterfly.c +++ b/drivers/spi/spi_butterfly.c @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> diff --git a/drivers/tc/lk201.c b/drivers/tc/lk201.c index cf10d5c..757dec9 100644 --- a/drivers/tc/lk201.c +++ b/drivers/tc/lk201.c @@ -8,7 +8,6 @@ * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/sched.h> diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 7f27b35..93bc90b 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -39,7 +39,6 @@ * is shared with DSRS(DTE) at pin 23. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/signal.h> #include <linux/sched.h> diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index ad742ce..f4f4ef0 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -5,7 +5,6 @@ * and should work with all USB controllers, regardles of bus type. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index a9d89c7..4c9e63e 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/usb.h> #include <linux/module.h> #include <linux/init.h> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index bcbeaf7..f7bdd94 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -47,6 +47,7 @@ #include <linux/usbdevice_fs.h> #include <linux/cdev.h> #include <linux/notifier.h> +#include <linux/security.h> #include <asm/uaccess.h> #include <asm/byteorder.h> #include <linux/moduleparam.h> @@ -68,6 +69,7 @@ struct async { void __user *userbuffer; void __user *userurb; struct urb *urb; + u32 secid; }; static int usbfs_snoop = 0; @@ -312,7 +314,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs) sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = as->userurb; kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, - as->euid); + as->euid, as->secid); } snoop(&urb->dev->dev, "urb complete\n"); snoop_urb(urb, as->userurb); @@ -572,6 +574,7 @@ static int usbdev_open(struct inode *inode, struct file *file) ps->disc_euid = current->euid; ps->disccontext = NULL; ps->ifclaimed = 0; + security_task_getsecid(current, &ps->secid); wmb(); list_add_tail(&ps->list, &dev->filelist); file->private_data = ps; @@ -1053,6 +1056,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, as->pid = current->pid; as->uid = current->uid; as->euid = current->euid; + security_task_getsecid(current, &as->secid); if (!(uurb->endpoint & USB_DIR_IN)) { if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { free_async(as); diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index c196f38..ec89065 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -21,7 +21,6 @@ * */ -#include <linux/config.h> #include <linux/device.h> #include <linux/usb.h> #include "hcd.h" diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index f65b193c..abee0f5 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -15,7 +15,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/spinlock.h> #include <linux/errno.h> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 66b7840..9d16716 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -16,7 +16,6 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 4bf914d..fb4d058 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -22,7 +22,6 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e1731ff..875596e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/module.h> diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index bfc9b28..e47e3a8 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -27,7 +27,6 @@ /*****************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/mount.h> @@ -700,7 +699,7 @@ static void usbfs_remove_device(struct usb_device *dev) sinfo.si_errno = EPIPE; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = ds->disccontext; - kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); + kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid, ds->secid); } } } diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 8569600..4cc8d3e 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -2,7 +2,6 @@ * message.c - synchronous message handling */ -#include <linux/config.h> #include <linux/pci.h> /* for scatterlist macros */ #include <linux/usb.h> #include <linux/module.h> diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index fe0ed54..b042676 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -9,7 +9,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/notifier.h> #include <linux/usb.h> diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 3f49bf5..dec973a 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -10,7 +10,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/usb.h> #include "usb.h" diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index dad4d8f..9864988 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/bitops.h> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index fb488c8..184c246 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -21,7 +21,6 @@ * are evil. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/bitops.h> diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 7a650c7..49f6923 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -80,6 +80,7 @@ struct dev_state { uid_t disc_uid, disc_euid; void __user *disccontext; unsigned long ifclaimed; + u32 secid; }; /* internal notify stuff */ diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index b8d0b78..acb3c3d 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -25,7 +25,6 @@ #undef VERBOSE #undef PACKET_TRACE -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_device.h> diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 42ce41d..4be4719 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -36,7 +36,6 @@ #define DEBUG -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 078daa0..8320fce 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -23,7 +23,6 @@ // #define DEBUG 1 // #define VERBOSE -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index a43dc90..b1a9cf0 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -221,7 +221,6 @@ #undef VERBOSE #undef DUMP_MSGS -#include <linux/config.h> #include <asm/system.h> #include <asm/uaccess.h> diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 5378c17..3f827de 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c @@ -24,7 +24,6 @@ // #define VERBOSE /* extra debug messages (success too) */ // #define USB_TRACE /* packet-level success messages */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> diff --git a/drivers/usb/gadget/lh7a40x_udc.h b/drivers/usb/gadget/lh7a40x_udc.h index 9b2e6f7..e3bb785 100644 --- a/drivers/usb/gadget/lh7a40x_udc.h +++ b/drivers/usb/gadget/lh7a40x_udc.h @@ -24,7 +24,6 @@ #ifndef __LH7A40X_H_ #define __LH7A40X_H_ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 1facdea..570996d 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c @@ -46,7 +46,6 @@ #undef DEBUG /* messages on error and most fault paths */ #undef VERBOSE /* extra debug messages (success too) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/dma-mapping.h> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index fbea514..0d642ac 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -22,7 +22,6 @@ #undef DEBUG #undef VERBOSE -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 735e9db..c88650d 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c @@ -27,7 +27,6 @@ #undef DEBUG // #define VERBOSE DBG_VERBOSE -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h> diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 3ff6db7..354670d 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c @@ -23,7 +23,6 @@ * updates to merge with Linux 2.6, better match RNDIS spec */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index 416acac8..30d7664 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -17,7 +17,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 68e3d8f..3a08a7a 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -62,7 +62,6 @@ #define DEBUG 1 // #define VERBOSE -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/delay.h> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 9b37e50..cee6f53 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -16,7 +16,6 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/dmapool.h> diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 4a22909..61e5717 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c @@ -4,7 +4,6 @@ * Copyright (c) 2002, 2003 Axis Communications AB. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/ioport.h> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 73f5a37..8fb842e 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -74,7 +74,6 @@ * This file is licenced under the GPL. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/pci.h> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 1045f84..dff6056 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -8,7 +8,6 @@ * (and others) */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 89bcda5..c327168 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -31,7 +31,6 @@ #undef VERBOSE #undef PACKET_TRACE -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 6637a0e..dc286a4 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -9,7 +9,6 @@ * (C) Copyright 1999-2001 Johannes Erdfelt */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/debugfs.h> #include <linux/smp_lock.h> diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 7b48567..4151f61 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h> diff --git a/drivers/usb/input/appletouch.c b/drivers/usb/input/appletouch.c index 3685506..9e3f139 100644 --- a/drivers/usb/input/appletouch.c +++ b/drivers/usb/input/appletouch.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index 07c8c0e..05d2d60 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c @@ -85,7 +85,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index c4670e1..70477f0 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -25,7 +25,6 @@ * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net> */ -#include <linux/config.h> #include <linux/poll.h> #include <linux/slab.h> #include <linux/module.h> diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 5c570cc..86acb5f 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -39,7 +39,6 @@ * *****************************************************************************/ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index 70af985..4723b31 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c @@ -11,7 +11,6 @@ * and Keyspan, Inc the manufacturers of the Keyspan USB DMR product. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 4fdee4d..a9ccda8 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -39,7 +39,6 @@ * *****************************************************************************/ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index da7b0bf..0149043 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -24,7 +24,6 @@ //#define DEBUG -#include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index cfd4a4e..9889b1c 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c @@ -54,7 +54,6 @@ * 2002-07-17 - 0.0.5 : simplified d-pad handling */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 24aedbb..575a4e6 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c @@ -46,7 +46,6 @@ * 20050816 henk Merge 2.6.13-rc6 */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index a042042..b20bec4 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -14,7 +14,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index d0b1672..fcd69c5 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c @@ -16,7 +16,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/delay.h> diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 966acb4..f30ab1f 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -27,7 +27,6 @@ * V0.13 (mh) Added support for LD X-Ray and Machine Test System */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 779bcf0..7699d97 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -75,7 +75,6 @@ * - move reset into open to clean out spurious data */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c index 13aeea2..bfbbbfb 100644 --- a/drivers/usb/misc/phidgetkit.c +++ b/drivers/usb/misc/phidgetkit.c @@ -13,7 +13,6 @@ * This is a driver for the USB PhidgetInterfaceKit. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c index 5a040c2..c0df79c9 100644 --- a/drivers/usb/misc/phidgetservo.c +++ b/drivers/usb/misc/phidgetservo.c @@ -25,7 +25,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index 968f0d3..9b30f89 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c @@ -36,7 +36,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index f441964..0c5ee0a 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 81ba14c..786e1db 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c index 37111ac..2e2bbc00 100644 --- a/drivers/usb/net/asix.c +++ b/drivers/usb/net/asix.c @@ -22,7 +22,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/kmod.h> #include <linux/sched.h> diff --git a/drivers/usb/net/cdc_ether.c b/drivers/usb/net/cdc_ether.c index efd195b..82ce035 100644 --- a/drivers/usb/net/cdc_ether.c +++ b/drivers/usb/net/cdc_ether.c @@ -20,7 +20,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/cdc_subset.c b/drivers/usb/net/cdc_subset.c index ec801e8..e2fae85 100644 --- a/drivers/usb/net/cdc_subset.c +++ b/drivers/usb/net/cdc_subset.c @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kmod.h> #include <linux/sched.h> diff --git a/drivers/usb/net/gl620a.c b/drivers/usb/net/gl620a.c index faf1e86..3155f25 100644 --- a/drivers/usb/net/gl620a.c +++ b/drivers/usb/net/gl620a.c @@ -21,7 +21,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/net1080.c b/drivers/usb/net/net1080.c index 78e6a43..a9b6eea 100644 --- a/drivers/usb/net/net1080.c +++ b/drivers/usb/net/net1080.c @@ -20,7 +20,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/plusb.c b/drivers/usb/net/plusb.c index 4fe8633..5d17cdf 100644 --- a/drivers/usb/net/plusb.c +++ b/drivers/usb/net/plusb.c @@ -20,7 +20,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c index f551546..c2a28d8 100644 --- a/drivers/usb/net/rndis_host.c +++ b/drivers/usb/net/rndis_host.c @@ -20,7 +20,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c index 1bbbae2..718f8e2 100644 --- a/drivers/usb/net/rtl8150.c +++ b/drivers/usb/net/rtl8150.c @@ -6,7 +6,6 @@ * version 2 as published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/signal.h> diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 362d690..54183e1 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -33,7 +33,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/net/zaurus.c b/drivers/usb/net/zaurus.c index 813e470..144566b 100644 --- a/drivers/usb/net/zaurus.c +++ b/drivers/usb/net/zaurus.c @@ -20,7 +20,6 @@ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages -#include <linux/config.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/init.h> diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 4144777..3faa7aa 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -63,7 +63,6 @@ * UsbSnoop on Windows2000 and from examining the other USB drivers. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index e9f9f4b..f2d993b 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -8,7 +8,6 @@ * 2 as published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/tty.h> diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index f3404e1..3d456b3 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -11,7 +11,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h> diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index f8c0cb2..df0a4f9 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c @@ -17,7 +17,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/slab.h> diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 1fd5c5a..49b51ab 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -28,7 +28,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 5de76ef..4ff2dfb 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -48,7 +48,6 @@ /* Code originates and was built up from ftdi_sio, belkin, pl2303 and others. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index b3f776a..6953d3e 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -233,7 +233,6 @@ * $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index afca1eae..1e2b31e 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -51,7 +51,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c index 1e419c8..debc3b0 100644 --- a/drivers/usb/serial/ezusb.c +++ b/drivers/usb/serial/ezusb.c @@ -8,7 +8,6 @@ * 2 as published by the Free Software Foundation. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index b2bfea7..8a74b19 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -245,7 +245,6 @@ /* to talk to the device */ /* Thanx to gkh and the rest of the usb dev group for all code I have assimilated :-) */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 0476775..1f5d162 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -23,7 +23,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 07a478c..945b8bb 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/slab.h> diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c index e9719da..7e06358 100644 --- a/drivers/usb/serial/hp4x.c +++ b/drivers/usb/serial/hp4x.c @@ -12,7 +12,6 @@ * See Documentation/usb/usb-serial.txt for more information on using this driver */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/tty.h> diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index b85d215..bd2c05d 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -29,7 +29,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/errno.h> diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 8e1e225..723a12a 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -24,7 +24,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/errno.h> diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 9da6d2a..dbcfe17 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -44,7 +44,6 @@ * Thanks to info from Heath Robinson and Arieh Davidoff. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index d7f3f73..2cf1fed 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -46,7 +46,6 @@ * initial version released. */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 2cf6ade..d7c58f1 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -95,7 +95,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/errno.h> diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index b0441c3..03ab3c0f 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -66,7 +66,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index 65d79f6..b45ff3e 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -45,7 +45,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 87dfcd8..4577333 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -35,7 +35,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 35bd29b..ca05d32 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -64,7 +64,6 @@ * (via linux-usb-devel). */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 6dcdb5f..cfb711a 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -35,7 +35,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index b0861b6..78ad4b3 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -57,7 +57,6 @@ #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" #define DRIVER_DESC "USB Driver for GSM modems" -#include <linux/config.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/errno.h> diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index d887043..de93a2b 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -14,7 +14,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index f0215f8..897d844 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c @@ -60,7 +60,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index c3a2071..a9afff3 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -68,7 +68,6 @@ * fi */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index f466f89..b59a053 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -16,7 +16,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h index d53ea9b..0f2802a 100644 --- a/drivers/usb/serial/usb-serial.h +++ b/drivers/usb/serial/usb-serial.h @@ -14,7 +14,6 @@ #ifndef __LINUX_USB_SERIAL_H #define __LINUX_USB_SERIAL_H -#include <linux/config.h> #include <linux/kref.h> #include <linux/mutex.h> diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 9e89b8d..95a2936 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -13,7 +13,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 56ffc81..540438c 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -65,7 +65,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h index cd2096a..77e244a 100644 --- a/drivers/usb/storage/debug.h +++ b/drivers/usb/storage/debug.h @@ -44,7 +44,6 @@ #ifndef _DEBUG_H_ #define _DEBUG_H_ -#include <linux/config.h> #include <linux/kernel.h> #define USB_STORAGE "usb-storage: " diff --git a/drivers/usb/storage/dpcm.c b/drivers/usb/storage/dpcm.c index 92b69e4..1628cb2 100644 --- a/drivers/usb/storage/dpcm.c +++ b/drivers/usb/storage/dpcm.c @@ -29,7 +29,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c index 30e9605..88aa59a 100644 --- a/drivers/usb/storage/freecom.c +++ b/drivers/usb/storage/freecom.c @@ -28,7 +28,6 @@ * (http://www.freecom.de/) */ -#include <linux/config.h> #include <linux/hdreg.h> #include <scsi/scsi.h> diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h index f9907a5..927f778 100644 --- a/drivers/usb/storage/initializers.h +++ b/drivers/usb/storage/initializers.h @@ -37,7 +37,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include "usb.h" #include "transport.h" diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 026a587..313920d 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c @@ -28,7 +28,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/input.h> #include <linux/init.h> diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 19b25c5..eb7188b 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -45,7 +45,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/errno.h> #include <linux/slab.h> diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 543244d..c7e84e6 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -31,7 +31,6 @@ * the following thing for it to work: * The macro UNUSUAL_DEV() must be defined before this file is included */ -#include <linux/config.h> /* If you edit this file, please try to keep it sorted first by VendorID, * then by ProductID. diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index e232c7c..1185aca 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -47,7 +47,6 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/errno.h> #include <linux/suspend.h> diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 4de9fb5..b362039 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -13,7 +13,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c index 455fda9..e714e84 100644 --- a/drivers/video/S3triofb.c +++ b/drivers/video/S3triofb.c @@ -23,7 +23,6 @@ */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c index 98baecc..61a8bf1 100644 --- a/drivers/video/acornfb.c +++ b/drivers/video/acornfb.c @@ -17,7 +17,6 @@ * - Blanking 8bpp displays with VIDC */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 3033c72..f9bc9f7 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -48,7 +48,6 @@ #include <linux/tty.h> #include <linux/slab.h> #include <linux/delay.h> -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/fb.h> #include <linux/init.h> diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c index 29f9f0d..eaeaf4d 100644 --- a/drivers/video/asiliantfb.c +++ b/drivers/video/asiliantfb.c @@ -29,7 +29,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 11cf7fc..72c5891 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -46,7 +46,6 @@ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h index 43d2cb5..55fb8b04 100644 --- a/drivers/video/aty/atyfb.h +++ b/drivers/video/aty/atyfb.h @@ -2,7 +2,6 @@ * ATI Frame Buffer Device Driver Core Definitions */ -#include <linux/config.h> #include <linux/spinlock.h> #include <linux/wait.h> /* diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 22e7206..85fcd22 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -49,7 +49,6 @@ ******************************************************************************/ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 68b1564..51b78f8 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -52,7 +52,6 @@ #define RADEON_VERSION "0.2.0" -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c index a9d0414..9aaca58 100644 --- a/drivers/video/aty/radeon_i2c.c +++ b/drivers/video/aty/radeon_i2c.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h index 1645943..38657b2 100644 --- a/drivers/video/aty/radeonfb.h +++ b/drivers/video/aty/radeonfb.h @@ -1,7 +1,6 @@ #ifndef __RADEONFB_H__ #define __RADEONFB_H__ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -382,7 +381,7 @@ struct radeonfb_info { /* Note about this function: we have some rare cases where we must not schedule, * this typically happen with our special "wake up early" hook which allows us to * wake up the graphic chip (and thus get the console back) before everything else - * on some machines that support that mecanism. At this point, interrupts are off + * on some machines that support that mechanism. At this point, interrupts are off * and scheduling is not permitted */ static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms) diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 9ef68cd..a92a91f 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c @@ -40,7 +40,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index bd879b7..caf1eca 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c @@ -11,7 +11,6 @@ */ /* LCD power functions */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/delay.h> diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 6577fdf..c66e3d5 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c @@ -1,6 +1,6 @@ /* bw2.c: BWTWO frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -19,14 +19,11 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> #include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> -#ifdef CONFIG_SPARC32 -#include <asm/sun4paddr.h> -#endif - #include "sbuslib.h" /* @@ -59,30 +56,30 @@ static struct fb_ops bw2_ops = { #define BWTWO_REGISTER_OFFSET 0x400000 struct bt_regs { - volatile u32 addr; - volatile u32 color_map; - volatile u32 control; - volatile u32 cursor; + u32 addr; + u32 color_map; + u32 control; + u32 cursor; }; struct bw2_regs { struct bt_regs cmap; - volatile u8 control; - volatile u8 status; - volatile u8 cursor_start; - volatile u8 cursor_end; - volatile u8 h_blank_start; - volatile u8 h_blank_end; - volatile u8 h_sync_start; - volatile u8 h_sync_end; - volatile u8 comp_sync_end; - volatile u8 v_blank_start_high; - volatile u8 v_blank_start_low; - volatile u8 v_blank_end; - volatile u8 v_sync_start; - volatile u8 v_sync_end; - volatile u8 xfer_holdoff_start; - volatile u8 xfer_holdoff_end; + u8 control; + u8 status; + u8 cursor_start; + u8 cursor_end; + u8 h_blank_start; + u8 h_blank_end; + u8 h_sync_start; + u8 h_sync_end; + u8 comp_sync_end; + u8 v_blank_start_high; + u8 v_blank_start_low; + u8 v_blank_end; + u8 v_sync_start; + u8 v_sync_end; + u8 xfer_holdoff_start; + u8 xfer_holdoff_end; }; /* Status Register Constants */ @@ -117,9 +114,8 @@ struct bw2_par { #define BW2_FLAG_BLANKED 0x00000001 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; - - struct sbus_dev *sdev; }; /** @@ -174,9 +170,7 @@ static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(bw2_mmap_map, par->physbase, par->fbsize, - (par->sdev ? - par->sdev->reg_addrs[0].which_io : - 0), + par->which_io, vma); } @@ -288,139 +282,124 @@ static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info, struct all_info { struct fb_info info; struct bw2_par par; - struct list_head list; }; -static LIST_HEAD(bw2_list); -static void bw2_init_one(struct sbus_dev *sdev) +static int __devinit bw2_init_one(struct of_device *op) { + struct device_node *dp = op->node; struct all_info *all; - struct resource *resp; -#ifdef CONFIG_SUN4 - struct resource res; -#endif - int linebytes; + int linebytes, err; - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "bw2: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); - - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; - -#ifdef CONFIG_SUN4 - if (!sdev) { - all->par.physbase = sun4_bwtwo_physaddr; - res.start = sun4_bwtwo_physaddr; - res.end = res.start + BWTWO_REGISTER_OFFSET + sizeof(struct bw2_regs) - 1; - res.flags = IORESOURCE_IO; - resp = &res; - all->info.var.xres = all->info.var.xres_virtual = 1152; - all->info.var.yres = all->info.var.yres_virtual = 900; - all->info.var.bits_per_pixel = 1; - linebytes = 1152 / 8; - } else -#else - { - BUG_ON(!sdev); - all->par.physbase = sdev->reg_addrs[0].phys_addr; - resp = &sdev->resource[0]; - sbusfb_fill_var(&all->info.var, (sdev ? sdev->prom_node : 0), 1); - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); - } -#endif + + all->par.physbase = op->resource[0].start; + all->par.which_io = op->resource[0].flags & IORESOURCE_BITS; + + sbusfb_fill_var(&all->info.var, dp->node, 1); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); + all->info.var.red.length = all->info.var.green.length = all->info.var.blue.length = all->info.var.bits_per_pixel; all->info.var.red.offset = all->info.var.green.offset = all->info.var.blue.offset = 0; - all->par.regs = sbus_ioremap(resp, BWTWO_REGISTER_OFFSET, - sizeof(struct bw2_regs), "bw2 regs"); + all->par.regs = of_ioremap(&op->resource[0], BWTWO_REGISTER_OFFSET, + sizeof(struct bw2_regs), "bw2 regs"); - if (sdev && !prom_getbool(sdev->prom_node, "width")) + if (!of_find_property(dp, "width", NULL)) bw2_do_default_mode(&all->par, &all->info, &linebytes); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); all->info.flags = FBINFO_DEFAULT; all->info.fbops = &bw2_ops; -#if defined(CONFIG_SPARC32) - if (sdev) - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = - sbus_ioremap(resp, 0, all->par.fbsize, "bw2 ram"); + + all->info.screen_base = + sbus_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); all->info.par = &all->par; bw2_blank(0, &all->info); bw2_init_fix(&all->info, linebytes); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "bw2: Could not register framebuffer.\n"); + err= register_framebuffer(&all->info); + if (err < 0) { + of_iounmap(all->par.regs, sizeof(struct bw2_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - return; + return err; } - list_add(&all->list, &bw2_list); + dev_set_drvdata(&op->dev, all); + + printk("%s: bwtwo at %lx:%lx\n", + dp->full_name, + all->par.which_io, all->par.physbase); - printk("bw2: bwtwo at %lx:%lx\n", - (long) (sdev ? sdev->reg_addrs[0].which_io : 0), - (long) all->par.physbase); + return 0; } -int __init bw2_init(void) +static int __devinit bw2_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("bw2fb", NULL)) - return -ENODEV; + return bw2_init_one(op); +} -#ifdef CONFIG_SUN4 - bw2_init_one(NULL); -#endif - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "bwtwo")) - bw2_init_one(sdev); - } +static int __devexit bw2_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + + of_iounmap(all->par.regs, sizeof(struct bw2_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit bw2_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id bw2_match[] = { + { + .name = "bwtwo", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, bw2_match); - list_for_each_safe(pos, tmp, &bw2_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver bw2_driver = { + .name = "bw2", + .match_table = bw2_match, + .probe = bw2_probe, + .remove = __devexit_p(bw2_remove), +}; - unregister_framebuffer(&all->info); - kfree(all); - } +static int __init bw2_init(void) +{ + if (fb_get_options("bw2fb", NULL)) + return -ENODEV; + + return of_register_driver(&bw2_driver, &of_bus_type); } -int __init -bw2_setup(char *arg) +static void __exit bw2_exit(void) { - /* No cmdline options yet... */ - return 0; + return of_unregister_driver(&bw2_driver); } -module_init(bw2_init); -#ifdef MODULE +module_init(bw2_init); module_exit(bw2_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for BWTWO chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c index 7441532..6faea40 100644 --- a/drivers/video/cfbcopyarea.c +++ b/drivers/video/cfbcopyarea.c @@ -24,7 +24,6 @@ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> diff --git a/drivers/video/cfbfillrect.c b/drivers/video/cfbfillrect.c index e5ff62e..f00b50a 100644 --- a/drivers/video/cfbfillrect.c +++ b/drivers/video/cfbfillrect.c @@ -17,7 +17,6 @@ * the native cpu endians. I also need to deal with MSB position in the word. * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c index ad8a89b..51d3538 100644 --- a/drivers/video/cfbimgblt.c +++ b/drivers/video/cfbimgblt.c @@ -29,7 +29,6 @@ * Also need to add code to deal with cards endians that are different than * the native cpu endians. I also need to deal with MSB position in the word. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c index 63b6c79..7f926c6 100644 --- a/drivers/video/cg14.c +++ b/drivers/video/cg14.c @@ -1,6 +1,6 @@ /* cg14.c: CGFOURTEEN frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx) * @@ -18,8 +18,8 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -99,73 +99,73 @@ static struct fb_ops cg14_ops = { #define CG14_MCR_PIXMODE_32 3 struct cg14_regs{ - volatile u8 mcr; /* Master Control Reg */ - volatile u8 ppr; /* Packed Pixel Reg */ - volatile u8 tms[2]; /* Test Mode Status Regs */ - volatile u8 msr; /* Master Status Reg */ - volatile u8 fsr; /* Fault Status Reg */ - volatile u8 rev; /* Revision & Impl */ - volatile u8 ccr; /* Clock Control Reg */ - volatile u32 tmr; /* Test Mode Read Back */ - volatile u8 mod; /* Monitor Operation Data Reg */ - volatile u8 acr; /* Aux Control */ + u8 mcr; /* Master Control Reg */ + u8 ppr; /* Packed Pixel Reg */ + u8 tms[2]; /* Test Mode Status Regs */ + u8 msr; /* Master Status Reg */ + u8 fsr; /* Fault Status Reg */ + u8 rev; /* Revision & Impl */ + u8 ccr; /* Clock Control Reg */ + u32 tmr; /* Test Mode Read Back */ + u8 mod; /* Monitor Operation Data Reg */ + u8 acr; /* Aux Control */ u8 xxx0[6]; - volatile u16 hct; /* Hor Counter */ - volatile u16 vct; /* Vert Counter */ - volatile u16 hbs; /* Hor Blank Start */ - volatile u16 hbc; /* Hor Blank Clear */ - volatile u16 hss; /* Hor Sync Start */ - volatile u16 hsc; /* Hor Sync Clear */ - volatile u16 csc; /* Composite Sync Clear */ - volatile u16 vbs; /* Vert Blank Start */ - volatile u16 vbc; /* Vert Blank Clear */ - volatile u16 vss; /* Vert Sync Start */ - volatile u16 vsc; /* Vert Sync Clear */ - volatile u16 xcs; - volatile u16 xcc; - volatile u16 fsa; /* Fault Status Address */ - volatile u16 adr; /* Address Registers */ + u16 hct; /* Hor Counter */ + u16 vct; /* Vert Counter */ + u16 hbs; /* Hor Blank Start */ + u16 hbc; /* Hor Blank Clear */ + u16 hss; /* Hor Sync Start */ + u16 hsc; /* Hor Sync Clear */ + u16 csc; /* Composite Sync Clear */ + u16 vbs; /* Vert Blank Start */ + u16 vbc; /* Vert Blank Clear */ + u16 vss; /* Vert Sync Start */ + u16 vsc; /* Vert Sync Clear */ + u16 xcs; + u16 xcc; + u16 fsa; /* Fault Status Address */ + u16 adr; /* Address Registers */ u8 xxx1[0xce]; - volatile u8 pcg[0x100]; /* Pixel Clock Generator */ - volatile u32 vbr; /* Frame Base Row */ - volatile u32 vmcr; /* VBC Master Control */ - volatile u32 vcr; /* VBC refresh */ - volatile u32 vca; /* VBC Config */ + u8 pcg[0x100]; /* Pixel Clock Generator */ + u32 vbr; /* Frame Base Row */ + u32 vmcr; /* VBC Master Control */ + u32 vcr; /* VBC refresh */ + u32 vca; /* VBC Config */ }; #define CG14_CCR_ENABLE 0x04 #define CG14_CCR_SELECT 0x02 /* HW/Full screen */ struct cg14_cursor { - volatile u32 cpl0[32]; /* Enable plane 0 */ - volatile u32 cpl1[32]; /* Color selection plane */ - volatile u8 ccr; /* Cursor Control Reg */ + u32 cpl0[32]; /* Enable plane 0 */ + u32 cpl1[32]; /* Color selection plane */ + u8 ccr; /* Cursor Control Reg */ u8 xxx0[3]; - volatile u16 cursx; /* Cursor x,y position */ - volatile u16 cursy; /* Cursor x,y position */ - volatile u32 color0; - volatile u32 color1; + u16 cursx; /* Cursor x,y position */ + u16 cursy; /* Cursor x,y position */ + u32 color0; + u32 color1; u32 xxx1[0x1bc]; - volatile u32 cpl0i[32]; /* Enable plane 0 autoinc */ - volatile u32 cpl1i[32]; /* Color selection autoinc */ + u32 cpl0i[32]; /* Enable plane 0 autoinc */ + u32 cpl1i[32]; /* Color selection autoinc */ }; struct cg14_dac { - volatile u8 addr; /* Address Register */ + u8 addr; /* Address Register */ u8 xxx0[255]; - volatile u8 glut; /* Gamma table */ + u8 glut; /* Gamma table */ u8 xxx1[255]; - volatile u8 select; /* Register Select */ + u8 select; /* Register Select */ u8 xxx2[255]; - volatile u8 mode; /* Mode Register */ + u8 mode; /* Mode Register */ }; struct cg14_xlut{ - volatile u8 x_xlut [256]; - volatile u8 x_xlutd [256]; + u8 x_xlut [256]; + u8 x_xlutd [256]; u8 xxx0[0x600]; - volatile u8 x_xlut_inc [256]; - volatile u8 x_xlutd_inc [256]; + u8 x_xlut_inc [256]; + u8 x_xlutd_inc [256]; }; /* Color look up table (clut) */ @@ -204,7 +204,6 @@ struct cg14_par { int mode; int ramsize; - struct sbus_dev *sdev; }; static void __cg14_reset(struct cg14_par *par) @@ -355,14 +354,9 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) * Initialisation */ -static void cg14_init_fix(struct fb_info *info, int linebytes) +static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - struct cg14_par *par = (struct cg14_par *)info->par; - const char *name; - - name = "cgfourteen"; - if (par->sdev) - name = par->sdev->prom_name; + const char *name = dp->name; strlcpy(info->fix.id, name, sizeof(info->fix.id)); @@ -456,98 +450,81 @@ static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __initdata = { struct all_info { struct fb_info info; struct cg14_par par; - struct list_head list; }; -static LIST_HEAD(cg14_list); -static void cg14_init_one(struct sbus_dev *sdev, int node, int parent_node) +static void cg14_unmap_regs(struct all_info *all) { - struct all_info *all; - unsigned long phys, rphys; - u32 bases[6]; - int is_8mb, linebytes, i; - - if (!sdev) { - if (prom_getproperty(node, "address", - (char *) &bases[0], sizeof(bases)) <= 0 - || !bases[0]) { - printk(KERN_ERR "cg14: Device is not mapped.\n"); - return; - } - if (__get_iospace(bases[0]) != __get_iospace(bases[1])) { - printk(KERN_ERR "cg14: I/O spaces don't match.\n"); - return; - } - } + if (all->par.regs) + of_iounmap(all->par.regs, sizeof(struct cg14_regs)); + if (all->par.clut) + of_iounmap(all->par.clut, sizeof(struct cg14_clut)); + if (all->par.cursor) + of_iounmap(all->par.cursor, sizeof(struct cg14_cursor)); + if (all->info.screen_base) + of_iounmap(all->info.screen_base, all->par.fbsize); +} - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "cg14: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); +static int __devinit cg14_init_one(struct of_device *op) +{ + struct device_node *dp = op->node; + struct all_info *all; + int is_8mb, linebytes, i, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - sbusfb_fill_var(&all->info.var, node, 8); + sbusfb_fill_var(&all->info.var, dp->node, 8); all->info.var.red.length = 8; all->info.var.green.length = 8; all->info.var.blue.length = 8; - linebytes = prom_getintdefault(node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - all->par.sdev = sdev; - if (sdev) { - rphys = sdev->reg_addrs[0].phys_addr; - all->par.physbase = phys = sdev->reg_addrs[1].phys_addr; - all->par.iospace = sdev->reg_addrs[0].which_io; - - all->par.regs = sbus_ioremap(&sdev->resource[0], 0, - sizeof(struct cg14_regs), - "cg14 regs"); - all->par.clut = sbus_ioremap(&sdev->resource[0], CG14_CLUT1, - sizeof(struct cg14_clut), - "cg14 clut"); - all->par.cursor = sbus_ioremap(&sdev->resource[0], CG14_CURSORREGS, - sizeof(struct cg14_cursor), - "cg14 cursor"); - all->info.screen_base = sbus_ioremap(&sdev->resource[1], 0, - all->par.fbsize, "cg14 ram"); + if (!strcmp(dp->parent->name, "sbus") || + !strcmp(dp->parent->name, "sbi")) { + all->par.physbase = op->resource[0].start; + all->par.iospace = op->resource[0].flags & IORESOURCE_BITS; } else { - rphys = __get_phys(bases[0]); - all->par.physbase = phys = __get_phys(bases[1]); - all->par.iospace = __get_iospace(bases[0]); - all->par.regs = (struct cg14_regs __iomem *)(unsigned long)bases[0]; - all->par.clut = (struct cg14_clut __iomem *)((unsigned long)bases[0] + - CG14_CLUT1); - all->par.cursor = - (struct cg14_cursor __iomem *)((unsigned long)bases[0] + - CG14_CURSORREGS); - - all->info.screen_base = (char __iomem *)(unsigned long)bases[1]; + all->par.physbase = op->resource[1].start; + all->par.iospace = op->resource[0].flags & IORESOURCE_BITS; } - prom_getproperty(node, "reg", (char *) &bases[0], sizeof(bases)); - is_8mb = (bases[5] == 0x800000); + all->par.regs = of_ioremap(&op->resource[0], 0, + sizeof(struct cg14_regs), "cg14 regs"); + all->par.clut = of_ioremap(&op->resource[0], CG14_CLUT1, + sizeof(struct cg14_clut), "cg14 clut"); + all->par.cursor = of_ioremap(&op->resource[0], CG14_CURSORREGS, + sizeof(struct cg14_cursor), "cg14 cursor"); - if (sizeof(all->par.mmap_map) != sizeof(__cg14_mmap_map)) { - extern void __cg14_mmap_sized_wrongly(void); + all->info.screen_base = of_ioremap(&op->resource[1], 0, + all->par.fbsize, "cg14 ram"); - __cg14_mmap_sized_wrongly(); - } + if (!all->par.regs || !all->par.clut || !all->par.cursor || + !all->info.screen_base) + cg14_unmap_regs(all); + + is_8mb = (((op->resource[1].end - op->resource[1].start) + 1) == + (8 * 1024 * 1024)); + + BUILD_BUG_ON(sizeof(all->par.mmap_map) != sizeof(__cg14_mmap_map)); - memcpy(&all->par.mmap_map, &__cg14_mmap_map, sizeof(all->par.mmap_map)); + memcpy(&all->par.mmap_map, &__cg14_mmap_map, + sizeof(all->par.mmap_map)); + for (i = 0; i < CG14_MMAP_ENTRIES; i++) { struct sbus_mmap_map *map = &all->par.mmap_map[i]; if (!map->size) break; if (map->poff & 0x80000000) - map->poff = (map->poff & 0x7fffffff) + rphys - phys; + map->poff = (map->poff & 0x7fffffff) + + (op->resource[0].start - + op->resource[1].start); if (is_8mb && map->size >= 0x100000 && map->size <= 0x400000) @@ -564,84 +541,87 @@ static void cg14_init_one(struct sbus_dev *sdev, int node, int parent_node) __cg14_reset(&all->par); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "cg14: Could not allocate color map.\n"); + cg14_unmap_regs(all); kfree(all); - return; + return -ENOMEM; } fb_set_cmap(&all->info.cmap, &all->info); - cg14_init_fix(&all->info, linebytes); + cg14_init_fix(&all->info, linebytes, dp); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "cg14: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { fb_dealloc_cmap(&all->info.cmap); + cg14_unmap_regs(all); kfree(all); - return; + return err; } - list_add(&all->list, &cg14_list); + dev_set_drvdata(&op->dev, all); - printk("cg14: cgfourteen at %lx:%lx, %dMB\n", - all->par.iospace, all->par.physbase, all->par.ramsize >> 20); + printk("%s: cgfourteen at %lx:%lx, %dMB\n", + dp->full_name, + all->par.iospace, all->par.physbase, + all->par.ramsize >> 20); + return 0; } -int __init cg14_init(void) +static int __devinit cg14_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("cg14fb", NULL)) - return -ENODEV; + return cg14_init_one(op); +} -#ifdef CONFIG_SPARC32 - { - int root, node; - - root = prom_getchild(prom_root_node); - root = prom_searchsiblings(root, "obio"); - if (root) { - node = prom_searchsiblings(prom_getchild(root), - "cgfourteen"); - if (node) - cg14_init_one(NULL, node, root); - } - } -#endif - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "cgfourteen")) - cg14_init_one(sdev, sdev->prom_node, sbus->prom_node); - } +static int __devexit cg14_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + cg14_unmap_regs(all); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit cg14_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id cg14_match[] = { + { + .name = "cgfourteen", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, cg14_match); - list_for_each_safe(pos, tmp, &cg14_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver cg14_driver = { + .name = "cg14", + .match_table = cg14_match, + .probe = cg14_probe, + .remove = __devexit_p(cg14_remove), +}; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } +int __init cg14_init(void) +{ + if (fb_get_options("cg14fb", NULL)) + return -ENODEV; + + return of_register_driver(&cg14_driver, &of_bus_type); } -int __init -cg14_setup(char *arg) +void __exit cg14_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&cg14_driver); } module_init(cg14_init); - -#ifdef MODULE module_exit(cg14_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for CGfourteen chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index 3de6e1b..9c8c753 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c @@ -1,6 +1,6 @@ /* cg3.c: CGTHREE frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -19,8 +19,9 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> #include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -80,30 +81,30 @@ enum cg3_type { }; struct bt_regs { - volatile u32 addr; - volatile u32 color_map; - volatile u32 control; - volatile u32 cursor; + u32 addr; + u32 color_map; + u32 control; + u32 cursor; }; struct cg3_regs { struct bt_regs cmap; - volatile u8 control; - volatile u8 status; - volatile u8 cursor_start; - volatile u8 cursor_end; - volatile u8 h_blank_start; - volatile u8 h_blank_end; - volatile u8 h_sync_start; - volatile u8 h_sync_end; - volatile u8 comp_sync_end; - volatile u8 v_blank_start_high; - volatile u8 v_blank_start_low; - volatile u8 v_blank_end; - volatile u8 v_sync_start; - volatile u8 v_sync_end; - volatile u8 xfer_holdoff_start; - volatile u8 xfer_holdoff_end; + u8 control; + u8 status; + u8 cursor_start; + u8 cursor_end; + u8 h_blank_start; + u8 h_blank_end; + u8 h_sync_start; + u8 h_sync_end; + u8 comp_sync_end; + u8 v_blank_start_high; + u8 v_blank_start_low; + u8 v_blank_end; + u8 v_sync_start; + u8 v_sync_end; + u8 xfer_holdoff_start; + u8 xfer_holdoff_end; }; /* Offset of interesting structures in the OBIO space */ @@ -120,9 +121,8 @@ struct cg3_par { #define CG3_FLAG_RDI 0x00000002 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; - - struct sbus_dev *sdev; }; /** @@ -235,7 +235,7 @@ static int cg3_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(cg3_mmap_map, par->physbase, par->fbsize, - par->sdev->reg_addrs[0].which_io, + par->which_io, vma); } @@ -252,11 +252,9 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) */ static void -cg3_init_fix(struct fb_info *info, int linebytes) +cg3_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - struct cg3_par *par = (struct cg3_par *)info->par; - - strlcpy(info->fix.id, par->sdev->prom_name, sizeof(info->fix.id)); + strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_PSEUDOCOLOR; @@ -267,16 +265,15 @@ cg3_init_fix(struct fb_info *info, int linebytes) } static void cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var, - struct sbus_dev *sdev) + struct device_node *dp) { - char buffer[40]; + char *params; char *p; int ww, hh; - *buffer = 0; - prom_getstring(sdev->prom_node, "params", buffer, sizeof(buffer)); - if (*buffer) { - ww = simple_strtoul(buffer, &p, 10); + params = of_get_property(dp, "params", NULL); + if (params) { + ww = simple_strtoul(params, &p, 10); if (ww && *p == 'x') { hh = simple_strtoul(p + 1, &p, 10); if (hh && *p == '-') { @@ -348,11 +345,11 @@ static void cg3_do_default_mode(struct cg3_par *par) sbus_writeb(p[1], regp); } for (p = cg3_dacvals; *p; p += 2) { - volatile u8 __iomem *regp; + u8 __iomem *regp; - regp = (volatile u8 __iomem *)&par->regs->cmap.addr; + regp = (u8 __iomem *)&par->regs->cmap.addr; sbus_writeb(p[0], regp); - regp = (volatile u8 __iomem *)&par->regs->cmap.control; + regp = (u8 __iomem *)&par->regs->cmap.control; sbus_writeb(p[1], regp); } } @@ -360,129 +357,137 @@ static void cg3_do_default_mode(struct cg3_par *par) struct all_info { struct fb_info info; struct cg3_par par; - struct list_head list; }; -static LIST_HEAD(cg3_list); -static void cg3_init_one(struct sbus_dev *sdev) +static int __devinit cg3_init_one(struct of_device *op) { + struct device_node *dp = op->node; struct all_info *all; - int linebytes; - - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "cg3: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); + int linebytes, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; - all->par.physbase = sdev->reg_addrs[0].phys_addr; + all->par.physbase = op->resource[0].start; + all->par.which_io = op->resource[0].flags & IORESOURCE_BITS; - sbusfb_fill_var(&all->info.var, sdev->prom_node, 8); + sbusfb_fill_var(&all->info.var, dp->node, 8); all->info.var.red.length = 8; all->info.var.green.length = 8; all->info.var.blue.length = 8; - if (!strcmp(sdev->prom_name, "cgRDI")) + if (!strcmp(dp->name, "cgRDI")) all->par.flags |= CG3_FLAG_RDI; if (all->par.flags & CG3_FLAG_RDI) - cg3_rdi_maybe_fixup_var(&all->info.var, sdev); + cg3_rdi_maybe_fixup_var(&all->info.var, dp); - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - all->par.regs = sbus_ioremap(&sdev->resource[0], CG3_REGS_OFFSET, - sizeof(struct cg3_regs), "cg3 regs"); + all->par.regs = of_ioremap(&op->resource[0], CG3_REGS_OFFSET, + sizeof(struct cg3_regs), "cg3 regs"); all->info.flags = FBINFO_DEFAULT; all->info.fbops = &cg3_ops; -#ifdef CONFIG_SPARC32 - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = - sbus_ioremap(&sdev->resource[0], CG3_RAM_OFFSET, - all->par.fbsize, "cg3 ram"); + all->info.screen_base = + of_ioremap(&op->resource[0], CG3_RAM_OFFSET, + all->par.fbsize, "cg3 ram"); all->info.par = &all->par; cg3_blank(0, &all->info); - if (!prom_getbool(sdev->prom_node, "width")) + if (!of_find_property(dp, "width", NULL)) cg3_do_default_mode(&all->par); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "cg3: Could not allocate color map.\n"); + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - return; + return -ENOMEM; } fb_set_cmap(&all->info.cmap, &all->info); - cg3_init_fix(&all->info, linebytes); + cg3_init_fix(&all->info, linebytes, dp); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "cg3: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { fb_dealloc_cmap(&all->info.cmap); + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - return; + return err; } - list_add(&all->list, &cg3_list); + dev_set_drvdata(&op->dev, all); + + printk("%s: cg3 at %lx:%lx\n", + dp->full_name, all->par.which_io, all->par.physbase); - printk("cg3: %s at %lx:%lx\n", - sdev->prom_name, - (long) sdev->reg_addrs[0].which_io, - (long) sdev->reg_addrs[0].phys_addr); + return 0; } -int __init cg3_init(void) +static int __devinit cg3_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("cg3fb", NULL)) - return -ENODEV; + return cg3_init_one(op); +} - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "cgthree") || - !strcmp(sdev->prom_name, "cgRDI")) - cg3_init_one(sdev); - } +static int __devexit cg3_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit cg3_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id cg3_match[] = { + { + .name = "cgthree", + }, + { + .name = "cgRDI", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, cg3_match); - list_for_each_safe(pos, tmp, &cg3_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver cg3_driver = { + .name = "cg3", + .match_table = cg3_match, + .probe = cg3_probe, + .remove = __devexit_p(cg3_remove), +}; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } +static int __init cg3_init(void) +{ + if (fb_get_options("cg3fb", NULL)) + return -ENODEV; + + return of_register_driver(&cg3_driver, &of_bus_type); } -int __init -cg3_setup(char *arg) +static void __exit cg3_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&cg3_driver); } module_init(cg3_init); - -#ifdef MODULE module_exit(cg3_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for CGthree chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c index 7aab91e..64146be 100644 --- a/drivers/video/cg6.c +++ b/drivers/video/cg6.c @@ -1,6 +1,6 @@ /* cg6.c: CGSIX (GX, GXplus, TGX) frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) @@ -19,8 +19,8 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -164,89 +164,89 @@ static struct fb_ops cg6_ops = { /* The contents are unknown */ struct cg6_tec { - volatile int tec_matrix; - volatile int tec_clip; - volatile int tec_vdc; + int tec_matrix; + int tec_clip; + int tec_vdc; }; struct cg6_thc { - uint thc_pad0[512]; - volatile uint thc_hs; /* hsync timing */ - volatile uint thc_hsdvs; - volatile uint thc_hd; - volatile uint thc_vs; /* vsync timing */ - volatile uint thc_vd; - volatile uint thc_refresh; - volatile uint thc_misc; - uint thc_pad1[56]; - volatile uint thc_cursxy; /* cursor x,y position (16 bits each) */ - volatile uint thc_cursmask[32]; /* cursor mask bits */ - volatile uint thc_cursbits[32]; /* what to show where mask enabled */ + u32 thc_pad0[512]; + u32 thc_hs; /* hsync timing */ + u32 thc_hsdvs; + u32 thc_hd; + u32 thc_vs; /* vsync timing */ + u32 thc_vd; + u32 thc_refresh; + u32 thc_misc; + u32 thc_pad1[56]; + u32 thc_cursxy; /* cursor x,y position (16 bits each) */ + u32 thc_cursmask[32]; /* cursor mask bits */ + u32 thc_cursbits[32]; /* what to show where mask enabled */ }; struct cg6_fbc { - u32 xxx0[1]; - volatile u32 mode; - volatile u32 clip; - u32 xxx1[1]; - volatile u32 s; - volatile u32 draw; - volatile u32 blit; - volatile u32 font; - u32 xxx2[24]; - volatile u32 x0, y0, z0, color0; - volatile u32 x1, y1, z1, color1; - volatile u32 x2, y2, z2, color2; - volatile u32 x3, y3, z3, color3; - volatile u32 offx, offy; - u32 xxx3[2]; - volatile u32 incx, incy; - u32 xxx4[2]; - volatile u32 clipminx, clipminy; - u32 xxx5[2]; - volatile u32 clipmaxx, clipmaxy; - u32 xxx6[2]; - volatile u32 fg; - volatile u32 bg; - volatile u32 alu; - volatile u32 pm; - volatile u32 pixelm; - u32 xxx7[2]; - volatile u32 patalign; - volatile u32 pattern[8]; - u32 xxx8[432]; - volatile u32 apointx, apointy, apointz; - u32 xxx9[1]; - volatile u32 rpointx, rpointy, rpointz; - u32 xxx10[5]; - volatile u32 pointr, pointg, pointb, pointa; - volatile u32 alinex, aliney, alinez; - u32 xxx11[1]; - volatile u32 rlinex, rliney, rlinez; - u32 xxx12[5]; - volatile u32 liner, lineg, lineb, linea; - volatile u32 atrix, atriy, atriz; - u32 xxx13[1]; - volatile u32 rtrix, rtriy, rtriz; - u32 xxx14[5]; - volatile u32 trir, trig, trib, tria; - volatile u32 aquadx, aquady, aquadz; - u32 xxx15[1]; - volatile u32 rquadx, rquady, rquadz; - u32 xxx16[5]; - volatile u32 quadr, quadg, quadb, quada; - volatile u32 arectx, arecty, arectz; - u32 xxx17[1]; - volatile u32 rrectx, rrecty, rrectz; - u32 xxx18[5]; - volatile u32 rectr, rectg, rectb, recta; + u32 xxx0[1]; + u32 mode; + u32 clip; + u32 xxx1[1]; + u32 s; + u32 draw; + u32 blit; + u32 font; + u32 xxx2[24]; + u32 x0, y0, z0, color0; + u32 x1, y1, z1, color1; + u32 x2, y2, z2, color2; + u32 x3, y3, z3, color3; + u32 offx, offy; + u32 xxx3[2]; + u32 incx, incy; + u32 xxx4[2]; + u32 clipminx, clipminy; + u32 xxx5[2]; + u32 clipmaxx, clipmaxy; + u32 xxx6[2]; + u32 fg; + u32 bg; + u32 alu; + u32 pm; + u32 pixelm; + u32 xxx7[2]; + u32 patalign; + u32 pattern[8]; + u32 xxx8[432]; + u32 apointx, apointy, apointz; + u32 xxx9[1]; + u32 rpointx, rpointy, rpointz; + u32 xxx10[5]; + u32 pointr, pointg, pointb, pointa; + u32 alinex, aliney, alinez; + u32 xxx11[1]; + u32 rlinex, rliney, rlinez; + u32 xxx12[5]; + u32 liner, lineg, lineb, linea; + u32 atrix, atriy, atriz; + u32 xxx13[1]; + u32 rtrix, rtriy, rtriz; + u32 xxx14[5]; + u32 trir, trig, trib, tria; + u32 aquadx, aquady, aquadz; + u32 xxx15[1]; + u32 rquadx, rquady, rquadz; + u32 xxx16[5]; + u32 quadr, quadg, quadb, quada; + u32 arectx, arecty, arectz; + u32 xxx17[1]; + u32 rrectx, rrecty, rrectz; + u32 xxx18[5]; + u32 rectr, rectg, rectb, recta; }; struct bt_regs { - volatile u32 addr; - volatile u32 color_map; - volatile u32 control; - volatile u32 cursor; + u32 addr; + u32 color_map; + u32 control; + u32 cursor; }; struct cg6_par { @@ -255,15 +255,14 @@ struct cg6_par { struct cg6_fbc __iomem *fbc; struct cg6_thc __iomem *thc; struct cg6_tec __iomem *tec; - volatile u32 __iomem *fhc; + u32 __iomem *fhc; u32 flags; #define CG6_FLAG_BLANKED 0x00000001 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; - - struct sbus_dev *sdev; }; static int cg6_sync(struct fb_info *info) @@ -529,8 +528,7 @@ static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(cg6_mmap_map, par->physbase, par->fbsize, - par->sdev->reg_addrs[0].which_io, - vma); + par->which_io, vma); } static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) @@ -658,62 +656,75 @@ static void cg6_chip_init(struct fb_info *info) struct all_info { struct fb_info info; struct cg6_par par; - struct list_head list; }; -static LIST_HEAD(cg6_list); -static void cg6_init_one(struct sbus_dev *sdev) +static void cg6_unmap_regs(struct all_info *all) { - struct all_info *all; - int linebytes; + if (all->par.fbc) + of_iounmap(all->par.fbc, 4096); + if (all->par.tec) + of_iounmap(all->par.tec, sizeof(struct cg6_tec)); + if (all->par.thc) + of_iounmap(all->par.thc, sizeof(struct cg6_thc)); + if (all->par.bt) + of_iounmap(all->par.bt, sizeof(struct bt_regs)); + if (all->par.fhc) + of_iounmap(all->par.fhc, sizeof(u32)); + + if (all->info.screen_base) + of_iounmap(all->info.screen_base, all->par.fbsize); +} - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "cg6: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); +static int __devinit cg6_init_one(struct of_device *op) +{ + struct device_node *dp = op->node; + struct all_info *all; + int linebytes, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; - all->par.physbase = sdev->reg_addrs[0].phys_addr; + all->par.physbase = op->resource[0].start; + all->par.which_io = op->resource[0].flags & IORESOURCE_BITS; - sbusfb_fill_var(&all->info.var, sdev->prom_node, 8); + sbusfb_fill_var(&all->info.var, dp->node, 8); all->info.var.red.length = 8; all->info.var.green.length = 8; all->info.var.blue.length = 8; - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - if (prom_getbool(sdev->prom_node, "dblbuf")) + if (of_find_property(dp, "dblbuf", NULL)) all->par.fbsize *= 4; - all->par.fbc = sbus_ioremap(&sdev->resource[0], CG6_FBC_OFFSET, - 4096, "cgsix fbc"); - all->par.tec = sbus_ioremap(&sdev->resource[0], CG6_TEC_OFFSET, - sizeof(struct cg6_tec), "cgsix tec"); - all->par.thc = sbus_ioremap(&sdev->resource[0], CG6_THC_OFFSET, - sizeof(struct cg6_thc), "cgsix thc"); - all->par.bt = sbus_ioremap(&sdev->resource[0], CG6_BROOKTREE_OFFSET, - sizeof(struct bt_regs), "cgsix dac"); - all->par.fhc = sbus_ioremap(&sdev->resource[0], CG6_FHC_OFFSET, - sizeof(u32), "cgsix fhc"); + all->par.fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET, + 4096, "cgsix fbc"); + all->par.tec = of_ioremap(&op->resource[0], CG6_TEC_OFFSET, + sizeof(struct cg6_tec), "cgsix tec"); + all->par.thc = of_ioremap(&op->resource[0], CG6_THC_OFFSET, + sizeof(struct cg6_thc), "cgsix thc"); + all->par.bt = of_ioremap(&op->resource[0], CG6_BROOKTREE_OFFSET, + sizeof(struct bt_regs), "cgsix dac"); + all->par.fhc = of_ioremap(&op->resource[0], CG6_FHC_OFFSET, + sizeof(u32), "cgsix fhc"); all->info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_IMAGEBLIT | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT; all->info.fbops = &cg6_ops; -#ifdef CONFIG_SPARC32 - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = - sbus_ioremap(&sdev->resource[0], CG6_RAM_OFFSET, - all->par.fbsize, "cgsix ram"); + + all->info.screen_base = of_ioremap(&op->resource[0], CG6_RAM_OFFSET, + all->par.fbsize, "cgsix ram"); + if (!all->par.fbc || !all->par.tec || !all->par.thc || + !all->par.bt || !all->par.fhc || !all->info.screen_base) { + cg6_unmap_regs(all); + kfree(all); + return -ENOMEM; + } + all->info.par = &all->par; all->info.var.accel_flags = FB_ACCELF_TEXT; @@ -723,72 +734,90 @@ static void cg6_init_one(struct sbus_dev *sdev) cg6_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "cg6: Could not allocate color map.\n"); + cg6_unmap_regs(all); kfree(all); - return; + return -ENOMEM; } fb_set_cmap(&all->info.cmap, &all->info); cg6_init_fix(&all->info, linebytes); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "cg6: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { + cg6_unmap_regs(all); fb_dealloc_cmap(&all->info.cmap); kfree(all); - return; + return err; } - list_add(&all->list, &cg6_list); + dev_set_drvdata(&op->dev, all); - printk("cg6: CGsix [%s] at %lx:%lx\n", + printk("%s: CGsix [%s] at %lx:%lx\n", + dp->full_name, all->info.fix.id, - (long) sdev->reg_addrs[0].which_io, - (long) sdev->reg_addrs[0].phys_addr); + all->par.which_io, all->par.physbase); + + return 0; } -int __init cg6_init(void) +static int __devinit cg6_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("cg6fb", NULL)) - return -ENODEV; + return cg6_init_one(op); +} - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "cgsix") || - !strcmp(sdev->prom_name, "cgthree+")) - cg6_init_one(sdev); - } +static int __devexit cg6_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + cg6_unmap_regs(all); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit cg6_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id cg6_match[] = { + { + .name = "cgsix", + }, + { + .name = "cgthree+", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, cg6_match); - list_for_each_safe(pos, tmp, &cg6_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver cg6_driver = { + .name = "cg6", + .match_table = cg6_match, + .probe = cg6_probe, + .remove = __devexit_p(cg6_remove), +}; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } +static int __init cg6_init(void) +{ + if (fb_get_options("cg6fb", NULL)) + return -ENODEV; + + return of_register_driver(&cg6_driver, &of_bus_type); } -int __init -cg6_setup(char *arg) +static void __exit cg6_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&cg6_driver); } module_init(cg6_init); - -#ifdef MODULE module_exit(cg6_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for CGsix chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c index d76bbfac..0e465c8 100644 --- a/drivers/video/chipsfb.c +++ b/drivers/video/chipsfb.c @@ -14,7 +14,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index dda240e..7355da09 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -36,7 +36,6 @@ #define CIRRUSFB_VERSION "2.0-pre2" -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index eea422e..308850d 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -10,7 +10,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index 1ecda91..878707a 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c @@ -22,7 +22,6 @@ #define DUMMY_ROWS ORIG_VIDEO_LINES #elif defined(__hppa__) /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ -#include <linux/config.h> #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS #else diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 5dc4083..94e9f70 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -58,7 +58,6 @@ #undef FBCONDEBUG -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/sched.h> diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 3487a636..f244ad0 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h @@ -11,7 +11,6 @@ #ifndef _VIDEO_FBCON_H #define _VIDEO_FBCON_H -#include <linux/config.h> #include <linux/types.h> #include <linux/vt_buffer.h> #include <linux/vt_kern.h> diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c index 990289a..4481c80 100644 --- a/drivers/video/console/fbcon_ccw.c +++ b/drivers/video/console/fbcon_ccw.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c index d44c5fa..7f92c06 100644 --- a/drivers/video/console/fbcon_cw.c +++ b/drivers/video/console/fbcon_cw.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/fbcon_rotate.c b/drivers/video/console/fbcon_rotate.c index 2dc091f..00884e0 100644 --- a/drivers/video/console/fbcon_rotate.c +++ b/drivers/video/console/fbcon_rotate.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c index f56ed06..ab91005 100644 --- a/drivers/video/console/fbcon_ud.c +++ b/drivers/video/console/fbcon_ud.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/font_acorn_8x8.c b/drivers/video/console/font_acorn_8x8.c index 2d2e396..40f3d4e 100644 --- a/drivers/video/console/font_acorn_8x8.c +++ b/drivers/video/console/font_acorn_8x8.c @@ -1,6 +1,5 @@ /* Acorn-like font definition, with PC graphics characters */ -#include <linux/config.h> #include <linux/font.h> static const unsigned char acorndata_8x8[] = { diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c index 0cc1bfd..c960728 100644 --- a/drivers/video/console/fonts.c +++ b/drivers/video/console/fonts.c @@ -12,7 +12,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c index d6e6ad5..5cd5e11 100644 --- a/drivers/video/console/promcon.c +++ b/drivers/video/console/promcon.c @@ -5,7 +5,6 @@ * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index 74ac2ac..88e7038 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c @@ -13,7 +13,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/video/console/tileblit.c b/drivers/video/console/tileblit.c index 153352c..d981fe4 100644 --- a/drivers/video/console/tileblit.c +++ b/drivers/video/console/tileblit.c @@ -8,7 +8,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 01401cd..05735ff 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -33,7 +33,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/sched.h> diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index 655301a..acdd6a1 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c @@ -31,7 +31,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 55a3514..2e29249 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -36,7 +36,6 @@ * (which, incidentally, is about the same saving as a 2.5in hard disk * entering standby mode.) */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/cyber2000fb.h b/drivers/video/cyber2000fb.h index bd7e1c0..de4fc43 100644 --- a/drivers/video/cyber2000fb.h +++ b/drivers/video/cyber2000fb.h @@ -9,7 +9,6 @@ * * Integraphics Cyber2000 frame buffer device */ -#include <linux/config.h> /* * Internal CyberPro sizes and offsets. diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c index 0ae0a97..94a66c2 100644 --- a/drivers/video/cyblafb.c +++ b/drivers/video/cyblafb.c @@ -14,7 +14,6 @@ #define CYBLAFB_PIXMAPSIZE 8192 -#include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/fb.h> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index a171daa..33034f8 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -11,7 +11,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/compat.h> diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 7633e41..2a0e821 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -1,6 +1,6 @@ /* ffb.c: Creator/Elite3D frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1997,1998,1999 Jakub Jelinek (jj@ultra.linux.cz) * * Driver layout based loosely on tgafb.c, see that file for credits. @@ -19,7 +19,8 @@ #include <asm/io.h> #include <asm/upa.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -184,161 +185,161 @@ static struct fb_ops ffb_ops = { struct ffb_fbc { /* Next vertex registers */ - u32 xxx1[3]; - volatile u32 alpha; - volatile u32 red; - volatile u32 green; - volatile u32 blue; - volatile u32 depth; - volatile u32 y; - volatile u32 x; - u32 xxx2[2]; - volatile u32 ryf; - volatile u32 rxf; - u32 xxx3[2]; + u32 xxx1[3]; + u32 alpha; + u32 red; + u32 green; + u32 blue; + u32 depth; + u32 y; + u32 x; + u32 xxx2[2]; + u32 ryf; + u32 rxf; + u32 xxx3[2]; - volatile u32 dmyf; - volatile u32 dmxf; - u32 xxx4[2]; - volatile u32 ebyi; - volatile u32 ebxi; - u32 xxx5[2]; - volatile u32 by; - volatile u32 bx; - u32 dy; - u32 dx; - volatile u32 bh; - volatile u32 bw; - u32 xxx6[2]; + u32 dmyf; + u32 dmxf; + u32 xxx4[2]; + u32 ebyi; + u32 ebxi; + u32 xxx5[2]; + u32 by; + u32 bx; + u32 dy; + u32 dx; + u32 bh; + u32 bw; + u32 xxx6[2]; - u32 xxx7[32]; + u32 xxx7[32]; /* Setup unit vertex state register */ - volatile u32 suvtx; - u32 xxx8[63]; + u32 suvtx; + u32 xxx8[63]; /* Control registers */ - volatile u32 ppc; - volatile u32 wid; - volatile u32 fg; - volatile u32 bg; - volatile u32 consty; - volatile u32 constz; - volatile u32 xclip; - volatile u32 dcss; - volatile u32 vclipmin; - volatile u32 vclipmax; - volatile u32 vclipzmin; - volatile u32 vclipzmax; - volatile u32 dcsf; - volatile u32 dcsb; - volatile u32 dczf; - volatile u32 dczb; + u32 ppc; + u32 wid; + u32 fg; + u32 bg; + u32 consty; + u32 constz; + u32 xclip; + u32 dcss; + u32 vclipmin; + u32 vclipmax; + u32 vclipzmin; + u32 vclipzmax; + u32 dcsf; + u32 dcsb; + u32 dczf; + u32 dczb; - u32 xxx9; - volatile u32 blendc; - volatile u32 blendc1; - volatile u32 blendc2; - volatile u32 fbramitc; - volatile u32 fbc; - volatile u32 rop; - volatile u32 cmp; - volatile u32 matchab; - volatile u32 matchc; - volatile u32 magnab; - volatile u32 magnc; - volatile u32 fbcfg0; - volatile u32 fbcfg1; - volatile u32 fbcfg2; - volatile u32 fbcfg3; + u32 xxx9; + u32 blendc; + u32 blendc1; + u32 blendc2; + u32 fbramitc; + u32 fbc; + u32 rop; + u32 cmp; + u32 matchab; + u32 matchc; + u32 magnab; + u32 magnc; + u32 fbcfg0; + u32 fbcfg1; + u32 fbcfg2; + u32 fbcfg3; - u32 ppcfg; - volatile u32 pick; - volatile u32 fillmode; - volatile u32 fbramwac; - volatile u32 pmask; - volatile u32 xpmask; - volatile u32 ypmask; - volatile u32 zpmask; - volatile u32 clip0min; - volatile u32 clip0max; - volatile u32 clip1min; - volatile u32 clip1max; - volatile u32 clip2min; - volatile u32 clip2max; - volatile u32 clip3min; - volatile u32 clip3max; + u32 ppcfg; + u32 pick; + u32 fillmode; + u32 fbramwac; + u32 pmask; + u32 xpmask; + u32 ypmask; + u32 zpmask; + u32 clip0min; + u32 clip0max; + u32 clip1min; + u32 clip1max; + u32 clip2min; + u32 clip2max; + u32 clip3min; + u32 clip3max; /* New 3dRAM III support regs */ - volatile u32 rawblend2; - volatile u32 rawpreblend; - volatile u32 rawstencil; - volatile u32 rawstencilctl; - volatile u32 threedram1; - volatile u32 threedram2; - volatile u32 passin; - volatile u32 rawclrdepth; - volatile u32 rawpmask; - volatile u32 rawcsrc; - volatile u32 rawmatch; - volatile u32 rawmagn; - volatile u32 rawropblend; - volatile u32 rawcmp; - volatile u32 rawwac; - volatile u32 fbramid; + u32 rawblend2; + u32 rawpreblend; + u32 rawstencil; + u32 rawstencilctl; + u32 threedram1; + u32 threedram2; + u32 passin; + u32 rawclrdepth; + u32 rawpmask; + u32 rawcsrc; + u32 rawmatch; + u32 rawmagn; + u32 rawropblend; + u32 rawcmp; + u32 rawwac; + u32 fbramid; - volatile u32 drawop; - u32 xxx10[2]; - volatile u32 fontlpat; - u32 xxx11; - volatile u32 fontxy; - volatile u32 fontw; - volatile u32 fontinc; - volatile u32 font; - u32 xxx12[3]; - volatile u32 blend2; - volatile u32 preblend; - volatile u32 stencil; - volatile u32 stencilctl; - - u32 xxx13[4]; - volatile u32 dcss1; - volatile u32 dcss2; - volatile u32 dcss3; - volatile u32 widpmask; - volatile u32 dcs2; - volatile u32 dcs3; - volatile u32 dcs4; - u32 xxx14; - volatile u32 dcd2; - volatile u32 dcd3; - volatile u32 dcd4; - u32 xxx15; + u32 drawop; + u32 xxx10[2]; + u32 fontlpat; + u32 xxx11; + u32 fontxy; + u32 fontw; + u32 fontinc; + u32 font; + u32 xxx12[3]; + u32 blend2; + u32 preblend; + u32 stencil; + u32 stencilctl; + + u32 xxx13[4]; + u32 dcss1; + u32 dcss2; + u32 dcss3; + u32 widpmask; + u32 dcs2; + u32 dcs3; + u32 dcs4; + u32 xxx14; + u32 dcd2; + u32 dcd3; + u32 dcd4; + u32 xxx15; - volatile u32 pattern[32]; + u32 pattern[32]; - u32 xxx16[256]; + u32 xxx16[256]; - volatile u32 devid; - u32 xxx17[63]; + u32 devid; + u32 xxx17[63]; - volatile u32 ucsr; - u32 xxx18[31]; + u32 ucsr; + u32 xxx18[31]; - volatile u32 mer; + u32 mer; }; struct ffb_dac { - volatile u32 type; - volatile u32 value; - volatile u32 type2; - volatile u32 value2; + u32 type; + u32 value; + u32 type2; + u32 value2; }; struct ffb_par { spinlock_t lock; - struct ffb_fbc *fbc; - struct ffb_dac *dac; + struct ffb_fbc __iomem *fbc; + struct ffb_dac __iomem *dac; u32 flags; #define FFB_FLAG_AFB 0x00000001 @@ -353,16 +354,13 @@ struct ffb_par { unsigned long physbase; unsigned long fbsize; - char name[64]; - int prom_node; - int prom_parent_node; int dac_rev; int board_type; }; static void FFBFifo(struct ffb_par *par, int n) { - struct ffb_fbc *fbc; + struct ffb_fbc __iomem *fbc; int cache = par->fifo_cache; if (cache - n < 0) { @@ -375,7 +373,7 @@ static void FFBFifo(struct ffb_par *par, int n) static void FFBWait(struct ffb_par *par) { - struct ffb_fbc *fbc; + struct ffb_fbc __iomem *fbc; int limit = 10000; fbc = par->fbc; @@ -408,8 +406,8 @@ static __inline__ void ffb_rop(struct ffb_par *par, u32 rop) static void ffb_switch_from_graph(struct ffb_par *par) { - struct ffb_fbc *fbc = par->fbc; - struct ffb_dac *dac = par->dac; + struct ffb_fbc __iomem *fbc = par->fbc; + struct ffb_dac __iomem *dac = par->dac; unsigned long flags; spin_lock_irqsave(&par->lock, flags); @@ -462,7 +460,7 @@ static int ffb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) static void ffb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct ffb_par *par = (struct ffb_par *) info->par; - struct ffb_fbc *fbc = par->fbc; + struct ffb_fbc __iomem *fbc = par->fbc; unsigned long flags; u32 fg; @@ -505,7 +503,7 @@ static void ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { struct ffb_par *par = (struct ffb_par *) info->par; - struct ffb_fbc *fbc = par->fbc; + struct ffb_fbc __iomem *fbc = par->fbc; unsigned long flags; if (area->dx != area->sx || @@ -541,7 +539,7 @@ ffb_copyarea(struct fb_info *info, const struct fb_copyarea *area) static void ffb_imageblit(struct fb_info *info, const struct fb_image *image) { struct ffb_par *par = (struct ffb_par *) info->par; - struct ffb_fbc *fbc = par->fbc; + struct ffb_fbc __iomem *fbc = par->fbc; const u8 *data = image->data; unsigned long flags; u32 fg, bg, xy; @@ -664,7 +662,7 @@ static int ffb_blank(int blank, struct fb_info *info) { struct ffb_par *par = (struct ffb_par *) info->par; - struct ffb_dac *dac = par->dac; + struct ffb_dac __iomem *dac = par->dac; unsigned long flags; u32 tmp; @@ -883,78 +881,42 @@ ffb_init_fix(struct fb_info *info) info->fix.accel = FB_ACCEL_SUN_CREATOR; } -static int ffb_apply_upa_parent_ranges(int parent, - struct linux_prom64_registers *regs) -{ - struct linux_prom64_ranges ranges[PROMREG_MAX]; - char name[128]; - int len, i; - - prom_getproperty(parent, "name", name, sizeof(name)); - if (strcmp(name, "upa") != 0) - return 0; - - len = prom_getproperty(parent, "ranges", (void *) ranges, sizeof(ranges)); - if (len <= 0) - return 1; - - len /= sizeof(struct linux_prom64_ranges); - for (i = 0; i < len; i++) { - struct linux_prom64_ranges *rng = &ranges[i]; - u64 phys_addr = regs->phys_addr; - - if (phys_addr >= rng->ot_child_base && - phys_addr < (rng->ot_child_base + rng->or_size)) { - regs->phys_addr -= rng->ot_child_base; - regs->phys_addr += rng->ot_parent_base; - return 0; - } - } - - return 1; -} - struct all_info { struct fb_info info; struct ffb_par par; u32 pseudo_palette[256]; - struct list_head list; }; -static LIST_HEAD(ffb_list); -static void ffb_init_one(int node, int parent) +static int ffb_init_one(struct of_device *op) { - struct linux_prom64_registers regs[2*PROMREG_MAX]; - struct ffb_fbc *fbc; - struct ffb_dac *dac; + struct device_node *dp = op->node; + struct ffb_fbc __iomem *fbc; + struct ffb_dac __iomem *dac; struct all_info *all; + int err; - if (prom_getproperty(node, "reg", (void *) regs, sizeof(regs)) <= 0) { - printk("ffb: Cannot get reg device node property.\n"); - return; - } + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; - if (ffb_apply_upa_parent_ranges(parent, ®s[0])) { - printk("ffb: Cannot apply parent ranges to regs.\n"); - return; + spin_lock_init(&all->par.lock); + all->par.fbc = of_ioremap(&op->resource[2], 0, + sizeof(struct ffb_fbc), "ffb fbc"); + if (!all->par.fbc) { + kfree(all); + return -ENOMEM; } - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "ffb: Cannot allocate memory.\n"); - return; + all->par.dac = of_ioremap(&op->resource[1], 0, + sizeof(struct ffb_dac), "ffb dac"); + if (!all->par.dac) { + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + kfree(all); + return -ENOMEM; } - memset(all, 0, sizeof(*all)); - - INIT_LIST_HEAD(&all->list); - spin_lock_init(&all->par.lock); - all->par.fbc = (struct ffb_fbc *)(regs[0].phys_addr + FFB_FBC_REGS_POFF); - all->par.dac = (struct ffb_dac *)(regs[0].phys_addr + FFB_DAC_POFF); all->par.rop_cache = FFB_ROP_NEW; - all->par.physbase = regs[0].phys_addr; - all->par.prom_node = node; - all->par.prom_parent_node = parent; + all->par.physbase = op->resource[0].start; /* Don't mention copyarea, so SCROLL_REDRAW is always * used. It is the fastest on this chip. @@ -968,7 +930,7 @@ static void ffb_init_one(int node, int parent) all->info.par = &all->par; all->info.pseudo_palette = all->pseudo_palette; - sbusfb_fill_var(&all->info.var, all->par.prom_node, 32); + sbusfb_fill_var(&all->info.var, dp->node, 32); all->par.fbsize = PAGE_ALIGN(all->info.var.xres * all->info.var.yres * 4); @@ -976,14 +938,13 @@ static void ffb_init_one(int node, int parent) all->info.var.accel_flags = FB_ACCELF_TEXT; - prom_getstring(node, "name", all->par.name, sizeof(all->par.name)); - if (!strcmp(all->par.name, "SUNW,afb")) + if (!strcmp(dp->name, "SUNW,afb")) all->par.flags |= FFB_FLAG_AFB; - all->par.board_type = prom_getintdefault(node, "board_type", 0); + all->par.board_type = of_getintprop_default(dp, "board_type", 0); fbc = all->par.fbc; - if((upa_readl(&fbc->ucsr) & FFB_UCSR_ALL_ERRORS) != 0) + if ((upa_readl(&fbc->ucsr) & FFB_UCSR_ALL_ERRORS) != 0) upa_writel(FFB_UCSR_ALL_ERRORS, &fbc->ucsr); ffb_switch_from_graph(&all->par); @@ -1008,81 +969,88 @@ static void ffb_init_one(int node, int parent) if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { printk(KERN_ERR "ffb: Could not allocate color map.\n"); kfree(all); - return; + return -ENOMEM; } ffb_init_fix(&all->info); - if (register_framebuffer(&all->info) < 0) { + err = register_framebuffer(&all->info); + if (err < 0) { printk(KERN_ERR "ffb: Could not register framebuffer.\n"); fb_dealloc_cmap(&all->info.cmap); kfree(all); - return; + return err; } - list_add(&all->list, &ffb_list); + dev_set_drvdata(&op->dev, all); - printk("ffb: %s at %016lx type %d DAC %d\n", + printk("%s: %s at %016lx, type %d, DAC revision %d\n", + dp->full_name, ((all->par.flags & FFB_FLAG_AFB) ? "AFB" : "FFB"), - regs[0].phys_addr, all->par.board_type, all->par.dac_rev); + all->par.physbase, all->par.board_type, all->par.dac_rev); + + return 0; } -static void ffb_scan_siblings(int root) +static int __devinit ffb_probe(struct of_device *dev, const struct of_device_id *match) { - int node, child; - - child = prom_getchild(root); - for (node = prom_searchsiblings(child, "SUNW,ffb"); node; - node = prom_searchsiblings(prom_getsibling(node), "SUNW,ffb")) - ffb_init_one(node, root); - for (node = prom_searchsiblings(child, "SUNW,afb"); node; - node = prom_searchsiblings(prom_getsibling(node), "SUNW,afb")) - ffb_init_one(node, root); + struct of_device *op = to_of_device(&dev->dev); + + return ffb_init_one(op); } -int __init ffb_init(void) +static int __devexit ffb_remove(struct of_device *dev) { - int root; + struct all_info *all = dev_get_drvdata(&dev->dev); - if (fb_get_options("ffb", NULL)) - return -ENODEV; + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); - ffb_scan_siblings(prom_root_node); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); - root = prom_getchild(prom_root_node); - for (root = prom_searchsiblings(root, "upa"); root; - root = prom_searchsiblings(prom_getsibling(root), "upa")) - ffb_scan_siblings(root); + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit ffb_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id ffb_match[] = { + { + .name = "SUNW,ffb", + }, + { + .name = "SUNW,afb", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, ffb_match); + +static struct of_platform_driver ffb_driver = { + .name = "ffb", + .match_table = ffb_match, + .probe = ffb_probe, + .remove = __devexit_p(ffb_remove), +}; - list_for_each_safe(pos, tmp, &ffb_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +int __init ffb_init(void) +{ + if (fb_get_options("ffb", NULL)) + return -ENODEV; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } + return of_register_driver(&ffb_driver, &of_bus_type); } -int __init -ffb_setup(char *arg) +void __exit ffb_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&ffb_driver); } module_init(ffb_init); - -#ifdef MODULE module_exit(ffb_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for Creator/Elite3D chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 5e25b98..bf0e60b 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c @@ -9,7 +9,6 @@ * more details. */ -#include <linux/config.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c index f04ca72..0186476 100644 --- a/drivers/video/hitfb.c +++ b/drivers/video/hitfb.c @@ -11,7 +11,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index 3fe3ae1..c1f7b49 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c @@ -8,7 +8,6 @@ * License. See the file COPYING in the main directory of this archive for * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index a1f7d80..fbe8a2c 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c @@ -29,7 +29,6 @@ */ #include <linux/module.h> -#include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> diff --git a/drivers/video/imacfb.c b/drivers/video/imacfb.c index 7b1c168..cdbae17 100644 --- a/drivers/video/imacfb.c +++ b/drivers/video/imacfb.c @@ -207,10 +207,6 @@ static int __init imacfb_probe(struct platform_device *dev) size_remap = size_total; imacfb_fix.smem_len = size_remap; -#ifndef __i386__ - screen_info.imacpm_seg = 0; -#endif - if (!request_mem_region(imacfb_fix.smem_start, size_total, "imacfb")) { printk(KERN_WARNING "imacfb: cannot reserve video memory at 0x%lx\n", diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c index f73c642..5f393d9 100644 --- a/drivers/video/imsttfb.c +++ b/drivers/video/imsttfb.c @@ -16,7 +16,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 1718baa..0f9b2fd 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -18,7 +18,6 @@ //#define DEBUG 1 -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 0a0a8b1..3f39d84 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c @@ -108,7 +108,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c index 7533b3d..3b78a57 100644 --- a/drivers/video/intelfb/intelfbhw.c +++ b/drivers/video/intelfb/intelfbhw.c @@ -19,7 +19,6 @@ /* $DHD: intelfb/intelfbhw.c,v 1.9 2003/06/27 15:06:25 dawes Exp $ */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c index 477ad29..2fdbe9b 100644 --- a/drivers/video/kyro/fbdev.c +++ b/drivers/video/kyro/fbdev.c @@ -9,7 +9,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/drivers/video/leo.c b/drivers/video/leo.c index a23cfdb..f3a2433 100644 --- a/drivers/video/leo.c +++ b/drivers/video/leo.c @@ -1,6 +1,6 @@ /* leo.c: LEO frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996-1999 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1997 Michal Rehacek (Michal.Rehacek@st.mff.cuni.cz) * @@ -18,8 +18,8 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -80,10 +80,10 @@ static struct fb_ops leo_ops = { struct leo_cursor { u8 xxx0[16]; - volatile u32 cur_type; - volatile u32 cur_misc; - volatile u32 cur_cursxy; - volatile u32 cur_data; + u32 cur_type; + u32 cur_misc; + u32 cur_cursxy; + u32 cur_data; }; #define LEO_KRN_TYPE_CLUT0 0x00001000 @@ -99,27 +99,27 @@ struct leo_cursor { #define LEO_KRN_CSR_UNK2 0x00000001 struct leo_lx_krn { - volatile u32 krn_type; - volatile u32 krn_csr; - volatile u32 krn_value; + u32 krn_type; + u32 krn_csr; + u32 krn_value; }; struct leo_lc_ss0_krn { - volatile u32 misc; + u32 misc; u8 xxx0[0x800-4]; - volatile u32 rev; + u32 rev; }; struct leo_lc_ss0_usr { - volatile u32 csr; - volatile u32 addrspace; - volatile u32 fontmsk; - volatile u32 fontt; - volatile u32 extent; - volatile u32 src; + u32 csr; + u32 addrspace; + u32 fontmsk; + u32 fontt; + u32 extent; + u32 src; u32 dst; - volatile u32 copy; - volatile u32 fill; + u32 copy; + u32 fill; }; struct leo_lc_ss1_krn { @@ -132,47 +132,47 @@ struct leo_lc_ss1_usr { struct leo_ld { u8 xxx0[0xe00]; - volatile u32 csr; - volatile u32 wid; - volatile u32 wmask; - volatile u32 widclip; - volatile u32 vclipmin; - volatile u32 vclipmax; - volatile u32 pickmin; /* SS1 only */ - volatile u32 pickmax; /* SS1 only */ - volatile u32 fg; - volatile u32 bg; - volatile u32 src; /* Copy/Scroll (SS0 only) */ - volatile u32 dst; /* Copy/Scroll/Fill (SS0 only) */ - volatile u32 extent; /* Copy/Scroll/Fill size (SS0 only) */ + u32 csr; + u32 wid; + u32 wmask; + u32 widclip; + u32 vclipmin; + u32 vclipmax; + u32 pickmin; /* SS1 only */ + u32 pickmax; /* SS1 only */ + u32 fg; + u32 bg; + u32 src; /* Copy/Scroll (SS0 only) */ + u32 dst; /* Copy/Scroll/Fill (SS0 only) */ + u32 extent; /* Copy/Scroll/Fill size (SS0 only) */ u32 xxx1[3]; - volatile u32 setsem; /* SS1 only */ - volatile u32 clrsem; /* SS1 only */ - volatile u32 clrpick; /* SS1 only */ - volatile u32 clrdat; /* SS1 only */ - volatile u32 alpha; /* SS1 only */ + u32 setsem; /* SS1 only */ + u32 clrsem; /* SS1 only */ + u32 clrpick; /* SS1 only */ + u32 clrdat; /* SS1 only */ + u32 alpha; /* SS1 only */ u8 xxx2[0x2c]; - volatile u32 winbg; - volatile u32 planemask; - volatile u32 rop; - volatile u32 z; - volatile u32 dczf; /* SS1 only */ - volatile u32 dczb; /* SS1 only */ - volatile u32 dcs; /* SS1 only */ - volatile u32 dczs; /* SS1 only */ - volatile u32 pickfb; /* SS1 only */ - volatile u32 pickbb; /* SS1 only */ - volatile u32 dcfc; /* SS1 only */ - volatile u32 forcecol; /* SS1 only */ - volatile u32 door[8]; /* SS1 only */ - volatile u32 pick[5]; /* SS1 only */ + u32 winbg; + u32 planemask; + u32 rop; + u32 z; + u32 dczf; /* SS1 only */ + u32 dczb; /* SS1 only */ + u32 dcs; /* SS1 only */ + u32 dczs; /* SS1 only */ + u32 pickfb; /* SS1 only */ + u32 pickbb; /* SS1 only */ + u32 dcfc; /* SS1 only */ + u32 forcecol; /* SS1 only */ + u32 door[8]; /* SS1 only */ + u32 pick[5]; /* SS1 only */ }; #define LEO_SS1_MISC_ENABLE 0x00000001 #define LEO_SS1_MISC_STEREO 0x00000002 struct leo_ld_ss1 { - u8 xxx0[0xef4]; - volatile u32 ss1_misc; + u8 xxx0[0xef4]; + u32 ss1_misc; }; struct leo_ld_gbl { @@ -193,9 +193,8 @@ struct leo_par { #define LEO_FLAG_BLANKED 0x00000001 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; - - struct sbus_dev *sdev; }; static void leo_wait(struct leo_lx_krn __iomem *lx_krn) @@ -368,8 +367,7 @@ static int leo_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(leo_mmap_map, par->physbase, par->fbsize, - par->sdev->reg_addrs[0].which_io, - vma); + par->which_io, vma); } static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) @@ -385,11 +383,9 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) */ static void -leo_init_fix(struct fb_info *info) +leo_init_fix(struct fb_info *info, struct device_node *dp) { - struct leo_par *par = (struct leo_par *)info->par; - - strlcpy(info->fix.id, par->sdev->prom_name, sizeof(info->fix.id)); + strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_TRUECOLOR; @@ -532,60 +528,74 @@ static void leo_fixup_var_rgb(struct fb_var_screeninfo *var) struct all_info { struct fb_info info; struct leo_par par; - struct list_head list; }; -static LIST_HEAD(leo_list); -static void leo_init_one(struct sbus_dev *sdev) +static void leo_unmap_regs(struct all_info *all) { - struct all_info *all; - int linebytes; + if (all->par.lc_ss0_usr) + of_iounmap(all->par.lc_ss0_usr, 0x1000); + if (all->par.ld_ss0) + of_iounmap(all->par.ld_ss0, 0x1000); + if (all->par.ld_ss1) + of_iounmap(all->par.ld_ss1, 0x1000); + if (all->par.lx_krn) + of_iounmap(all->par.lx_krn, 0x1000); + if (all->par.cursor) + of_iounmap(all->par.cursor, sizeof(struct leo_cursor)); + if (all->info.screen_base) + of_iounmap(all->info.screen_base, 0x800000); +} - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "leo: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); +static int __devinit leo_init_one(struct of_device *op) +{ + struct device_node *dp = op->node; + struct all_info *all; + int linebytes, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; - all->par.physbase = sdev->reg_addrs[0].phys_addr; + all->par.physbase = op->resource[0].start; + all->par.which_io = op->resource[0].flags & IORESOURCE_BITS; - sbusfb_fill_var(&all->info.var, sdev->prom_node, 32); + sbusfb_fill_var(&all->info.var, dp->node, 32); leo_fixup_var_rgb(&all->info.var); - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); -#ifdef CONFIG_SPARC32 - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = - sbus_ioremap(&sdev->resource[0], LEO_OFF_SS0, - 0x800000, "leo ram"); - all->par.lc_ss0_usr = - sbus_ioremap(&sdev->resource[0], LEO_OFF_LC_SS0_USR, - 0x1000, "leolc ss0usr"); + of_ioremap(&op->resource[0], LEO_OFF_LC_SS0_USR, + 0x1000, "leolc ss0usr"); all->par.ld_ss0 = - sbus_ioremap(&sdev->resource[0], LEO_OFF_LD_SS0, - 0x1000, "leold ss0"); + of_ioremap(&op->resource[0], LEO_OFF_LD_SS0, + 0x1000, "leold ss0"); all->par.ld_ss1 = - sbus_ioremap(&sdev->resource[0], LEO_OFF_LD_SS1, - 0x1000, "leold ss1"); + of_ioremap(&op->resource[0], LEO_OFF_LD_SS1, + 0x1000, "leold ss1"); all->par.lx_krn = - sbus_ioremap(&sdev->resource[0], LEO_OFF_LX_KRN, - 0x1000, "leolx krn"); + of_ioremap(&op->resource[0], LEO_OFF_LX_KRN, + 0x1000, "leolx krn"); all->par.cursor = - sbus_ioremap(&sdev->resource[0], LEO_OFF_LX_CURSOR, - sizeof(struct leo_cursor), "leolx cursor"); + of_ioremap(&op->resource[0], LEO_OFF_LX_CURSOR, + sizeof(struct leo_cursor), "leolx cursor"); + all->info.screen_base = + of_ioremap(&op->resource[0], LEO_OFF_SS0, + 0x800000, "leo ram"); + if (!all->par.lc_ss0_usr || + !all->par.ld_ss0 || + !all->par.ld_ss1 || + !all->par.lx_krn || + !all->par.cursor || + !all->info.screen_base) { + leo_unmap_regs(all); + kfree(all); + return -ENOMEM; + } all->info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; all->info.fbops = &leo_ops; @@ -597,69 +607,85 @@ static void leo_init_one(struct sbus_dev *sdev) leo_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "leo: Could not allocate color map.\n"); + leo_unmap_regs(all); kfree(all); - return; + return -ENOMEM;; } - leo_init_fix(&all->info); + leo_init_fix(&all->info, dp); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "leo: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { fb_dealloc_cmap(&all->info.cmap); + leo_unmap_regs(all); kfree(all); - return; + return err; } - list_add(&all->list, &leo_list); + dev_set_drvdata(&op->dev, all); + + printk("%s: leo at %lx:%lx\n", + dp->full_name, + all->par.which_io, all->par.physbase); - printk("leo: %s at %lx:%lx\n", - sdev->prom_name, - (long) sdev->reg_addrs[0].which_io, - (long) sdev->reg_addrs[0].phys_addr); + return 0; } -int __init leo_init(void) +static int __devinit leo_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("leofb", NULL)) - return -ENODEV; + return leo_init_one(op); +} - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "leo")) - leo_init_one(sdev); - } +static int __devexit leo_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + leo_unmap_regs(all); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit leo_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id leo_match[] = { + { + .name = "leo", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, leo_match); + +static struct of_platform_driver leo_driver = { + .name = "leo", + .match_table = leo_match, + .probe = leo_probe, + .remove = __devexit_p(leo_remove), +}; - list_for_each_safe(pos, tmp, &leo_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static int __init leo_init(void) +{ + if (fb_get_options("leofb", NULL)) + return -ENODEV; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } + return of_register_driver(&leo_driver, &of_bus_type); } -int __init -leo_setup(char *arg) +static void __exit leo_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&leo_driver); } module_init(leo_init); -#ifdef MODULE module_exit(leo_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for LEO chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c index 788fa81..80c0361 100644 --- a/drivers/video/logo/logo.c +++ b/drivers/video/logo/logo.c @@ -9,7 +9,6 @@ * Copyright (C) 2003 Geert Uytterhoeven <geert@linux-m68k.org> */ -#include <linux/config.h> #include <linux/linux_logo.h> #include <linux/stddef.h> #include <linux/module.h> diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c index d21321c..ab21495 100644 --- a/drivers/video/macmodes.c +++ b/drivers/video/macmodes.c @@ -15,7 +15,6 @@ * more details. */ -#include <linux/config.h> #include <linux/errno.h> #include <linux/fb.h> #include <linux/string.h> diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c index a456e67..c4b570b 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.c +++ b/drivers/video/matrox/matroxfb_DAC1064.c @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include "matroxfb_DAC1064.h" #include "matroxfb_misc.h" diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h index 56513a5..df39c31 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.h +++ b/drivers/video/matrox/matroxfb_DAC1064.h @@ -1,7 +1,6 @@ #ifndef __MATROXFB_DAC1064_H__ #define __MATROXFB_DAC1064_H__ -#include <linux/config.h> #include "matroxfb_base.h" diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c index 23ebad0..a5690a5 100644 --- a/drivers/video/matrox/matroxfb_Ti3026.c +++ b/drivers/video/matrox/matroxfb_Ti3026.c @@ -78,7 +78,6 @@ * */ -#include <linux/config.h> #include "matroxfb_Ti3026.h" #include "matroxfb_misc.h" diff --git a/drivers/video/matrox/matroxfb_Ti3026.h b/drivers/video/matrox/matroxfb_Ti3026.h index 536e5f6..27872aa 100644 --- a/drivers/video/matrox/matroxfb_Ti3026.h +++ b/drivers/video/matrox/matroxfb_Ti3026.h @@ -1,7 +1,6 @@ #ifndef __MATROXFB_TI3026_H__ #define __MATROXFB_TI3026_H__ -#include <linux/config.h> #include "matroxfb_base.h" diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index f4ddd34..8b5bf79 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c @@ -99,7 +99,6 @@ * */ -#include <linux/config.h> #include <linux/version.h> #define __OLD_VIDIOC_ diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index b717371..b95779b 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h @@ -25,7 +25,6 @@ /* Guard accelerator accesses with spin_lock_irqsave... */ #undef MATROXFB_USE_SPINLOCKS -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c index 263d801..18886b6 100644 --- a/drivers/video/matrox/matroxfb_misc.c +++ b/drivers/video/matrox/matroxfb_misc.c @@ -84,7 +84,6 @@ * */ -#include <linux/config.h> #include "matroxfb_misc.h" #include <linux/interrupt.h> diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 2f156b7..773855a 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -54,7 +54,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index 1edb1c4..19eef3a 100644 --- a/drivers/video/nvidia/nv_i2c.c +++ b/drivers/video/nvidia/nv_i2c.c @@ -10,7 +10,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c index 7a03d04..8209106 100644 --- a/drivers/video/nvidia/nv_of.c +++ b/drivers/video/nvidia/nv_of.c @@ -10,7 +10,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index 7b5cffb..b02d603 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -9,7 +9,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/offb.c b/drivers/video/offb.c index ad1434e..bfeb11b 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -12,7 +12,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c index 0d19575..56ac51d 100644 --- a/drivers/video/p9100.c +++ b/drivers/video/p9100.c @@ -1,6 +1,6 @@ /* p9100.c: P9100 frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright 1999 Derrick J Brashear (shadow@dementia.org) * * Driver layout based loosely on tgafb.c, see that file for credits. @@ -17,8 +17,8 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -72,60 +72,60 @@ static struct fb_ops p9100_ops = { struct p9100_regs { /* Registers for the system control */ - volatile u32 sys_base; - volatile u32 sys_config; - volatile u32 sys_intr; - volatile u32 sys_int_ena; - volatile u32 sys_alt_rd; - volatile u32 sys_alt_wr; - volatile u32 sys_xxx[58]; + u32 sys_base; + u32 sys_config; + u32 sys_intr; + u32 sys_int_ena; + u32 sys_alt_rd; + u32 sys_alt_wr; + u32 sys_xxx[58]; /* Registers for the video control */ - volatile u32 vid_base; - volatile u32 vid_hcnt; - volatile u32 vid_htotal; - volatile u32 vid_hsync_rise; - volatile u32 vid_hblank_rise; - volatile u32 vid_hblank_fall; - volatile u32 vid_hcnt_preload; - volatile u32 vid_vcnt; - volatile u32 vid_vlen; - volatile u32 vid_vsync_rise; - volatile u32 vid_vblank_rise; - volatile u32 vid_vblank_fall; - volatile u32 vid_vcnt_preload; - volatile u32 vid_screenpaint_addr; - volatile u32 vid_screenpaint_timectl1; - volatile u32 vid_screenpaint_qsfcnt; - volatile u32 vid_screenpaint_timectl2; - volatile u32 vid_xxx[15]; + u32 vid_base; + u32 vid_hcnt; + u32 vid_htotal; + u32 vid_hsync_rise; + u32 vid_hblank_rise; + u32 vid_hblank_fall; + u32 vid_hcnt_preload; + u32 vid_vcnt; + u32 vid_vlen; + u32 vid_vsync_rise; + u32 vid_vblank_rise; + u32 vid_vblank_fall; + u32 vid_vcnt_preload; + u32 vid_screenpaint_addr; + u32 vid_screenpaint_timectl1; + u32 vid_screenpaint_qsfcnt; + u32 vid_screenpaint_timectl2; + u32 vid_xxx[15]; /* Registers for the video control */ - volatile u32 vram_base; - volatile u32 vram_memcfg; - volatile u32 vram_refresh_pd; - volatile u32 vram_refresh_cnt; - volatile u32 vram_raslo_max; - volatile u32 vram_raslo_cur; - volatile u32 pwrup_cfg; - volatile u32 vram_xxx[25]; + u32 vram_base; + u32 vram_memcfg; + u32 vram_refresh_pd; + u32 vram_refresh_cnt; + u32 vram_raslo_max; + u32 vram_raslo_cur; + u32 pwrup_cfg; + u32 vram_xxx[25]; /* Registers for IBM RGB528 Palette */ - volatile u32 ramdac_cmap_wridx; - volatile u32 ramdac_palette_data; - volatile u32 ramdac_pixel_mask; - volatile u32 ramdac_palette_rdaddr; - volatile u32 ramdac_idx_lo; - volatile u32 ramdac_idx_hi; - volatile u32 ramdac_idx_data; - volatile u32 ramdac_idx_ctl; - volatile u32 ramdac_xxx[1784]; + u32 ramdac_cmap_wridx; + u32 ramdac_palette_data; + u32 ramdac_pixel_mask; + u32 ramdac_palette_rdaddr; + u32 ramdac_idx_lo; + u32 ramdac_idx_hi; + u32 ramdac_idx_data; + u32 ramdac_idx_ctl; + u32 ramdac_xxx[1784]; }; struct p9100_cmd_parameng { - volatile u32 parameng_status; - volatile u32 parameng_bltcmd; - volatile u32 parameng_quadcmd; + u32 parameng_status; + u32 parameng_bltcmd; + u32 parameng_quadcmd; }; struct p9100_par { @@ -136,9 +136,8 @@ struct p9100_par { #define P9100_FLAG_BLANKED 0x00000001 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; - - struct sbus_dev *sdev; }; /** @@ -227,8 +226,7 @@ static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(p9100_mmap_map, par->physbase, par->fbsize, - par->sdev->reg_addrs[0].which_io, - vma); + par->which_io, vma); } static int p9100_ioctl(struct fb_info *info, unsigned int cmd, @@ -245,12 +243,9 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd, * Initialisation */ -static void -p9100_init_fix(struct fb_info *info, int linebytes) +static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) { - struct p9100_par *par = (struct p9100_par *)info->par; - - strlcpy(info->fix.id, par->sdev->prom_name, sizeof(info->fix.id)); + strlcpy(info->fix.id, dp->name, sizeof(info->fix.id)); info->fix.type = FB_TYPE_PACKED_PIXELS; info->fix.visual = FB_VISUAL_PSEUDOCOLOR; @@ -263,121 +258,137 @@ p9100_init_fix(struct fb_info *info, int linebytes) struct all_info { struct fb_info info; struct p9100_par par; - struct list_head list; }; -static LIST_HEAD(p9100_list); -static void p9100_init_one(struct sbus_dev *sdev) +static int __devinit p9100_init_one(struct of_device *op) { + struct device_node *dp = op->node; struct all_info *all; - int linebytes; - - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "p9100: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); + int linebytes, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; /* This is the framebuffer and the only resource apps can mmap. */ - all->par.physbase = sdev->reg_addrs[2].phys_addr; + all->par.physbase = op->resource[2].start; + all->par.which_io = op->resource[2].flags & IORESOURCE_BITS; - sbusfb_fill_var(&all->info.var, sdev->prom_node, 8); + sbusfb_fill_var(&all->info.var, dp->node, 8); all->info.var.red.length = 8; all->info.var.green.length = 8; all->info.var.blue.length = 8; - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - all->par.regs = sbus_ioremap(&sdev->resource[0], 0, - sizeof(struct p9100_regs), "p9100 regs"); + all->par.regs = of_ioremap(&op->resource[0], 0, + sizeof(struct p9100_regs), "p9100 regs"); + if (!all->par.regs) { + kfree(all); + return -ENOMEM; + } all->info.flags = FBINFO_DEFAULT; all->info.fbops = &p9100_ops; -#ifdef CONFIG_SPARC32 - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = sbus_ioremap(&sdev->resource[2], 0, - all->par.fbsize, "p9100 ram"); + all->info.screen_base = of_ioremap(&op->resource[2], 0, + all->par.fbsize, "p9100 ram"); + if (!all->info.screen_base) { + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + kfree(all); + return -ENOMEM; + } all->info.par = &all->par; p9100_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "p9100: Could not allocate color map.\n"); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - return; + return -ENOMEM; } - p9100_init_fix(&all->info, linebytes); + p9100_init_fix(&all->info, linebytes, dp); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "p9100: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { fb_dealloc_cmap(&all->info.cmap); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - return; + return err; } fb_set_cmap(&all->info.cmap, &all->info); - list_add(&all->list, &p9100_list); + dev_set_drvdata(&op->dev, all); + + printk("%s: p9100 at %lx:%lx\n", + dp->full_name, + all->par.which_io, all->par.physbase); - printk("p9100: %s at %lx:%lx\n", - sdev->prom_name, - (long) sdev->reg_addrs[0].which_io, - (long) sdev->reg_addrs[0].phys_addr); + return 0; } -int __init p9100_init(void) +static int __devinit p9100_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("p9100fb", NULL)) - return -ENODEV; + return p9100_init_one(op); +} - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "p9100")) - p9100_init_one(sdev); - } +static int __devexit p9100_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit p9100_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id p9100_match[] = { + { + .name = "p9100", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, p9100_match); - list_for_each_safe(pos, tmp, &p9100_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver p9100_driver = { + .name = "p9100", + .match_table = p9100_match, + .probe = p9100_probe, + .remove = __devexit_p(p9100_remove), +}; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } +static int __init p9100_init(void) +{ + if (fb_get_options("p9100fb", NULL)) + return -ENODEV; + + return of_register_driver(&p9100_driver, &of_bus_type); } -int __init -p9100_setup(char *arg) +static void __exit p9100_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&p9100_driver); } module_init(p9100_init); - -#ifdef MODULE module_exit(p9100_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for P9100 chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c index 335e374..450e802 100644 --- a/drivers/video/platinumfb.c +++ b/drivers/video/platinumfb.c @@ -17,7 +17,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c index 4e96393..49a203e 100644 --- a/drivers/video/pm2fb.c +++ b/drivers/video/pm2fb.c @@ -27,7 +27,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c index 52c18a3..0e0f977 100644 --- a/drivers/video/pm3fb.c +++ b/drivers/video/pm3fb.c @@ -52,7 +52,6 @@ * Wed Feb 21 14:47:06 CET 2001, v 1.0.0: First working version */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index ec4bacf..4a1e0e8 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c @@ -56,7 +56,6 @@ #include <linux/tty.h> #include <linux/slab.h> #include <linux/delay.h> -#include <linux/config.h> #include <linux/interrupt.h> #include <linux/fb.h> #include <linux/init.h> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 809fc5e..54663a9 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -22,7 +22,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 12af58c..2788655 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c @@ -29,7 +29,6 @@ * doublescan modes are broken */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c index 8b1967f..9751c37 100644 --- a/drivers/video/riva/rivafb-i2c.c +++ b/drivers/video/riva/rivafb-i2c.c @@ -12,7 +12,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/riva/rivafb.h b/drivers/video/riva/rivafb.h index 440ff445..7fa13fc 100644 --- a/drivers/video/riva/rivafb.h +++ b/drivers/video/riva/rivafb.h @@ -1,7 +1,6 @@ #ifndef __RIVAFB_H #define __RIVAFB_H -#include <linux/config.h> #include <linux/fb.h> #include <video/vga.h> #include <linux/i2c.h> diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index feec47b..a5333c1 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c @@ -28,7 +28,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/delay.h> diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index d9831fd..553fd84 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -160,7 +160,6 @@ * - Add patch 681/1 and clean up stork definitions. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 21debed..e83befd 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -10,7 +10,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 78883cf..4729af4 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -41,7 +41,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index c0cc5e3..ebb6756 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c @@ -9,7 +9,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h> diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h index 634c0a9..7ecab87 100644 --- a/drivers/video/sis/init.h +++ b/drivers/video/sis/init.h @@ -73,7 +73,6 @@ #ifdef SIS_CP #undef SIS_CP #endif -#include <linux/config.h> #include <linux/version.h> #include <linux/types.h> #include <asm/io.h> diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c index c3e070a..f13fadd 100644 --- a/drivers/video/sis/init301.c +++ b/drivers/video/sis/init301.c @@ -8043,8 +8043,8 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short SiS_SetCH700x(SiS_Pr,0x01,0x28); /* Set video bandwidth - High bandwith Luma composite video filter(S0=1) - low bandwith Luma S-video filter (S2-1=00) + High bandwidth Luma composite video filter(S0=1) + low bandwidth Luma S-video filter (S2-1=00) disable peak filter in S-video channel (S3=0) high bandwidth Chroma Filter (S5-4=11) =00110001=0x31 diff --git a/drivers/video/sis/init301.h b/drivers/video/sis/init301.h index f475b21..bc321dc 100644 --- a/drivers/video/sis/init301.h +++ b/drivers/video/sis/init301.h @@ -67,7 +67,6 @@ #ifdef SIS_CP #undef SIS_CP #endif -#include <linux/config.h> #include <linux/version.h> #include <linux/types.h> #include <asm/io.h> diff --git a/drivers/video/sis/initextlfb.c b/drivers/video/sis/initextlfb.c index cc856d9..09f5d75 100644 --- a/drivers/video/sis/initextlfb.c +++ b/drivers/video/sis/initextlfb.c @@ -30,7 +30,6 @@ #include "vgatypes.h" #include "vstruct.h" -#include <linux/config.h> #include <linux/version.h> #include <linux/types.h> #include <linux/fb.h> diff --git a/drivers/video/sis/osdef.h b/drivers/video/sis/osdef.h index 841ca31..f595680 100644 --- a/drivers/video/sis/osdef.h +++ b/drivers/video/sis/osdef.h @@ -90,7 +90,6 @@ /**********************************************************************/ #ifdef SIS_LINUX_KERNEL -#include <linux/config.h> #include <linux/version.h> #ifdef CONFIG_FB_SIS_300 diff --git a/drivers/video/sis/sis.h b/drivers/video/sis/sis.h index 0b6e625..a259446 100644 --- a/drivers/video/sis/sis.h +++ b/drivers/video/sis/sis.h @@ -24,7 +24,6 @@ #ifndef _SIS_H_ #define _SIS_H_ -#include <linux/config.h> #include <linux/version.h> #include "osdef.h" diff --git a/drivers/video/sis/sis_accel.c b/drivers/video/sis/sis_accel.c index bab933e..3b7ce03 100644 --- a/drivers/video/sis/sis_accel.c +++ b/drivers/video/sis/sis_accel.c @@ -28,7 +28,6 @@ * for more information and updates) */ -#include <linux/config.h> #include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index c63c0e7..b848ca7 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c @@ -33,7 +33,6 @@ * */ -#include <linux/config.h> #include <linux/version.h> #include <linux/module.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index c44de90..dad54e7 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c @@ -82,7 +82,6 @@ * Includes */ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c index 4a292aa..3e16e2d 100644 --- a/drivers/video/stifb.c +++ b/drivers/video/stifb.c @@ -54,7 +54,6 @@ #undef DEBUG_STIFB_REGS /* debug sti register accesses */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/sun3fb.c b/drivers/video/sun3fb.c index 9b36b9d..e046e20 100644 --- a/drivers/video/sun3fb.c +++ b/drivers/video/sun3fb.c @@ -25,7 +25,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c index 95b9182..6990ab1 100644 --- a/drivers/video/tcx.c +++ b/drivers/video/tcx.c @@ -1,6 +1,6 @@ /* tcx.c: TCX frame buffer driver * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) @@ -19,8 +19,8 @@ #include <linux/mm.h> #include <asm/io.h> -#include <asm/sbus.h> -#include <asm/oplib.h> +#include <asm/prom.h> +#include <asm/of_device.h> #include <asm/fbio.h> #include "sbuslib.h" @@ -77,32 +77,32 @@ static struct fb_ops tcx_ops = { /* The contents are unknown */ struct tcx_tec { - volatile u32 tec_matrix; - volatile u32 tec_clip; - volatile u32 tec_vdc; + u32 tec_matrix; + u32 tec_clip; + u32 tec_vdc; }; struct tcx_thc { - volatile u32 thc_rev; + u32 thc_rev; u32 thc_pad0[511]; - volatile u32 thc_hs; /* hsync timing */ - volatile u32 thc_hsdvs; - volatile u32 thc_hd; - volatile u32 thc_vs; /* vsync timing */ - volatile u32 thc_vd; - volatile u32 thc_refresh; - volatile u32 thc_misc; + u32 thc_hs; /* hsync timing */ + u32 thc_hsdvs; + u32 thc_hd; + u32 thc_vs; /* vsync timing */ + u32 thc_vd; + u32 thc_refresh; + u32 thc_misc; u32 thc_pad1[56]; - volatile u32 thc_cursxy; /* cursor x,y position (16 bits each) */ - volatile u32 thc_cursmask[32]; /* cursor mask bits */ - volatile u32 thc_cursbits[32]; /* what to show where mask enabled */ + u32 thc_cursxy; /* cursor x,y position (16 bits each) */ + u32 thc_cursmask[32]; /* cursor mask bits */ + u32 thc_cursbits[32]; /* what to show where mask enabled */ }; struct bt_regs { - volatile u32 addr; - volatile u32 color_map; - volatile u32 control; - volatile u32 cursor; + u32 addr; + u32 color_map; + u32 control; + u32 cursor; }; #define TCX_MMAP_ENTRIES 14 @@ -112,24 +112,23 @@ struct tcx_par { struct bt_regs __iomem *bt; struct tcx_thc __iomem *thc; struct tcx_tec __iomem *tec; - volatile u32 __iomem *cplane; + u32 __iomem *cplane; u32 flags; #define TCX_FLAG_BLANKED 0x00000001 unsigned long physbase; + unsigned long which_io; unsigned long fbsize; struct sbus_mmap_map mmap_map[TCX_MMAP_ENTRIES]; int lowdepth; - - struct sbus_dev *sdev; }; /* Reset control plane so that WID is 8-bit plane. */ static void __tcx_set_control_plane (struct tcx_par *par) { - volatile u32 __iomem *p, *pend; + u32 __iomem *p, *pend; if (par->lowdepth) return; @@ -307,8 +306,7 @@ static int tcx_mmap(struct fb_info *info, struct vm_area_struct *vma) return sbusfb_mmap_helper(par->mmap_map, par->physbase, par->fbsize, - par->sdev->reg_addrs[0].which_io, - vma); + par->which_io, vma); } static int tcx_ioctl(struct fb_info *info, unsigned int cmd, @@ -350,48 +348,71 @@ tcx_init_fix(struct fb_info *info, int linebytes) struct all_info { struct fb_info info; struct tcx_par par; - struct list_head list; }; -static LIST_HEAD(tcx_list); -static void tcx_init_one(struct sbus_dev *sdev) +static void tcx_unmap_regs(struct all_info *all) { - struct all_info *all; - int linebytes, i; + if (all->par.tec) + of_iounmap(all->par.tec, sizeof(struct tcx_tec)); + if (all->par.thc) + of_iounmap(all->par.thc, sizeof(struct tcx_thc)); + if (all->par.bt) + of_iounmap(all->par.bt, sizeof(struct bt_regs)); + if (all->par.cplane) + of_iounmap(all->par.cplane, all->par.fbsize * sizeof(u32)); + if (all->info.screen_base) + of_iounmap(all->info.screen_base, all->par.fbsize); +} - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) { - printk(KERN_ERR "tcx: Cannot allocate memory.\n"); - return; - } - memset(all, 0, sizeof(*all)); +static int __devinit tcx_init_one(struct of_device *op) +{ + struct device_node *dp = op->node; + struct all_info *all; + int linebytes, i, err; - INIT_LIST_HEAD(&all->list); + all = kzalloc(sizeof(*all), GFP_KERNEL); + if (!all) + return -ENOMEM; spin_lock_init(&all->par.lock); - all->par.sdev = sdev; - all->par.lowdepth = prom_getbool(sdev->prom_node, "tcx-8-bit"); + all->par.lowdepth = + (of_find_property(dp, "tcx-8-bit", NULL) != NULL); - sbusfb_fill_var(&all->info.var, sdev->prom_node, 8); + sbusfb_fill_var(&all->info.var, dp->node, 8); all->info.var.red.length = 8; all->info.var.green.length = 8; all->info.var.blue.length = 8; - linebytes = prom_getintdefault(sdev->prom_node, "linebytes", - all->info.var.xres); + linebytes = of_getintprop_default(dp, "linebytes", + all->info.var.xres); all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - all->par.tec = sbus_ioremap(&sdev->resource[7], 0, - sizeof(struct tcx_tec), "tcx tec"); - all->par.thc = sbus_ioremap(&sdev->resource[9], 0, - sizeof(struct tcx_thc), "tcx thc"); - all->par.bt = sbus_ioremap(&sdev->resource[8], 0, - sizeof(struct bt_regs), "tcx dac"); + all->par.tec = of_ioremap(&op->resource[7], 0, + sizeof(struct tcx_tec), "tcx tec"); + all->par.thc = of_ioremap(&op->resource[9], 0, + sizeof(struct tcx_thc), "tcx thc"); + all->par.bt = of_ioremap(&op->resource[8], 0, + sizeof(struct bt_regs), "tcx dac"); + all->info.screen_base = of_ioremap(&op->resource[0], 0, + all->par.fbsize, "tcx ram"); + if (!all->par.tec || !all->par.thc || + !all->par.bt || !all->info.screen_base) { + tcx_unmap_regs(all); + kfree(all); + return -ENOMEM; + } + memcpy(&all->par.mmap_map, &__tcx_mmap_map, sizeof(all->par.mmap_map)); if (!all->par.lowdepth) { - all->par.cplane = sbus_ioremap(&sdev->resource[4], 0, - all->par.fbsize * sizeof(u32), "tcx cplane"); + all->par.cplane = of_ioremap(&op->resource[4], 0, + all->par.fbsize * sizeof(u32), + "tcx cplane"); + if (!all->par.cplane) { + tcx_unmap_regs(all); + kfree(all); + return -ENOMEM; + } } else { all->par.mmap_map[1].size = SBUS_MMAP_EMPTY; all->par.mmap_map[4].size = SBUS_MMAP_EMPTY; @@ -400,6 +421,8 @@ static void tcx_init_one(struct sbus_dev *sdev) } all->par.physbase = 0; + all->par.which_io = op->resource[0].flags & IORESOURCE_BITS; + for (i = 0; i < TCX_MMAP_ENTRIES; i++) { int j; @@ -416,18 +439,11 @@ static void tcx_init_one(struct sbus_dev *sdev) j = i; break; }; - all->par.mmap_map[i].poff = sdev->reg_addrs[j].phys_addr; + all->par.mmap_map[i].poff = op->resource[j].start; } all->info.flags = FBINFO_DEFAULT; all->info.fbops = &tcx_ops; -#ifdef CONFIG_SPARC32 - all->info.screen_base = (char __iomem *) - prom_getintdefault(sdev->prom_node, "address", 0); -#endif - if (!all->info.screen_base) - all->info.screen_base = sbus_ioremap(&sdev->resource[0], 0, - all->par.fbsize, "tcx ram"); all->info.par = &all->par; /* Initialize brooktree DAC. */ @@ -445,72 +461,88 @@ static void tcx_init_one(struct sbus_dev *sdev) tcx_blank(FB_BLANK_UNBLANK, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - printk(KERN_ERR "tcx: Could not allocate color map.\n"); + tcx_unmap_regs(all); kfree(all); - return; + return -ENOMEM; } fb_set_cmap(&all->info.cmap, &all->info); tcx_init_fix(&all->info, linebytes); - if (register_framebuffer(&all->info) < 0) { - printk(KERN_ERR "tcx: Could not register framebuffer.\n"); + err = register_framebuffer(&all->info); + if (err < 0) { fb_dealloc_cmap(&all->info.cmap); + tcx_unmap_regs(all); kfree(all); - return; + return err; } - list_add(&all->list, &tcx_list); + dev_set_drvdata(&op->dev, all); - printk("tcx: %s at %lx:%lx, %s\n", - sdev->prom_name, - (long) sdev->reg_addrs[0].which_io, - (long) sdev->reg_addrs[0].phys_addr, + printk("%s: TCX at %lx:%lx, %s\n", + dp->full_name, + all->par.which_io, + op->resource[0].start, all->par.lowdepth ? "8-bit only" : "24-bit depth"); + + return 0; } -int __init tcx_init(void) +static int __devinit tcx_probe(struct of_device *dev, const struct of_device_id *match) { - struct sbus_bus *sbus; - struct sbus_dev *sdev; + struct of_device *op = to_of_device(&dev->dev); - if (fb_get_options("tcxfb", NULL)) - return -ENODEV; + return tcx_init_one(op); +} - for_all_sbusdev(sdev, sbus) { - if (!strcmp(sdev->prom_name, "SUNW,tcx")) - tcx_init_one(sdev); - } +static int __devexit tcx_remove(struct of_device *dev) +{ + struct all_info *all = dev_get_drvdata(&dev->dev); + + unregister_framebuffer(&all->info); + fb_dealloc_cmap(&all->info.cmap); + + tcx_unmap_regs(all); + + kfree(all); + + dev_set_drvdata(&dev->dev, NULL); return 0; } -void __exit tcx_exit(void) -{ - struct list_head *pos, *tmp; +static struct of_device_id tcx_match[] = { + { + .name = "SUNW,tcx", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, tcx_match); - list_for_each_safe(pos, tmp, &tcx_list) { - struct all_info *all = list_entry(pos, typeof(*all), list); +static struct of_platform_driver tcx_driver = { + .name = "tcx", + .match_table = tcx_match, + .probe = tcx_probe, + .remove = __devexit_p(tcx_remove), +}; - unregister_framebuffer(&all->info); - fb_dealloc_cmap(&all->info.cmap); - kfree(all); - } +int __init tcx_init(void) +{ + if (fb_get_options("tcxfb", NULL)) + return -ENODEV; + + return of_register_driver(&tcx_driver, &of_bus_type); } -int __init -tcx_setup(char *arg) +void __exit tcx_exit(void) { - /* No cmdline options yet... */ - return 0; + of_unregister_driver(&tcx_driver); } module_init(tcx_init); - -#ifdef MODULE module_exit(tcx_exit); -#endif MODULE_DESCRIPTION("framebuffer driver for TCX chipsets"); -MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); +MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); +MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 5e5328d..239b149 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c @@ -58,7 +58,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c index 41f8c2d..14175cdb 100644 --- a/drivers/video/tridentfb.c +++ b/drivers/video/tridentfb.c @@ -15,7 +15,6 @@ * TGUI acceleration */ -#include <linux/config.h> #include <linux/module.h> #include <linux/fb.h> #include <linux/init.h> diff --git a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c index 2bdeb4b..1d76c03 100644 --- a/drivers/video/valkyriefb.c +++ b/drivers/video/valkyriefb.c @@ -39,7 +39,6 @@ * more details. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c index 15179ec..d94efaf 100644 --- a/drivers/video/vgastate.c +++ b/drivers/video/vgastate.c @@ -13,7 +13,6 @@ * archive for more details. * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/fb.h> diff --git a/drivers/zorro/names.c b/drivers/zorro/names.c index 0dd532d..e8517c3 100644 --- a/drivers/zorro/names.c +++ b/drivers/zorro/names.c @@ -9,7 +9,6 @@ * David Mosberger-Tang, Martin Mares */ -#include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/types.h> |