summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /drivers/char
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Config.in2
-rw-r--r--drivers/char/README.computone2
-rw-r--r--drivers/char/README.epca2
-rw-r--r--drivers/char/acquirewdt.c2
-rw-r--r--drivers/char/agp/agp.h24
-rw-r--r--drivers/char/agp/agpgart_be.c321
-rw-r--r--drivers/char/agp/agpgart_fe.c4
-rw-r--r--drivers/char/amiserial.c5
-rw-r--r--drivers/char/applicom.c2
-rw-r--r--drivers/char/busmouse.c2
-rw-r--r--drivers/char/cd1865.h2
-rw-r--r--drivers/char/console.c2
-rw-r--r--drivers/char/consolemap.c3
-rw-r--r--drivers/char/drm/Makefile2
-rw-r--r--drivers/char/dsp56k.c2
-rw-r--r--drivers/char/dtlk.c4
-rw-r--r--drivers/char/dz.c4
-rw-r--r--drivers/char/epca.c2
-rw-r--r--drivers/char/esp.c2
-rw-r--r--drivers/char/ftape/lowlevel/fdc-isr.c6
-rw-r--r--drivers/char/ftape/lowlevel/ftape-buffer.c2
-rw-r--r--drivers/char/ftape/zftape/zftape-buffers.c2
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c2
-rw-r--r--drivers/char/ftape/zftape/zftape-vtbl.c2
-rw-r--r--drivers/char/i810_rng.c4
-rw-r--r--drivers/char/ip2.c6
-rw-r--r--drivers/char/ip2/i2hw.h2
-rw-r--r--drivers/char/ip2/i2lib.h2
-rw-r--r--drivers/char/ip2main.c10
-rw-r--r--drivers/char/istallion.c3
-rw-r--r--drivers/char/joystick/a3d.c2
-rw-r--r--drivers/char/joystick/adi.c2
-rw-r--r--drivers/char/joystick/amijoy.c2
-rw-r--r--drivers/char/joystick/analog.c2
-rw-r--r--drivers/char/joystick/cobra.c2
-rw-r--r--drivers/char/joystick/gameport.c2
-rw-r--r--drivers/char/joystick/gf2k.c2
-rw-r--r--drivers/char/joystick/grip.c2
-rw-r--r--drivers/char/joystick/iforce.c2
-rw-r--r--drivers/char/joystick/interact.c2
-rw-r--r--drivers/char/joystick/lightning.c2
-rw-r--r--drivers/char/joystick/magellan.c2
-rw-r--r--drivers/char/joystick/ns558.c2
-rw-r--r--drivers/char/joystick/serport.c2
-rw-r--r--drivers/char/joystick/sidewinder.c2
-rw-r--r--drivers/char/joystick/spaceball.c2
-rw-r--r--drivers/char/joystick/spaceorb.c2
-rw-r--r--drivers/char/joystick/tmdc.c2
-rw-r--r--drivers/char/joystick/warrior.c2
-rw-r--r--drivers/char/lp.c23
-rw-r--r--drivers/char/mem.c12
-rw-r--r--drivers/char/misc.c2
-rw-r--r--drivers/char/n_hdlc.c2
-rw-r--r--drivers/char/n_r3964.c2
-rw-r--r--drivers/char/n_tty.c2
-rw-r--r--drivers/char/nvram.c5
-rw-r--r--drivers/char/pc110pad.c71
-rw-r--r--drivers/char/pc_keyb.c2
-rw-r--r--drivers/char/pcmcia/serial_cb.c4
-rw-r--r--drivers/char/pcmcia/serial_cs.c4
-rw-r--r--drivers/char/pcwd.c2
-rw-r--r--drivers/char/pcxx.c4
-rw-r--r--drivers/char/q40_keyb.c2
-rw-r--r--drivers/char/qpmouse.c2
-rw-r--r--drivers/char/random.c4
-rw-r--r--drivers/char/rio/rio.h2
-rw-r--r--drivers/char/rio/rio_linux.c2
-rw-r--r--drivers/char/rio/rioboot.c2
-rw-r--r--drivers/char/rio/riocmd.c3
-rw-r--r--drivers/char/rio/rioctrl.c2
-rw-r--r--drivers/char/rio/rioinfo.h2
-rw-r--r--drivers/char/rio/rioinit.c2
-rw-r--r--drivers/char/rio/riointr.c3
-rw-r--r--drivers/char/rio/rioparam.c3
-rw-r--r--drivers/char/rio/rioroute.c2
-rw-r--r--drivers/char/rio/riotable.c4
-rw-r--r--drivers/char/rio/riotty.c3
-rw-r--r--drivers/char/rocket.c4
-rw-r--r--drivers/char/sbc60xxwdt.c2
-rw-r--r--drivers/char/scan_keyb.c2
-rw-r--r--drivers/char/selection.c2
-rw-r--r--drivers/char/serial.c51
-rw-r--r--drivers/char/serial_21285.c2
-rw-r--r--drivers/char/serial_amba.c2
-rw-r--r--drivers/char/sh-sci.c2
-rw-r--r--drivers/char/softdog.c30
-rw-r--r--drivers/char/stallion.c3
-rw-r--r--drivers/char/synclink.c2
-rw-r--r--drivers/char/sysrq.c1
-rw-r--r--drivers/char/tpqic02.c2
-rw-r--r--drivers/char/tty_io.c3
-rw-r--r--drivers/char/vme_scc.c2
-rw-r--r--drivers/char/vt.c2
-rw-r--r--drivers/char/wd501p.h2
-rw-r--r--drivers/char/wdt.c2
-rw-r--r--drivers/char/wdt_pci.c2
96 files changed, 496 insertions, 263 deletions
diff --git a/drivers/char/Config.in b/drivers/char/Config.in
index c62f1a38e..21935083b 100644
--- a/drivers/char/Config.in
+++ b/drivers/char/Config.in
@@ -183,7 +183,7 @@ if [ "$CONFIG_AGP" != "n" ]; then
bool ' VIA chipset support' CONFIG_AGP_VIA
bool ' AMD Irongate support' CONFIG_AGP_AMD
bool ' Generic SiS support' CONFIG_AGP_SIS
- bool ' ALI M1541 support' CONFIG_AGP_ALI
+ bool ' ALI chipset support' CONFIG_AGP_ALI
fi
source drivers/char/drm/Config.in
diff --git a/drivers/char/README.computone b/drivers/char/README.computone
index cd0969213..ba41840b9 100644
--- a/drivers/char/README.computone
+++ b/drivers/char/README.computone
@@ -92,7 +92,7 @@ Previously, the driver sources were packaged with a set of patch files
to update the character drivers' makefile and configuration file, and other
kernel source files. A build script (ip2build) was included which applies
the patches if needed, and build any utilities needed.
-What you recieve may be a single patch file in conventional kernel
+What you receive may be a single patch file in conventional kernel
patch format build script. That form can also be applied by
running patch -p1 < ThePatchFile. Otherwise the drivers source may be
a tar file, then untar and run ip2build if a new installation.
diff --git a/drivers/char/README.epca b/drivers/char/README.epca
index 83dadc4ce..77c388693 100644
--- a/drivers/char/README.epca
+++ b/drivers/char/README.epca
@@ -319,7 +319,7 @@ Description (Verbose) : Made the following modifications:
1. Removed code from pc_close which closes the
drivers line discipline and restores its original
- line discipline. This is currently unecessary,
+ line discipline. This is currently unnecessary,
though future fast cook enhancements may require
this.
diff --git a/drivers/char/acquirewdt.c b/drivers/char/acquirewdt.c
index 272296b69..a58e43e86 100644
--- a/drivers/char/acquirewdt.c
+++ b/drivers/char/acquirewdt.c
@@ -28,7 +28,7 @@
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index 33743376a..b48f53bc1 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -117,6 +117,8 @@ struct agp_bridge_data {
int (*remove_memory) (agp_memory *, off_t, int);
agp_memory *(*alloc_by_type) (size_t, int);
void (*free_by_type) (agp_memory *);
+ unsigned long (*agp_alloc_page) (void);
+ void (*agp_destroy_page) (unsigned long);
};
#define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr))
@@ -203,6 +205,24 @@ struct agp_bridge_data {
#ifndef PCI_DEVICE_ID_AL_M1541_0
#define PCI_DEVICE_ID_AL_M1541_0 0x1541
#endif
+#ifndef PCI_DEVICE_ID_AL_M1621_0
+#define PCI_DEVICE_ID_AL_M1621_0 0x1621
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1631_0
+#define PCI_DEVICE_ID_AL_M1631_0 0x1631
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1632_0
+#define PCI_DEVICE_ID_AL_M1632_0 0x1632
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1641_0
+#define PCI_DEVICE_ID_AL_M1641_0 0x1641
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1647_0
+#define PCI_DEVICE_ID_AL_M1647_0 0x1647
+#endif
+#ifndef PCI_DEVICE_ID_AL_M1651_0
+#define PCI_DEVICE_ID_AL_M1651_0 0x1651
+#endif
/* intel register */
#define INTEL_APBASE 0x10
@@ -267,5 +287,9 @@ struct agp_bridge_data {
#define ALI_AGPCTRL 0xb8
#define ALI_ATTBASE 0xbc
#define ALI_TLBCTRL 0xc0
+#define ALI_TAGCTRL 0xc4
+#define ALI_CACHE_FLUSH_CTRL 0xD0
+#define ALI_CACHE_FLUSH_ADDR_MASK 0xFFFFF000
+#define ALI_CACHE_FLUSH_EN 0x100
#endif /* _AGP_BACKEND_PRIV_H */
diff --git a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c
index ccd53dacc..bf8371676 100644
--- a/drivers/char/agp/agpgart_be.c
+++ b/drivers/char/agp/agpgart_be.c
@@ -32,7 +32,7 @@
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/pci.h>
#include <linux/init.h>
@@ -133,45 +133,6 @@ void agp_backend_release(void)
}
/*
- * Basic Page Allocation Routines -
- * These routines handle page allocation
- * and by default they reserve the allocated
- * memory. They also handle incrementing the
- * current_memory_agp value, Which is checked
- * against a maximum value.
- */
-
-static unsigned long agp_alloc_page(void)
-{
- void *pt;
-
- pt = (void *) __get_free_page(GFP_KERNEL);
- if (pt == NULL) {
- return 0;
- }
- atomic_inc(&virt_to_page(pt)->count);
- set_bit(PG_locked, &virt_to_page(pt)->flags);
- atomic_inc(&agp_bridge.current_memory_agp);
- return (unsigned long) pt;
-}
-
-static void agp_destroy_page(unsigned long page)
-{
- void *pt = (void *) page;
-
- if (pt == NULL) {
- return;
- }
- atomic_dec(&virt_to_page(pt)->count);
- clear_bit(PG_locked, &virt_to_page(pt)->flags);
- wake_up(&virt_to_page(pt)->wait);
- free_page((unsigned long) pt);
- atomic_dec(&agp_bridge.current_memory_agp);
-}
-
-/* End Basic Page Allocation Routines */
-
-/*
* Generic routines for handling agp_memory structures -
* They use the basic page allocation routines to do the
* brunt of the work.
@@ -245,7 +206,7 @@ void agp_free_memory(agp_memory * curr)
if (curr->page_count != 0) {
for (i = 0; i < curr->page_count; i++) {
curr->memory[i] &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(curr->memory[i]));
}
}
@@ -290,7 +251,7 @@ agp_memory *agp_allocate_memory(size_t page_count, u32 type)
return NULL;
}
for (i = 0; i < page_count; i++) {
- new->memory[i] = agp_alloc_page();
+ new->memory[i] = agp_bridge.agp_alloc_page();
if (new->memory[i] == 0) {
/* Free this structure */
@@ -803,6 +764,45 @@ static void agp_generic_free_by_type(agp_memory * curr)
kfree(curr);
}
+/*
+ * Basic Page Allocation Routines -
+ * These routines handle page allocation
+ * and by default they reserve the allocated
+ * memory. They also handle incrementing the
+ * current_memory_agp value, Which is checked
+ * against a maximum value.
+ */
+
+static unsigned long agp_generic_alloc_page(void)
+{
+ void *pt;
+
+ pt = (void *) __get_free_page(GFP_KERNEL);
+ if (pt == NULL) {
+ return 0;
+ }
+ atomic_inc(&virt_to_page(pt)->count);
+ set_bit(PG_locked, &virt_to_page(pt)->flags);
+ atomic_inc(&agp_bridge.current_memory_agp);
+ return (unsigned long) pt;
+}
+
+static void agp_generic_destroy_page(unsigned long page)
+{
+ void *pt = (void *) page;
+
+ if (pt == NULL) {
+ return;
+ }
+ atomic_dec(&virt_to_page(pt)->count);
+ clear_bit(PG_locked, &virt_to_page(pt)->flags);
+ wake_up(&virt_to_page(pt)->wait);
+ free_page((unsigned long) pt);
+ atomic_dec(&agp_bridge.current_memory_agp);
+}
+
+/* End Basic Page Allocation Routines */
+
void agp_enable(u32 mode)
{
if (agp_bridge.type == NOT_SUPPORTED) return;
@@ -1018,7 +1018,7 @@ static agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
return NULL;
}
MOD_INC_USE_COUNT;
- new->memory[0] = agp_alloc_page();
+ new->memory[0] = agp_bridge.agp_alloc_page();
if (new->memory[0] == 0) {
/* Free this structure */
@@ -1043,7 +1043,7 @@ static void intel_i810_free_by_type(agp_memory * curr)
{
agp_free_key(curr->key);
if(curr->type == AGP_PHYS_MEMORY) {
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(curr->memory[0]));
vfree(curr->memory);
}
@@ -1081,6 +1081,8 @@ static int __init intel_i810_setup(struct pci_dev *i810_dev)
agp_bridge.remove_memory = intel_i810_remove_entries;
agp_bridge.alloc_by_type = intel_i810_alloc_by_type;
agp_bridge.free_by_type = intel_i810_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
}
@@ -1271,6 +1273,8 @@ static int __init intel_generic_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1299,6 +1303,8 @@ static int __init intel_840_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1327,6 +1333,8 @@ static int __init intel_850_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1442,6 +1450,8 @@ static int __init via_generic_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1551,6 +1561,8 @@ static int __init sis_generic_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
}
@@ -1924,6 +1936,8 @@ static int __init amd_irongate_setup (struct pci_dev *pdev)
agp_bridge.remove_memory = amd_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
return 0;
@@ -1961,10 +1975,9 @@ static void ali_tlbflush(agp_memory * mem)
u32 temp;
pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000090));
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000010));
+// clear tag
+ pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL,
+ ((temp & 0xfffffff0) | 0x00000001|0x00000002));
}
static void ali_cleanup(void)
@@ -1975,10 +1988,13 @@ static void ali_cleanup(void)
previous_size = A_SIZE_32(agp_bridge.previous_size);
pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000090));
+// clear tag
+ pci_write_config_dword(agp_bridge.dev, ALI_TAGCTRL,
+ ((temp & 0xffffff00) | 0x00000001|0x00000002));
+
+ pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp);
pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE,
- previous_size->size_value);
+ ((temp & 0x00000ff0) | previous_size->size_value));
}
static int ali_configure(void)
@@ -1989,17 +2005,62 @@ static int ali_configure(void)
current_size = A_SIZE_32(agp_bridge.current_size);
/* aperture size and gatt addr */
- pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE,
- agp_bridge.gatt_bus_addr | current_size->size_value);
+ pci_read_config_dword(agp_bridge.dev, ALI_ATTBASE, &temp);
+ temp = (((temp & 0x00000ff0) | (agp_bridge.gatt_bus_addr & 0xfffff000))
+ | (current_size->size_value & 0xf));
+ pci_write_config_dword(agp_bridge.dev, ALI_ATTBASE, temp);
/* tlb control */
- pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
- pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
- ((temp & 0xffffff00) | 0x00000010));
+
+ /*
+ * Question: Jeff, ALi's patch deletes this:
+ *
+ * pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
+ * pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL,
+ * ((temp & 0xffffff00) | 0x00000010));
+ *
+ * and replaces it with the following, which seems to duplicate the
+ * next couple of lines below it. I suspect this was an oversight,
+ * but you might want to check up on this?
+ */
+
+ pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp);
+ agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* address to map to */
pci_read_config_dword(agp_bridge.dev, ALI_APBASE, &temp);
agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+
+#if 0
+ if (agp_bridge.type == ALI_M1541) {
+ u32 nlvm_addr = 0;
+
+ switch (current_size->size_value) {
+ case 0: break;
+ case 1: nlvm_addr = 0x100000;break;
+ case 2: nlvm_addr = 0x200000;break;
+ case 3: nlvm_addr = 0x400000;break;
+ case 4: nlvm_addr = 0x800000;break;
+ case 6: nlvm_addr = 0x1000000;break;
+ case 7: nlvm_addr = 0x2000000;break;
+ case 8: nlvm_addr = 0x4000000;break;
+ case 9: nlvm_addr = 0x8000000;break;
+ case 10: nlvm_addr = 0x10000000;break;
+ default: break;
+ }
+ nlvm_addr--;
+ nlvm_addr&=0xfff00000;
+
+ nlvm_addr+= agp_bridge.gart_bus_addr;
+ nlvm_addr|=(agp_bridge.gart_bus_addr>>12);
+ printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr);
+ }
+#endif
+
+ pci_read_config_dword(agp_bridge.dev, ALI_TLBCTRL, &temp);
+ temp &= 0xffffff7f; //enable TLB
+ pci_write_config_dword(agp_bridge.dev, ALI_TLBCTRL, temp);
+
return 0;
}
@@ -2010,6 +2071,74 @@ static unsigned long ali_mask_memory(unsigned long addr, int type)
return addr | agp_bridge.masks[0].mask;
}
+static void ali_cache_flush(void)
+{
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ int i, page_count;
+ u32 temp;
+
+ page_count = 1 << A_SIZE_32(agp_bridge.current_size)->page_order;
+ for (i = 0; i < PAGE_SIZE * page_count; i += PAGE_SIZE) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ (agp_bridge.gatt_bus_addr + i)) |
+ ALI_CACHE_FLUSH_EN));
+ }
+ }
+}
+
+static unsigned long ali_alloc_page(void)
+{
+ void *pt;
+ u32 temp;
+
+ pt = (void *) __get_free_page(GFP_KERNEL);
+ if (pt == NULL)
+ return 0;
+
+ atomic_inc(&virt_to_page(pt)->count);
+ set_bit(PG_locked, &virt_to_page(pt)->flags);
+ atomic_inc(&agp_bridge.current_memory_agp);
+
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ virt_to_phys((void *)pt)) |
+ ALI_CACHE_FLUSH_EN ));
+ }
+ return (unsigned long) pt;
+}
+
+static void ali_destroy_page(unsigned long page)
+{
+ u32 temp;
+ void *pt = (void *) page;
+
+ if (pt == NULL)
+ return;
+
+ global_cache_flush();
+
+ if (agp_bridge.type == ALI_M1541) {
+ pci_read_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, ALI_CACHE_FLUSH_CTRL,
+ (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
+ virt_to_phys((void *)pt)) |
+ ALI_CACHE_FLUSH_EN));
+ }
+
+ atomic_dec(&virt_to_page(pt)->count);
+ clear_bit(PG_locked, &virt_to_page(pt)->flags);
+ wake_up(&virt_to_page(pt)->wait);
+ free_page((unsigned long) pt);
+ atomic_dec(&agp_bridge.current_memory_agp);
+}
/* Setup function */
static gatt_mask ali_generic_masks[] =
@@ -2043,13 +2172,15 @@ static int __init ali_generic_setup (struct pci_dev *pdev)
agp_bridge.tlb_flush = ali_tlbflush;
agp_bridge.mask_memory = ali_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_enable;
- agp_bridge.cache_flush = global_cache_flush;
+ agp_bridge.cache_flush = ali_cache_flush;
agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
agp_bridge.insert_memory = agp_generic_insert_memory;
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = ali_alloc_page;
+ agp_bridge.agp_destroy_page = ali_destroy_page;
return 0;
@@ -2078,6 +2209,42 @@ static struct {
"Ali",
"M1541",
ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1621_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1621,
+ "Ali",
+ "M1621",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1631_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1631,
+ "Ali",
+ "M1631",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1632_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1632,
+ "Ali",
+ "M1632",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1641_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1641,
+ "Ali",
+ "M1641",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1647_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1647,
+ "Ali",
+ "M1647",
+ ali_generic_setup },
+ { PCI_DEVICE_ID_AL_M1651_0,
+ PCI_VENDOR_ID_AL,
+ ALI_M1651,
+ "Ali",
+ "M1651",
+ ali_generic_setup },
{ 0,
PCI_VENDOR_ID_AL,
ALI_GENERIC,
@@ -2270,6 +2437,35 @@ static int __init agp_lookup_host_bridge (struct pci_dev *pdev)
while ((i < ARRAY_SIZE (agp_bridge_info)) &&
(agp_bridge_info[i].vendor_id == pdev->vendor)) {
if (pdev->device == agp_bridge_info[i].device_id) {
+#ifdef CONFIG_AGP_ALI
+ if (pdev->device == PCI_DEVICE_ID_AL_M1621_0) {
+ u8 hidden_1621_id;
+
+ pci_read_config_byte(pdev, 0xFB, &hidden_1621_id);
+ switch (hidden_1621_id) {
+ case 0x31:
+ agp_bridge_info[i].chipset_name="M1631";
+ break;
+ case 0x32:
+ agp_bridge_info[i].chipset_name="M1632";
+ break;
+ case 0x41:
+ agp_bridge_info[i].chipset_name="M1641";
+ break;
+ case 0x43:
+ break;
+ case 0x47:
+ agp_bridge_info[i].chipset_name="M1647";
+ break;
+ case 0x51:
+ agp_bridge_info[i].chipset_name="M1651";
+ break;
+ default:
+ break;
+ }
+ }
+#endif
+
printk (KERN_INFO PFX "Detected %s %s chipset\n",
agp_bridge_info[i].vendor_name,
agp_bridge_info[i].chipset_name);
@@ -2375,9 +2571,8 @@ static int __init agp_find_supported_device(void)
if (i810_dev == NULL) {
printk(KERN_ERR PFX "agpgart: Detected an "
"Intel i815, but could not find the"
- " secondary device.\n"
- "Assuming user has added an external AGP"
- " card\n");
+ " secondary device. Assuming a "
+ "non-integrated video card.\n");
break;
}
printk(KERN_INFO PFX "agpgart: Detected an Intel i815 "
@@ -2486,7 +2681,7 @@ static int __init agp_backend_initialize(void)
}
if (agp_bridge.needs_scratch_page == TRUE) {
- agp_bridge.scratch_page = agp_alloc_page();
+ agp_bridge.scratch_page = agp_bridge.agp_alloc_page();
if (agp_bridge.scratch_page == 0) {
printk(KERN_ERR PFX "unable to get memory for "
@@ -2539,7 +2734,7 @@ static int __init agp_backend_initialize(void)
err_out:
if (agp_bridge.needs_scratch_page == TRUE) {
agp_bridge.scratch_page &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(agp_bridge.scratch_page));
}
if (got_gatt)
@@ -2559,7 +2754,7 @@ static void agp_backend_cleanup(void)
if (agp_bridge.needs_scratch_page == TRUE) {
agp_bridge.scratch_page &= ~(0x00000fff);
- agp_destroy_page((unsigned long)
+ agp_bridge.agp_destroy_page((unsigned long)
phys_to_virt(agp_bridge.scratch_page));
}
}
diff --git a/drivers/char/agp/agpgart_fe.c b/drivers/char/agp/agpgart_fe.c
index d16c62a22..59f505b96 100644
--- a/drivers/char/agp/agpgart_fe.c
+++ b/drivers/char/agp/agpgart_fe.c
@@ -33,7 +33,7 @@
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/pci.h>
#include <linux/init.h>
@@ -1105,7 +1105,7 @@ int __init agp_frontend_initialize(void)
return 0;
}
-void __exit agp_frontend_cleanup(void)
+static void __exit agp_frontend_cleanup(void)
{
misc_deregister(&agp_miscdev);
}
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index fdcfe7805..c5527a83c 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -59,9 +59,6 @@
* End of serial driver configuration section.
*/
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
#include <linux/module.h>
#include <linux/types.h>
@@ -85,7 +82,7 @@ static char *serial_version = "4.30";
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/delay.h>
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 63f26cc0f..2b3f282d0 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -22,7 +22,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <asm/errno.h>
#include <asm/io.h>
#include <asm/uaccess.h>
diff --git a/drivers/char/busmouse.c b/drivers/char/busmouse.c
index 9a983bb3e..fb016439c 100644
--- a/drivers/char/busmouse.c
+++ b/drivers/char/busmouse.c
@@ -12,7 +12,7 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/poll.h>
diff --git a/drivers/char/cd1865.h b/drivers/char/cd1865.h
index 993af327f..8304460ef 100644
--- a/drivers/char/cd1865.h
+++ b/drivers/char/cd1865.h
@@ -56,7 +56,7 @@
#define CD186x_EOIR 0x7f /* End of Interrupt Register */
#define CD186x_MRAR 0x75 /* Modem Request Acknowlege register */
#define CD186x_TRAR 0x76 /* Transmit Request Acknowlege register */
-#define CD186x_RRAR 0x77 /* Recieve Request Acknowlege register */
+#define CD186x_RRAR 0x77 /* Receive Request Acknowlege register */
#define CD186x_SRCR 0x66 /* Service Request Configuration register */
/* Channel Registers */
diff --git a/drivers/char/console.c b/drivers/char/console.c
index 0285eab79..2697cf5a6 100644
--- a/drivers/char/console.c
+++ b/drivers/char/console.c
@@ -79,7 +79,7 @@
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/major.h>
#include <linux/mm.h>
#include <linux/console.h>
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c
index 272074936..bf55df922 100644
--- a/drivers/char/consolemap.c
+++ b/drivers/char/consolemap.c
@@ -14,8 +14,9 @@
#include <linux/kd.h>
#include <linux/errno.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
+#include <linux/tty.h>
#include <asm/uaccess.h>
#include <linux/consolemap.h>
#include <linux/console_struct.h>
diff --git a/drivers/char/drm/Makefile b/drivers/char/drm/Makefile
index 41017340b..6af6e509c 100644
--- a/drivers/char/drm/Makefile
+++ b/drivers/char/drm/Makefile
@@ -10,7 +10,7 @@ O_TARGET := drm.o
module-list := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
export-objs := $(patsubst %.o,%_drv.o,$(module-list))
-# libs-objs are included in every module so that radical changes to the
+# lib-objs are included in every module so that radical changes to the
# architecture of the DRM support library can be made at a later time.
#
# The downside is that each module is larger, and a system that uses
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 535566b63..7de536f77 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -25,7 +25,7 @@
#include <linux/module.h>
#include <linux/version.h>
-#include <linux/malloc.h> /* for kmalloc() and kfree() */
+#include <linux/slab.h> /* for kmalloc() and kfree() */
#include <linux/sched.h> /* for struct wait_queue etc */
#include <linux/major.h>
#include <linux/types.h>
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 76c2ab201..e24f0ce84 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -47,10 +47,6 @@
*/
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
-
#include <linux/module.h>
#include <linux/version.h>
diff --git a/drivers/char/dz.c b/drivers/char/dz.c
index 9c0afa2c6..a97d8a694 100644
--- a/drivers/char/dz.c
+++ b/drivers/char/dz.c
@@ -33,7 +33,7 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/major.h>
#include <linux/param.h>
@@ -230,7 +230,7 @@ static inline void receive_chars (struct dz_serial *info_in)
ch = UCHAR(status); /* grab the char */
-#ifdef 0
+#if 0
if (info->is_console) {
if (ch == 0) return; /* it's a break ... */
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index d6dbd82a5..2757e5559 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -2216,7 +2216,7 @@ static void epcapoll(unsigned long ignored)
/* -------------------------------------------------------------------
This routine is called upon every timer interrupt. Even though
- the Digi series cards are capable of generating interupts this
+ the Digi series cards are capable of generating interrupts this
method of non-looping polling is more efficient. This routine
checks for card generated events (Such as receive data, are transmit
buffer empty) and acts on those events.
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 6e575c3dd..f51931220 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -61,7 +61,7 @@
#include <asm/bitops.h>
#include <asm/dma.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <asm/uaccess.h>
#include <linux/hayesesp.h>
diff --git a/drivers/char/ftape/lowlevel/fdc-isr.c b/drivers/char/ftape/lowlevel/fdc-isr.c
index 3fdae227e..bf85f725e 100644
--- a/drivers/char/ftape/lowlevel/fdc-isr.c
+++ b/drivers/char/ftape/lowlevel/fdc-isr.c
@@ -81,7 +81,7 @@ static void print_error_cause(int cause)
case overrun_error:
TRACE(ft_t_noise, "overrun error");
break;
- default:
+ default:;
}
TRACE_EXIT;
}
@@ -184,7 +184,7 @@ static void update_history(error_cause cause)
case no_data_error:
ft_history.no_data_errors++;
break;
- default:
+ default:;
}
}
@@ -237,7 +237,7 @@ static void print_progress(buffer_struct *buff, error_cause cause)
switch (cause) {
case no_error:
- TRACE(ft_t_flow,"%d Sector(s) transfered", buff->sector_count);
+ TRACE(ft_t_flow,"%d Sector(s) transferred", buff->sector_count);
break;
case no_data_error:
TRACE(ft_t_flow, "Sector %d not found",
diff --git a/drivers/char/ftape/lowlevel/ftape-buffer.c b/drivers/char/ftape/lowlevel/ftape-buffer.c
index 02fe29dac..a18b86817 100644
--- a/drivers/char/ftape/lowlevel/ftape-buffer.c
+++ b/drivers/char/ftape/lowlevel/ftape-buffer.c
@@ -25,7 +25,7 @@
*/
#include <asm/segment.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/wrapper.h>
diff --git a/drivers/char/ftape/zftape/zftape-buffers.c b/drivers/char/ftape/zftape/zftape-buffers.c
index f3dace343..58197e429 100644
--- a/drivers/char/ftape/zftape/zftape-buffers.c
+++ b/drivers/char/ftape/zftape/zftape-buffers.c
@@ -26,7 +26,7 @@
#include <linux/errno.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <asm/segment.h>
#include <linux/zftape.h>
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index a57e3abc1..1f8e4edaa 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -29,7 +29,7 @@
#include <linux/kernel.h>
#include <linux/signal.h>
#include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
diff --git a/drivers/char/ftape/zftape/zftape-vtbl.c b/drivers/char/ftape/zftape/zftape-vtbl.c
index e4804ea2e..aa64ca7d1 100644
--- a/drivers/char/ftape/zftape/zftape-vtbl.c
+++ b/drivers/char/ftape/zftape/zftape-vtbl.c
@@ -30,7 +30,7 @@
#include <linux/errno.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <asm/segment.h>
#include <linux/zftape.h>
diff --git a/drivers/char/i810_rng.c b/drivers/char/i810_rng.c
index 422054ece..79dc5d56d 100644
--- a/drivers/char/i810_rng.c
+++ b/drivers/char/i810_rng.c
@@ -4,7 +4,7 @@
Copyright 2000 Jeff Garzik <jgarzik@mandrakesoft.com>
Copyright 2000 Philipp Rumpf <prumpf@tux.org>
- Driver Web site: http://gtf.org/garzik/drivers/i810_rng/
+ Driver Web site: http://sourceforge.net/projects/gkernel/
@@ -26,7 +26,7 @@
----------------------------------------------------------
This software may be used and distributed according to the terms
- of the GNU Public License, incorporated herein by reference.
+ of the GNU General Public License, incorporated herein by reference.
----------------------------------------------------------
diff --git a/drivers/char/ip2.c b/drivers/char/ip2.c
index 600aea60a..ac2f896e5 100644
--- a/drivers/char/ip2.c
+++ b/drivers/char/ip2.c
@@ -29,12 +29,6 @@ int
ip2_loadmain(int *, int *, unsigned char *, int ); // ref into ip2main.c
#ifdef MODULE
-#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
-# define MODVERSIONS
-#endif
-#ifdef MODVERSIONS
-# include <linux/modversions.h>
-#endif
static int io[IP2_MAX_BOARDS]= { 0,};
static int irq[IP2_MAX_BOARDS] = { 0,};
diff --git a/drivers/char/ip2/i2hw.h b/drivers/char/ip2/i2hw.h
index 9e5b07ca0..15fe04e74 100644
--- a/drivers/char/ip2/i2hw.h
+++ b/drivers/char/ip2/i2hw.h
@@ -143,7 +143,7 @@ registers, use byte operations only.
//
#define FIFO_DATA 0
-// Another way of passing information between the the board and the host is
+// Another way of passing information between the board and the host is
// through "mailboxes". Unlike a FIFO, a mailbox holds only a single byte of
// data. Writing data to the mailbox causes a status bit to be set, and
// potentially interrupting the intended receiver. The sender has some way to
diff --git a/drivers/char/ip2/i2lib.h b/drivers/char/ip2/i2lib.h
index 8e3f707d3..2a92b4391 100644
--- a/drivers/char/ip2/i2lib.h
+++ b/drivers/char/ip2/i2lib.h
@@ -150,7 +150,7 @@ typedef struct _i2ChanStr
// though these are in the channel structure, the channel is also written
// here, the easier to send it to the fifo when ready. HOWEVER, individual
// packets here are NOT padded to even length: the routines for writing
- // blocks to the the fifo will pad to even byte counts.
+ // blocks to the fifo will pad to even byte counts.
//
UCHAR Obuf[OBUF_SIZE+MAX_OBUF_BLOCK+4];
volatile
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index a5e3adca6..2c662907d 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -50,14 +50,6 @@
/************/
#include <linux/config.h>
// Uncomment the following if you want it compiled with modversions
-#ifdef MODULE
-# if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
-# define MODVERSIONS
-# endif
-# ifdef MODVERSIONS
-# include <linux/modversions.h>
-# endif
-#endif
#include <linux/version.h>
@@ -75,7 +67,7 @@
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/major.h>
#include <linux/wait.h>
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index bd6caa775..ea4686691 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -28,8 +28,9 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/interrupt.h>
+#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/cdk.h>
diff --git a/drivers/char/joystick/a3d.c b/drivers/char/joystick/a3d.c
index bd17f8de2..09642a9e7 100644
--- a/drivers/char/joystick/a3d.c
+++ b/drivers/char/joystick/a3d.c
@@ -32,7 +32,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/gameport.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/adi.c b/drivers/char/joystick/adi.c
index a2f68d74e..5bdf269fc 100644
--- a/drivers/char/joystick/adi.c
+++ b/drivers/char/joystick/adi.c
@@ -34,7 +34,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/input.h>
#include <linux/gameport.h>
#include <linux/init.h>
diff --git a/drivers/char/joystick/amijoy.c b/drivers/char/joystick/amijoy.c
index 452d173d7..2d9ca4ffe 100644
--- a/drivers/char/joystick/amijoy.c
+++ b/drivers/char/joystick/amijoy.c
@@ -113,7 +113,7 @@ static int __init amijoy_init(void)
for (i = 0; i < 2; i++)
if (amijoy[i]) {
if (!request_mem_region(CUSTOM_PHYSADDR+10+i*2, 2,
- amijoy [Denise]")) {
+ "amijoy [Denise]")) {
if (i == 1 && amijoy[0]) {
input_unregister_device(amijoy_dev);
release_mem_region(CUSTOM_PHYSADDR+10, 2);
diff --git a/drivers/char/joystick/analog.c b/drivers/char/joystick/analog.c
index dbd46fb7e..a9f5a0b0d 100644
--- a/drivers/char/joystick/analog.c
+++ b/drivers/char/joystick/analog.c
@@ -34,7 +34,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/cobra.c b/drivers/char/joystick/cobra.c
index f059a2ff6..d71ac96ac 100644
--- a/drivers/char/joystick/cobra.c
+++ b/drivers/char/joystick/cobra.c
@@ -32,7 +32,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/gameport.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/gameport.c b/drivers/char/joystick/gameport.c
index 15ef908a6..d3cb6422e 100644
--- a/drivers/char/joystick/gameport.c
+++ b/drivers/char/joystick/gameport.c
@@ -35,7 +35,7 @@
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/isapnp.h>
#include <linux/stddef.h>
#include <linux/delay.h>
diff --git a/drivers/char/joystick/gf2k.c b/drivers/char/joystick/gf2k.c
index cad8be16b..5ec0e7f6d 100644
--- a/drivers/char/joystick/gf2k.c
+++ b/drivers/char/joystick/gf2k.c
@@ -32,7 +32,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/grip.c b/drivers/char/joystick/grip.c
index 4cedd7892..3d9742b33 100644
--- a/drivers/char/joystick/grip.c
+++ b/drivers/char/joystick/grip.c
@@ -33,7 +33,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/gameport.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/iforce.c b/drivers/char/joystick/iforce.c
index af8adaed1..124edb321 100644
--- a/drivers/char/joystick/iforce.c
+++ b/drivers/char/joystick/iforce.c
@@ -29,7 +29,7 @@
*/
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/init.h>
diff --git a/drivers/char/joystick/interact.c b/drivers/char/joystick/interact.c
index 7104e5d49..267122804 100644
--- a/drivers/char/joystick/interact.c
+++ b/drivers/char/joystick/interact.c
@@ -34,7 +34,7 @@
*/
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
diff --git a/drivers/char/joystick/lightning.c b/drivers/char/joystick/lightning.c
index 69dfd1112..c05c90021 100644
--- a/drivers/char/joystick/lightning.c
+++ b/drivers/char/joystick/lightning.c
@@ -38,7 +38,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#define L4_PORT 0x201
#define L4_SELECT_ANALOG 0xa4
diff --git a/drivers/char/joystick/magellan.c b/drivers/char/joystick/magellan.c
index e8c77f48e..2867a3a18 100644
--- a/drivers/char/joystick/magellan.c
+++ b/drivers/char/joystick/magellan.c
@@ -32,7 +32,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/init.h>
diff --git a/drivers/char/joystick/ns558.c b/drivers/char/joystick/ns558.c
index 36c5d9f9e..a4b26a083 100644
--- a/drivers/char/joystick/ns558.c
+++ b/drivers/char/joystick/ns558.c
@@ -38,7 +38,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/isapnp.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
diff --git a/drivers/char/joystick/serport.c b/drivers/char/joystick/serport.c
index 453e674d7..14c6537aa 100644
--- a/drivers/char/joystick/serport.c
+++ b/drivers/char/joystick/serport.c
@@ -33,7 +33,7 @@
#include <asm/uaccess.h>
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/serio.h>
diff --git a/drivers/char/joystick/sidewinder.c b/drivers/char/joystick/sidewinder.c
index ae31265cb..1ba412305 100644
--- a/drivers/char/joystick/sidewinder.c
+++ b/drivers/char/joystick/sidewinder.c
@@ -33,7 +33,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/gameport.h>
diff --git a/drivers/char/joystick/spaceball.c b/drivers/char/joystick/spaceball.c
index 8e2936f73..e6aa5f094 100644
--- a/drivers/char/joystick/spaceball.c
+++ b/drivers/char/joystick/spaceball.c
@@ -35,7 +35,7 @@
*/
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/spaceorb.c b/drivers/char/joystick/spaceorb.c
index 866e1ba50..4c595fdce 100644
--- a/drivers/char/joystick/spaceorb.c
+++ b/drivers/char/joystick/spaceorb.c
@@ -34,7 +34,7 @@
*/
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
diff --git a/drivers/char/joystick/tmdc.c b/drivers/char/joystick/tmdc.c
index f356f7dd5..611ae962a 100644
--- a/drivers/char/joystick/tmdc.c
+++ b/drivers/char/joystick/tmdc.c
@@ -36,7 +36,7 @@
#include <linux/delay.h>
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gameport.h>
diff --git a/drivers/char/joystick/warrior.c b/drivers/char/joystick/warrior.c
index 7000b8560..d84f2950e 100644
--- a/drivers/char/joystick/warrior.c
+++ b/drivers/char/joystick/warrior.c
@@ -32,7 +32,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/init.h>
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 97f99de1c..1c8f76630 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -121,7 +121,7 @@
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/fcntl.h>
#include <linux/delay.h>
#include <linux/poll.h>
@@ -222,6 +222,21 @@ static int lp_check_status(int minor)
return error;
}
+static int lp_wait_ready(int minor)
+{
+ int error = 0;
+ do {
+ error = lp_check_status (minor);
+ if (error && (LP_F(minor) & LP_ABORT))
+ break;
+ if (signal_pending (current)) {
+ error = -EINTR;
+ break;
+ }
+ } while (error);
+ return error;
+}
+
static ssize_t lp_write(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
@@ -259,7 +274,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
parport_set_timeout (lp_table[minor].dev,
lp_table[minor].timeout);
- if ((retv = lp_check_status (minor)) == 0)
+ if ((retv = lp_wait_ready (minor)) == 0)
do {
/* Write the data. */
written = parport_write (port, kbuf, copy_size);
@@ -279,9 +294,9 @@ static ssize_t lp_write(struct file * file, const char * buf,
if (copy_size > 0) {
/* incomplete write -> check error ! */
- int error = lp_check_status (minor);
+ int error = lp_wait_ready (minor);
- if (LP_F(minor) & LP_ABORT) {
+ if (error) {
if (retv == 0)
retv = error;
break;
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 0f67f6e8b..d0c5eefe3 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -13,12 +13,13 @@
#include <linux/miscdevice.h>
#include <linux/tpqic02.h>
#include <linux/ftape.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/mman.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/raw.h>
+#include <linux/tty.h>
#include <linux/capability.h>
#include <asm/uaccess.h>
@@ -28,9 +29,6 @@
#ifdef CONFIG_I2C
extern int i2c_init_all(void);
#endif
-#ifdef CONFIG_ISDN
-int isdn_init(void);
-#endif
#ifdef CONFIG_VIDEO_DEV
extern int videodev_init(void);
#endif
@@ -157,9 +155,6 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;
#elif defined(__mips__)
prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
-#elif defined(__arm__) && defined(CONFIG_CPU_32)
- /* Turn off caching for all I/O areas */
- prot &= ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE);
#endif
return __pgprot(prot);
@@ -646,9 +641,6 @@ int __init chr_dev_init(void)
#if CONFIG_QIC02_TAPE
qic02_tape_init();
#endif
-#if CONFIG_ISDN
- isdn_init();
-#endif
#ifdef CONFIG_FTAPE
ftape_init();
#endif
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index e4edb9f07..8dc9ef350 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -41,7 +41,7 @@
#include <linux/miscdevice.h>
#include <linux/kernel.h>
#include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/stat.h>
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 3427c1421..130d53301 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -96,7 +96,7 @@
#include <linux/poll.h>
#include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h> /* used in new tty drivers */
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 8a825753a..215988d59 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -51,7 +51,7 @@
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h> /* used in new tty drivers */
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index c2ae319af..66124475a 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -38,7 +38,7 @@
#include <linux/kd.h>
#include <linux/mm.h>
#include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/poll.h>
#include <asm/uaccess.h>
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index bd7efe846..1086559df 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -94,7 +94,7 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/mc146818rtc.h>
@@ -481,7 +481,8 @@ static void pc_set_checksum( void )
#ifdef CONFIG_PROC_FS
static char *floppy_types[] = {
- "none", "5.25'' 360k", "5.25'' 1.2M", "3.5'' 720k", "3.5'' 1.44M", "3.5'' 2.88M"
+ "none", "5.25'' 360k", "5.25'' 1.2M", "3.5'' 720k", "3.5'' 1.44M",
+ "3.5'' 2.88M", "3.5'' 2.88M"
};
static char *gfx_types[] = {
diff --git a/drivers/char/pc110pad.c b/drivers/char/pc110pad.c
index 862994025..9ac3b4abb 100644
--- a/drivers/char/pc110pad.c
+++ b/drivers/char/pc110pad.c
@@ -42,6 +42,7 @@
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/smp_lock.h>
+#include <linux/init.h>
#include <asm/signal.h>
#include <asm/io.h>
@@ -54,14 +55,13 @@
static struct pc110pad_params default_params = {
- PC110PAD_PS2, /* read mode */
- 50 MS, /* bounce interval */
- 200 MS, /* tap interval */
- 10, /* IRQ */
- 0x15E0, /* I/O port */
+ mode: PC110PAD_PS2,
+ bounce_interval: 50 MS,
+ tap_interval: 200 MS,
+ irq: 10,
+ io: 0x15E0,
};
-
static struct pc110pad_params current_params;
@@ -134,7 +134,7 @@ static void tap_timeout(unsigned long data)
{
if(!recent_transition)
{
- printk("pc110pad: tap_timeout but no recent transition!\n");
+ printk(KERN_ERR "pc110pad: tap_timeout but no recent transition!\n");
}
if( transition_count==2 || transition_count==4 || transition_count==6 )
{
@@ -783,73 +783,60 @@ static struct file_operations pad_fops = {
static struct miscdevice pc110_pad = {
- PC110PAD_MINOR, "pc110 pad", &pad_fops
+ minor: PC110PAD_MINOR,
+ name: "pc110 pad",
+ fops: &pad_fops,
};
/**
- * pc110pad_init:
+ * pc110pad_init_driver:
*
* We configure the pad with the default parameters (that is PS/2
* emulation mode. We then claim the needed I/O and interrupt resources.
* Finally as a matter of paranoia we turn the pad off until we are
* asked to open it by an application.
*/
-
-int pc110pad_init(void)
+
+static const char banner[] __initdata = KERN_INFO "PC110 digitizer pad at 0x%X, irq %d.\n";
+
+static int __init pc110pad_init_driver(void)
{
+ init_MUTEX(&reader_lock);
current_params = default_params;
- if(request_irq(current_params.irq, pad_irq, 0, "pc110pad", 0))
- {
- printk("pc110pad: Unable to get IRQ.\n");
+ if (request_irq(current_params.irq, pad_irq, 0, "pc110pad", 0)) {
+ printk(KERN_ERR "pc110pad: Unable to get IRQ.\n");
return -EBUSY;
}
- if(check_region(current_params.io, 4))
- {
- printk("pc110pad: I/O area in use.\n");
+ if (!request_region(current_params.io, 4, "pc110pad")) {
+ printk(KERN_ERR "pc110pad: I/O area in use.\n");
free_irq(current_params.irq,0);
return -EBUSY;
}
- request_region(current_params.io, 4, "pc110pad");
init_waitqueue_head(&queue);
- printk("PC110 digitizer pad at 0x%X, irq %d.\n",
- current_params.io,current_params.irq);
+ printk(banner, current_params.io, current_params.irq);
misc_register(&pc110_pad);
outb(0x30, current_params.io+2); /* switch off digitiser */
-
return 0;
}
-#ifdef MODULE
-
-/**
- * pc110pad_unload:
+/*
+ * pc110pad_exit_driver:
*
* Free the resources we acquired when the module was loaded. We also
* turn the pad off to be sure we don't leave it using power.
*/
-
-static void pc110pad_unload(void)
+
+static void __exit pc110pad_exit_driver(void)
{
outb(0x30, current_params.io+2); /* switch off digitiser */
- if(current_params.irq)
+ if (current_params.irq)
free_irq(current_params.irq, 0);
- current_params.irq=0;
+ current_params.irq = 0;
release_region(current_params.io, 4);
misc_deregister(&pc110_pad);
}
-
-
-int init_module(void)
-{
- init_MUTEX(&reader_lock);
- return pc110pad_init();
-}
-
-void cleanup_module(void)
-{
- pc110pad_unload();
-}
-#endif
+module_init(pc110pad_init_driver);
+module_exit(pc110pad_exit_driver);
diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c
index 4a7758325..35e4e1328 100644
--- a/drivers/char/pc_keyb.c
+++ b/drivers/char/pc_keyb.c
@@ -29,7 +29,7 @@
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/kbd_kern.h>
#include <linux/smp_lock.h>
diff --git a/drivers/char/pcmcia/serial_cb.c b/drivers/char/pcmcia/serial_cb.c
index f959b9c40..2dadac4ad 100644
--- a/drivers/char/pcmcia/serial_cb.c
+++ b/drivers/char/pcmcia/serial_cb.c
@@ -7,7 +7,7 @@
Copyright 1998, 1999 by Donald Becker and David Hinds
This software may be used and distributed according to the terms
- of the GNU Public License, incorporated herein by reference.
+ of the GNU General Public License, incorporated herein by reference.
All other rights reserved.
This driver is an activator for CardBus serial cards, as
@@ -24,7 +24,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/string.h>
#include <linux/tty.h>
#include <linux/serial.h>
diff --git a/drivers/char/pcmcia/serial_cs.c b/drivers/char/pcmcia/serial_cs.c
index af25aa9e9..c206cc21a 100644
--- a/drivers/char/pcmcia/serial_cs.c
+++ b/drivers/char/pcmcia/serial_cs.c
@@ -19,7 +19,7 @@
are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
Alternatively, the contents of this file may be used under the
- terms of the GNU Public License version 2 (the "GPL"), in which
+ terms of the GNU General Public License version 2 (the "GPL"), in which
case the provisions of the GPL are applicable instead of the
above. If you wish to allow the use of your version of this file
only under the terms of the GPL and not to allow others to use
@@ -36,7 +36,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/tty.h>
diff --git a/drivers/char/pcwd.c b/drivers/char/pcwd.c
index 2b4a71546..9a593a7ba 100644
--- a/drivers/char/pcwd.c
+++ b/drivers/char/pcwd.c
@@ -53,7 +53,7 @@
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
diff --git a/drivers/char/pcxx.c b/drivers/char/pcxx.c
index 19c5f8416..fad916e02 100644
--- a/drivers/char/pcxx.c
+++ b/drivers/char/pcxx.c
@@ -5,7 +5,7 @@
*
* Copyright (C) 1994,1995 Troy De Jongh
* This software may be used and distributed according to the terms
- * of the GNU Public License.
+ * of the GNU General Public License.
*
* This driver is for the DigiBoard PC/Xe and PC/Xi line of products.
*
@@ -63,7 +63,7 @@
#include <linux/delay.h>
#include <linux/serial.h>
#include <linux/tty_driver.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/version.h>
diff --git a/drivers/char/q40_keyb.c b/drivers/char/q40_keyb.c
index 22c981b79..02fc30766 100644
--- a/drivers/char/q40_keyb.c
+++ b/drivers/char/q40_keyb.c
@@ -21,7 +21,7 @@
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <asm/keyboard.h>
#include <asm/bitops.h>
diff --git a/drivers/char/qpmouse.c b/drivers/char/qpmouse.c
index 922f56a0c..d3e606874 100644
--- a/drivers/char/qpmouse.c
+++ b/drivers/char/qpmouse.c
@@ -31,7 +31,7 @@
#include <linux/fcntl.h>
#include <linux/errno.h>
#include <linux/timer.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/random.h>
#include <linux/poll.h>
diff --git a/drivers/char/random.c b/drivers/char/random.c
index bbd5aff21..c650aaf88 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -20,7 +20,7 @@
* written permission.
*
* ALTERNATIVELY, this product may be distributed under the terms of
- * the GNU Public License, in which case the provisions of the GPL are
+ * the GNU General Public License, in which case the provisions of the GPL are
* required INSTEAD OF the above restrictions. (This clause is
* necessary due to a potential bad interaction between the GPL and
* the restrictions contained in a BSD-style copyright.)
@@ -240,7 +240,7 @@
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/init.h>
diff --git a/drivers/char/rio/rio.h b/drivers/char/rio/rio.h
index 23f90a1b4..a66e4efa2 100644
--- a/drivers/char/rio/rio.h
+++ b/drivers/char/rio/rio.h
@@ -224,7 +224,7 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
#define RIO_IPL 5
#define RIO_PRI (PZERO+10)
-#define RIO_CLOSE_PRI PZERO-1 /* uninteruptible sleeps for close */
+#define RIO_CLOSE_PRI PZERO-1 /* uninterruptible sleeps for close */
typedef struct DbInf
{
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 6b0e3d298..5b1ae925c 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -56,7 +56,7 @@
#include <linux/tqueue.h>
#include <linux/version.h>
#include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/compatmac.h>
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c
index d5ab5ba02..c1e2ca818 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/char/rio/rioboot.c
@@ -36,7 +36,7 @@ static char *_rioboot_c_sccs_ = "@(#)rioboot.c 1.3";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/system.h>
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 3a330a07c..f651ed9e8 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -36,8 +36,9 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/tty.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index af61dc997..4a088353a 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -36,7 +36,7 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/system.h>
diff --git a/drivers/char/rio/rioinfo.h b/drivers/char/rio/rioinfo.h
index 11bc3e5d3..e08421c95 100644
--- a/drivers/char/rio/rioinfo.h
+++ b/drivers/char/rio/rioinfo.h
@@ -44,7 +44,7 @@ struct RioHostInfo {
long location; /* RIO Card Base I/O address */
long vector; /* RIO Card IRQ vector */
int bus; /* ISA/EISA/MCA/PCI */
- int mode; /* pointer to host mode - INTERUPT / POLLED */
+ int mode; /* pointer to host mode - INTERRUPT / POLLED */
struct old_sgttyb
* Sg; /* pointer to default term characteristics */
};
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c
index cbefdac2d..6ab8175c7 100644
--- a/drivers/char/rio/rioinit.c
+++ b/drivers/char/rio/rioinit.c
@@ -36,7 +36,7 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
#define __NO_VERSION__
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/system.h>
diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c
index f52124b78..c97f88640 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/char/rio/riointr.c
@@ -36,8 +36,9 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/tty.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c
index 4ce8443c3..069172fec 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/char/rio/rioparam.c
@@ -36,8 +36,9 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/tty.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c
index ab78ddf5d..b621005dc 100644
--- a/drivers/char/rio/rioroute.c
+++ b/drivers/char/rio/rioroute.c
@@ -35,7 +35,7 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/system.h>
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c
index 2b82c25ad..51f87de11 100644
--- a/drivers/char/rio/riotable.c
+++ b/drivers/char/rio/riotable.c
@@ -35,7 +35,7 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
#include <asm/io.h>
#include <asm/system.h>
@@ -696,7 +696,7 @@ int RIOAssignRta( struct rio_info *p, struct Map *MapP )
/*
** Now we have a host we need to allocate an ID
- ** if the the entry does not already have one.
+ ** if the entry does not already have one.
*/
if (MapP->ID == (ushort)-1)
{
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index c9134e3fc..aaa7a1f32 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -38,8 +38,9 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
#define __NO_VERSION__
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/tty.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 5cecdde40..8c950bf54 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -51,7 +51,7 @@
#define MODULE
#endif
-#ifdef NEW_MODULES
+#if defined(NEW_MODULES) && defined(LOCAL_ROCKET_H)
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
@@ -66,7 +66,7 @@
#include <linux/major.h>
#include <linux/kernel.h>
#include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/sched.h>
diff --git a/drivers/char/sbc60xxwdt.c b/drivers/char/sbc60xxwdt.c
index 0c3deed84..e3f35a142 100644
--- a/drivers/char/sbc60xxwdt.c
+++ b/drivers/char/sbc60xxwdt.c
@@ -63,7 +63,7 @@
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
diff --git a/drivers/char/scan_keyb.c b/drivers/char/scan_keyb.c
index 6ba861be2..20ac1e7e0 100644
--- a/drivers/char/scan_keyb.c
+++ b/drivers/char/scan_keyb.c
@@ -16,7 +16,7 @@
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/kbd_kern.h>
struct scan_keyboard {
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index b804a61e1..39cf73765 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -15,7 +15,7 @@
#include <linux/tty.h>
#include <linux/sched.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/types.h>
#include <asm/uaccess.h>
diff --git a/drivers/char/serial.c b/drivers/char/serial.c
index 59d0a4379..24e8b8e6a 100644
--- a/drivers/char/serial.c
+++ b/drivers/char/serial.c
@@ -28,7 +28,7 @@
* Stanislav V. Voronyi <stas@uanet.kharkov.ua>
*
* 3/98: Change the IRQ detection, use of probe_irq_o*(),
- * supress TIOCSERGWILD and TIOCSERSWILD
+ * suppress TIOCSERGWILD and TIOCSERSWILD
* Etienne Lorrain <etienne.lorrain@ibm.net>
*
* 4/98: Added changes to support the ARM architecture proposed by
@@ -54,6 +54,9 @@
* 7/00: fix some returns on failure not using MOD_DEC_USE_COUNT.
* Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
+ * 10/00: add in optional hardware flow control for serial console.
+ * Kanoj Sarcar <kanoj@sgi.com>
+ *
* This module exports the following rs232 io functions:
*
* int rs_init(void);
@@ -172,9 +175,6 @@ static char *serial_revdate = "2000-08-09";
* End of serial driver configuration section.
*/
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
#include <linux/module.h>
#include <linux/types.h>
@@ -5280,6 +5280,36 @@ static int __init rs_init(void)
}
/*
+ * This is for use by architectures that know their serial port
+ * attributes only at run time. Not to be invoked after rs_init().
+ */
+int __init early_serial_setup(struct serial_struct *req)
+{
+ int i = req->line;
+
+ if (i >= NR_IRQS)
+ return(-ENOENT);
+ rs_table[i].magic = 0;
+ rs_table[i].baud_base = req->baud_base;
+ rs_table[i].port = req->port;
+ if (HIGH_BITS_OFFSET)
+ rs_table[i].port += (unsigned long) req->port_high <<
+ HIGH_BITS_OFFSET;
+ rs_table[i].irq = req->irq;
+ rs_table[i].flags = req->flags;
+ rs_table[i].close_delay = req->close_delay;
+ rs_table[i].io_type = req->io_type;
+ rs_table[i].hub6 = req->hub6;
+ rs_table[i].iomem_base = req->iomem_base;
+ rs_table[i].iomem_reg_shift = req->iomem_reg_shift;
+ rs_table[i].type = req->type;
+ rs_table[i].xmit_fifo_size = req->xmit_fifo_size;
+ rs_table[i].custom_divisor = req->custom_divisor;
+ rs_table[i].closing_wait = req->closing_wait;
+ return(0);
+}
+
+/*
* register_serial and unregister_serial allows for 16x50 serial ports to be
* configured at run-time, to support PCMCIA modems.
*/
@@ -5489,6 +5519,10 @@ static inline void wait_for_xmitr(struct async_struct *info)
if (--tmout == 0)
break;
} while((status & BOTH_EMPTY) != BOTH_EMPTY);
+ if (info->flags & ASYNC_NO_FLOW)
+ return;
+ tmout = 1000000;
+ while (--tmout && ((serial_in(info, UART_MSR) & UART_MSR_CTS) == 0));
}
@@ -5571,7 +5605,7 @@ static kdev_t serial_console_device(struct console *c)
}
/*
- * Setup initial baud/bits/parity. We do two things here:
+ * Setup initial baud/bits/parity/flow. We do two things here:
* - construct a cflag setting for the first rs_open()
* - initialize the serial port
* Return non-zero if we didn't find a serial port.
@@ -5584,6 +5618,7 @@ static int __init serial_console_setup(struct console *co, char *options)
int baud = 9600;
int bits = 8;
int parity = 'n';
+ int doflow = 0;
int cflag = CREAD | HUPCL | CLOCAL;
int quot = 0;
char *s;
@@ -5594,7 +5629,9 @@ static int __init serial_console_setup(struct console *co, char *options)
while(*s >= '0' && *s <= '9')
s++;
if (*s) parity = *s++;
- if (*s) bits = *s - '0';
+ if (*s) bits = *s++ - '0';
+ if ((*s) && (!strcmp(s, "rtscts")))
+ doflow = 1;
}
/*
@@ -5650,6 +5687,8 @@ static int __init serial_console_setup(struct console *co, char *options)
* Divisor, bytesize and parity
*/
state = rs_table + co->index;
+ if (doflow == 0)
+ state->flags |= ASYNC_NO_FLOW;
info = &async_sercons;
info->magic = SERIAL_MAGIC;
info->state = state;
diff --git a/drivers/char/serial_21285.c b/drivers/char/serial_21285.c
index 16ad022bd..f8541f3cf 100644
--- a/drivers/char/serial_21285.c
+++ b/drivers/char/serial_21285.c
@@ -19,7 +19,7 @@
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/console.h>
diff --git a/drivers/char/serial_amba.c b/drivers/char/serial_amba.c
index eaab7d34e..cbd353846 100644
--- a/drivers/char/serial_amba.c
+++ b/drivers/char/serial_amba.c
@@ -48,7 +48,7 @@
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/circ_buf.h>
#include <linux/serial.h>
diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c
index c14fa8487..e329bfbb1 100644
--- a/drivers/char/sh-sci.c
+++ b/drivers/char/sh-sci.c
@@ -29,7 +29,7 @@
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/delay.h>
#ifdef CONFIG_SERIAL_CONSOLE
diff --git a/drivers/char/softdog.c b/drivers/char/softdog.c
index e3f68ba30..9d95ba98d 100644
--- a/drivers/char/softdog.c
+++ b/drivers/char/softdog.c
@@ -45,9 +45,7 @@
static int soft_margin = TIMER_MARGIN; /* in seconds */
-#ifdef MODULE
MODULE_PARM(soft_margin,"i");
-#endif
/*
* Our timer
@@ -129,14 +127,10 @@ static ssize_t softdog_write(struct file *file, const char *data, size_t len, lo
static int softdog_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- static struct watchdog_info ident=
- {
- 0,
- 0,
- "Software Watchdog"
+ static struct watchdog_info ident = {
+ identity: "Software Watchdog",
};
- switch(cmd)
- {
+ switch (cmd) {
default:
return -ENOIOCTLCMD;
case WDIOC_GETSUPPORT:
@@ -152,8 +146,7 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
}
}
-static struct file_operations softdog_fops=
-{
+static struct file_operations softdog_fops = {
owner: THIS_MODULE,
write: softdog_write,
ioctl: softdog_ioctl,
@@ -161,13 +154,14 @@ static struct file_operations softdog_fops=
release: softdog_release,
};
-static struct miscdevice softdog_miscdev=
-{
- WATCHDOG_MINOR,
- "watchdog",
- &softdog_fops
+static struct miscdevice softdog_miscdev = {
+ minor: WATCHDOG_MINOR,
+ name: "watchdog",
+ fops: &softdog_fops,
};
+static const char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.05, timer margin: %d sec\n";
+
static int __init watchdog_init(void)
{
int ret;
@@ -177,10 +171,10 @@ static int __init watchdog_init(void)
if (ret)
return ret;
- printk("Software Watchdog Timer: 0.05, timer margin: %d sec\n", soft_margin);
+ printk(banner, soft_margin);
return 0;
-}
+}
static void __exit watchdog_exit(void)
{
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index dbd51e51a..6628f9d05 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -29,8 +29,9 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h> /* for linux/stallion.h */
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/interrupt.h>
+#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/cd1400.h>
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 156c683e4..da09b33a6 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -78,7 +78,7 @@
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/netdevice.h>
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 71773fa6c..ad9b94da2 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -13,6 +13,7 @@
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/fs.h>
+#include <linux/tty.h>
#include <linux/mount.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
index 536942f41..0f9be7ac5 100644
--- a/drivers/char/tpqic02.c
+++ b/drivers/char/tpqic02.c
@@ -87,7 +87,7 @@
#include <linux/ioport.h>
#include <linux/tpqic02.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 0d63be6ae..9e667567a 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -81,7 +81,7 @@
#include <linux/kd.h>
#include <linux/mm.h>
#include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
@@ -139,7 +139,6 @@ static int tty_release(struct inode *, struct file *);
int tty_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg);
static int tty_fasync(int fd, struct file * filp, int on);
-extern int sx_init (void);
extern int vme_scc_init (void);
extern long vme_scc_console_init(void);
extern int serial167_init(void);
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index d6bc4e63b..67ed42822 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -31,7 +31,7 @@
#include <linux/delay.h>
#include <linux/tqueue.h>
#include <linux/version.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/console.h>
#include <linux/init.h>
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 4fe33cddb..9ff2de775 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -19,7 +19,7 @@
#include <linux/kd.h>
#include <linux/vt.h>
#include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/major.h>
#include <linux/fs.h>
#include <linux/console.h>
diff --git a/drivers/char/wd501p.h b/drivers/char/wd501p.h
index 11fc72b04..eefcdd7e9 100644
--- a/drivers/char/wd501p.h
+++ b/drivers/char/wd501p.h
@@ -11,7 +11,7 @@
*
* http://www.cymru.net
*
- * This driver is provided under the GNU public license, incorporated
+ * This driver is provided under the GNU General Public License, incorporated
* herein by reference. The driver is provided without warranty or
* support.
*
diff --git a/drivers/char/wdt.c b/drivers/char/wdt.c
index 9600a5b17..0da4f4241 100644
--- a/drivers/char/wdt.c
+++ b/drivers/char/wdt.c
@@ -40,7 +40,7 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include "wd501p.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
diff --git a/drivers/char/wdt_pci.c b/drivers/char/wdt_pci.c
index 5ff7210ae..f5572a1c7 100644
--- a/drivers/char/wdt_pci.c
+++ b/drivers/char/wdt_pci.c
@@ -43,7 +43,7 @@
#include <linux/watchdog.h>
#define WDT_IS_PCI
#include "wd501p.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>