Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-31 23:03:13 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-31 23:03:13 -0700
commitd36d3c60b51c0633a4b7ff71adfc5317398b340d (patch)
treedc8adfd4b10b0cff56bdce49b6654dacb4138669
parentc3a5029cf325317faa4e06409705643826fae4e7 (diff)
parent5b7149d266cdd517e14ccdb89b0bf15844e962f4 (diff)
Merge bk://linux-input.bkbits.net/linux-input
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
-rw-r--r--Documentation/ide.txt15
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/alpha/kernel/osf_sys.c4
-rw-r--r--arch/i386/kernel/apic.c2
-rw-r--r--arch/i386/kernel/i386_ksyms.c1
-rw-r--r--arch/i386/kernel/io_apic.c4
-rw-r--r--arch/i386/kernel/process.c11
-rw-r--r--arch/ia64/config.in8
-rw-r--r--arch/m68k/atari/joystick.c2
-rw-r--r--arch/ppc/8260_io/Config.in2
-rw-r--r--arch/sparc64/solaris/socksys.c4
-rw-r--r--drivers/Makefile3
-rw-r--r--drivers/base/fs.c44
-rw-r--r--drivers/block/DAC960.c4
-rw-r--r--drivers/block/acsi.c7
-rw-r--r--drivers/block/acsi_slm.c6
-rw-r--r--drivers/block/elevator.c31
-rw-r--r--drivers/block/floppy.c10
-rw-r--r--drivers/block/ll_rw_blk.c26
-rw-r--r--drivers/block/loop.c4
-rw-r--r--drivers/block/paride/pd.c6
-rw-r--r--drivers/block/paride/pg.c4
-rw-r--r--drivers/block/paride/pt.c4
-rw-r--r--drivers/block/ps2esdi.c7
-rw-r--r--drivers/block/swim3.c2
-rw-r--r--drivers/block/xd.c6
-rw-r--r--drivers/cdrom/aztcd.c4
-rw-r--r--drivers/cdrom/cdu31a.c6
-rw-r--r--drivers/cdrom/cm206.c4
-rw-r--r--drivers/cdrom/gscd.c4
-rw-r--r--drivers/cdrom/mcd.c4
-rw-r--r--drivers/cdrom/mcdx.c4
-rw-r--r--drivers/cdrom/optcd.c5
-rw-r--r--drivers/cdrom/sbpcd.c6
-rw-r--r--drivers/cdrom/sjcd.c4
-rw-r--r--drivers/cdrom/sonycd535.c14
-rw-r--r--drivers/char/drm/mga_drv.h2
-rw-r--r--drivers/char/dsp56k.c4
-rw-r--r--drivers/char/dtlk.c4
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c6
-rw-r--r--drivers/char/ip2main.c14
-rw-r--r--drivers/char/istallion.c4
-rw-r--r--drivers/char/lp.c4
-rw-r--r--drivers/char/mem.c2
-rw-r--r--drivers/char/misc.c2
-rw-r--r--drivers/char/nvram.c541
-rw-r--r--drivers/char/ppdev.c4
-rw-r--r--drivers/char/rocket.c21
-rw-r--r--drivers/char/stallion.c4
-rw-r--r--drivers/char/tpqic02.c4
-rw-r--r--drivers/char/tty_io.c6
-rw-r--r--drivers/char/vc_screen.c2
-rw-r--r--drivers/i2c/i2c-dev.c8
-rw-r--r--drivers/ide/cs5530.c88
-rw-r--r--drivers/ide/hd.c3
-rw-r--r--drivers/ide/ide-cd.c13
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-tape.c13
-rw-r--r--drivers/ide/ide.c188
-rw-r--r--drivers/ide/main.c48
-rw-r--r--drivers/ide/pcidma.c73
-rw-r--r--drivers/ide/probe.c44
-rw-r--r--drivers/ide/qd65xx.c4
-rw-r--r--drivers/ide/trm290.c1
-rw-r--r--drivers/ide/umc8672.c5
-rw-r--r--drivers/input/input.c4
-rw-r--r--drivers/isdn/capi/capi.c6
-rw-r--r--drivers/isdn/hisax/Config.in4
-rw-r--r--drivers/isdn/hysdn/boardergo.c15
-rw-r--r--drivers/isdn/i4l/isdn_common.c8
-rw-r--r--drivers/macintosh/adb.c2
-rw-r--r--drivers/md/lvm.c22
-rw-r--r--drivers/md/md.c5
-rw-r--r--drivers/media/video/videodev.c5
-rw-r--r--drivers/mtd/mtdblock.c18
-rw-r--r--drivers/mtd/mtdchar.c17
-rw-r--r--drivers/net/8139cp.c2
-rw-r--r--drivers/net/Config.in2
-rw-r--r--drivers/net/Makefile.lib2
-rw-r--r--drivers/net/au1000_eth.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_hdx.c11
-rw-r--r--drivers/net/irda/Config.in12
-rw-r--r--drivers/net/ppp_generic.c4
-rw-r--r--drivers/net/wan/cosa.c8
-rw-r--r--drivers/s390/block/dasd_genhd.c5
-rw-r--r--drivers/s390/block/xpram.c4
-rw-r--r--drivers/s390/char/tapeblock.c12
-rw-r--r--drivers/s390/char/tapechar.c8
-rw-r--r--drivers/s390/char/tubfs.c11
-rw-r--r--drivers/sbus/audio/audio.c4
-rw-r--r--drivers/sbus/char/bpp.c4
-rw-r--r--drivers/sbus/char/sunkbd.c2
-rw-r--r--drivers/sbus/char/vfc_dev.c4
-rw-r--r--drivers/scsi/osst.c16
-rw-r--r--drivers/scsi/scsi_error.c1
-rw-r--r--drivers/scsi/sd.c7
-rw-r--r--drivers/scsi/sg.c5
-rw-r--r--drivers/scsi/sr.c10
-rw-r--r--drivers/scsi/st.c4
-rw-r--r--drivers/sgi/char/shmiq.c2
-rw-r--r--drivers/usb/core/file.c4
-rw-r--r--drivers/usb/core/hub.c2
-rw-r--r--drivers/usb/host/ohci-q.c29
-rw-r--r--drivers/usb/misc/tiglusb.c6
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/modedb.c4
-rw-r--r--fs/Config.in2
-rw-r--r--fs/block_dev.c4
-rw-r--r--fs/coda/psdev.c6
-rw-r--r--fs/devfs/base.c76
-rw-r--r--fs/devices.c5
-rw-r--r--fs/driverfs/inode.c136
-rw-r--r--fs/nfs/dir.c9
-rw-r--r--fs/nfs/nfs2xdr.c2
-rw-r--r--fs/nfs/nfs3xdr.c2
-rw-r--r--fs/smbfs/smbiod.c1
-rw-r--r--fs/ufs/super.c2
-rw-r--r--include/asm-alpha/socket.h2
-rw-r--r--include/asm-arm/socket.h2
-rw-r--r--include/asm-i386/desc.h3
-rw-r--r--include/asm-i386/smp.h5
-rw-r--r--include/asm-i386/socket.h2
-rw-r--r--include/asm-i386/spinlock.h2
-rw-r--r--include/asm-i386/unistd.h1
-rw-r--r--include/asm-ia64/socket.h2
-rw-r--r--include/asm-m68k/socket.h2
-rw-r--r--include/asm-mips/socket.h2
-rw-r--r--include/asm-mips64/socket.h2
-rw-r--r--include/asm-parisc/socket.h2
-rw-r--r--include/asm-ppc/socket.h2
-rw-r--r--include/asm-s390/socket.h2
-rw-r--r--include/asm-sh/socket.h2
-rw-r--r--include/asm-sparc/socket.h2
-rw-r--r--include/asm-sparc64/socket.h2
-rw-r--r--include/linux/devfs_fs_kernel.h25
-rw-r--r--include/linux/dqblk_xfs.h6
-rw-r--r--include/linux/driverfs_fs.h7
-rw-r--r--include/linux/elevator.h16
-rw-r--r--include/linux/ide.h6
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/signal.h1
-rw-r--r--init/main.c4
-rw-r--r--kernel/futex.c8
-rw-r--r--kernel/kmod.c14
-rw-r--r--kernel/module.c34
-rw-r--r--kernel/platform.c14
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/suspend.c26
-rw-r--r--kernel/sys.c2
-rw-r--r--kernel/sysctl.c6
-rw-r--r--kernel/user.c6
-rw-r--r--mm/filemap.c2
-rw-r--r--mm/numa.c2
-rw-r--r--mm/page_io.c10
-rw-r--r--mm/readahead.c4
-rw-r--r--mm/rmap.c2
-rw-r--r--mm/shmem.c76
-rw-r--r--mm/slab.c26
-rw-r--r--mm/swap_state.c24
-rw-r--r--net/ipv4/ipconfig.c2
-rw-r--r--net/netlink/netlink_dev.c4
-rw-r--r--net/sched/sch_ingress.c4
-rw-r--r--net/sunrpc/clnt.c12
-rw-r--r--net/sunrpc/xprt.c34
-rw-r--r--sound/core/sound.c8
-rw-r--r--sound/oss/i810_audio.c1
-rw-r--r--sound/sound_core.c5
168 files changed, 1022 insertions, 1343 deletions
diff --git a/Documentation/ide.txt b/Documentation/ide.txt
index 3adb7cabfbcd..f7250c2b18d4 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -46,7 +46,7 @@ Common pitfalls:
- If you mix devices on the same cable, please consider using similar devices
in respect of the data transfer mode they support.
-- Even better tru to stick to the same vendor and device type on the same
+- Even better try to stick to the same vendor and device type on the same
cable.
================================================================================
@@ -66,7 +66,8 @@ sixth.. ide5, usually PCI, probed
To access devices on interfaces > ide0, device entries please make sure that
device files for them are present in /dev. If not, please create such
entries, by simply running the included shell script:
-/usr/src/linux/scripts/MAKEDEV.ide
+
+ /usr/src/linux/scripts/MAKEDEV.ide
This driver automatically probes for most IDE interfaces (including all PCI
ones), for the drives/geometries attached to those interfaces, and for the IRQ
@@ -192,11 +193,10 @@ and still allows newer hardware to run on the 2nd/3rd/4th IDE ports
under control of ide.c. To have ide.c also "take over" the primary
IDE port in this situation, use the "command line" parameter: ide0=0x1f0
-The IDE driver is partly modularized. The high level disk/cdrom/tape/floppy
+The IDE driver is modularized. The high level disk/CD-ROM/tape/floppy
drivers can always be compiled as loadable modules, the chipset drivers
can only be compiled into the kernel, and the core code (ide.c) can be
-compiled as a loadable module provided no chipset support and no special
-partition table translations are needed.
+compiled as a loadable module provided no chipset support is needed.
When using ide.c/ide-tape.c as modules in combination with kerneld, add:
@@ -214,8 +214,9 @@ driver using the "options=" keyword to insmod, while replacing any ',' with
================================================================================
-Summary of ide driver parameters for kernel "command line":
-----------------------------------------------------------
+Summary of ide driver parameters for kernel command line
+--------------------------------------------------------
+
"hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
"idex=" is recognized for all "x" from "0" to "3", such as "ide1".
diff --git a/MAINTAINERS b/MAINTAINERS
index ebcd5fe6fa67..ce805507932e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1493,7 +1493,7 @@ M: perex@suse.cz
L: alsa-devel@alsa-project.org
S: Maintained
-SPARC:
+UltraSPARC (sparc64):
P: David S. Miller
M: davem@redhat.com
P: Eddie C. Dost
@@ -1506,6 +1506,9 @@ L: sparclinux@vger.kernel.org
L: ultralinux@vger.kernel.org
S: Maintained
+SPARC (sparc32):
+S: Unmaintained
+
SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
P: Roger Wolff
M: R.E.Wolff@BitWizard.nl
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index dd9af1ed207a..9dd48b15441c 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -221,8 +221,8 @@ asmlinkage unsigned long sys_getxpid(int a0, int a1, int a2, int a3, int a4,
* isn't actually going to matter, as if the parent happens
* to change we can happily return either of the pids.
*/
- (&regs)->r20 = tsk->real_parent->pid;
- return tsk->pid;
+ (&regs)->r20 = tsk->real_parent->tgid;
+ return tsk->tgid;
}
asmlinkage unsigned long osf_mmap(unsigned long addr, unsigned long len,
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index a864800e1f3c..be2f19bf4d03 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -1140,7 +1140,7 @@ asmlinkage void smp_error_interrupt(void)
6: Received illegal vector
7: Illegal register address
*/
- printk (KERN_ERR "APIC error on CPU%d: %02lx(%02lx)\n",
+ printk (KERN_INFO "APIC error on CPU%d: %02lx(%02lx)\n",
smp_processor_id(), v , v1);
irq_exit();
}
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 2b6ba73e1fd9..d31b096b4da7 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -132,6 +132,7 @@ EXPORT_SYMBOL_NOVERS(__write_lock_failed);
EXPORT_SYMBOL_NOVERS(__read_lock_failed);
/* Global SMP stuff */
+EXPORT_SYMBOL(synchronize_irq);
EXPORT_SYMBOL(smp_call_function);
/* TLB flushing */
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index a2ca84337699..8944f668e984 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -791,7 +791,7 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector)
entry.vector = vector;
/*
- * The timer IRQ doesnt have to know that behind the
+ * The timer IRQ doesn't have to know that behind the
* scene we have a 8259A-master in AEOI mode ...
*/
irq_desc[0].handler = &ioapic_edge_irq_type;
@@ -1654,7 +1654,7 @@ static inline void check_timer(void)
printk(" failed.\n");
if (nmi_watchdog) {
- printk(KERN_WARNING "timer doesnt work through the IO-APIC - disabling NMI Watchdog!\n");
+ printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
nmi_watchdog = 0;
}
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index a464e44f2a96..daae105bc4ef 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -851,17 +851,6 @@ asmlinkage int sys_set_thread_area(unsigned long base, unsigned long flags)
if (flags & ~TLS_FLAGS_MASK)
return -EINVAL;
- /*
- * Clear the TLS?
- */
- if (flags & TLS_FLAG_CLEAR) {
- cpu = get_cpu();
- t->tls_desc.a = t->tls_desc.b = 0;
- load_TLS_desc(t, cpu);
- put_cpu();
- return 0;
- }
-
if (flags & TLS_FLAG_WRITABLE)
writable = 1;
diff --git a/arch/ia64/config.in b/arch/ia64/config.in
index e8b206238104..fc54b622b779 100644
--- a/arch/ia64/config.in
+++ b/arch/ia64/config.in
@@ -71,15 +71,15 @@ fi
if [ "$CONFIG_IA64_SGI_SN1" = "y" -o "$CONFIG_IA64_SGI_SN2" = "y" ]; then
define_bool CONFIG_IA64_SGI_SN y
- bool ' Enable extra debugging code' CONFIG_IA64_SGI_SN_DEBUG n
+ bool ' Enable extra debugging code' CONFIG_IA64_SGI_SN_DEBUG
bool ' Enable SGI Medusa Simulator Support' CONFIG_IA64_SGI_SN_SIM
bool ' Enable autotest (llsc). Option to run cache test instead of booting' \
- CONFIG_IA64_SGI_AUTOTEST n
+ CONFIG_IA64_SGI_AUTOTEST
define_bool CONFIG_DEVFS_FS y
if [ "$CONFIG_DEVFS_FS" = "y" ]; then
- bool ' Enable DEVFS Debug Code' CONFIG_DEVFS_DEBUG n
+ bool ' Enable DEVFS Debug Code' CONFIG_DEVFS_DEBUG
fi
- bool ' Enable protocol mode for the L1 console' CONFIG_SERIAL_SGI_L1_PROTOCOL y
+ bool ' Enable protocol mode for the L1 console' CONFIG_SERIAL_SGI_L1_PROTOCOL
define_bool CONFIG_DISCONTIGMEM y
define_bool CONFIG_IA64_MCA y
define_bool CONFIG_NUMA y
diff --git a/arch/m68k/atari/joystick.c b/arch/m68k/atari/joystick.c
index 9c743ba9f349..df7da2e7a90e 100644
--- a/arch/m68k/atari/joystick.c
+++ b/arch/m68k/atari/joystick.c
@@ -134,7 +134,7 @@ int __init atari_joystick_init(void)
init_waitqueue_head(&joystick[0].wait);
init_waitqueue_head(&joystick[1].wait);
- if (devfs_register_chrdev(MAJOR_NR, "Joystick", &atari_joystick_fops))
+ if (register_chrdev(MAJOR_NR, "Joystick", &atari_joystick_fops))
printk("unable to get major %d for joystick devices\n", MAJOR_NR);
devfs_register_series (NULL, "joysticks/digital%u", 2, DEVFS_FL_DEFAULT,
MAJOR_NR, 128, S_IFCHR | S_IRUSR | S_IWUSR,
diff --git a/arch/ppc/8260_io/Config.in b/arch/ppc/8260_io/Config.in
index 20eeaeae50fc..c47b35052cc6 100644
--- a/arch/ppc/8260_io/Config.in
+++ b/arch/ppc/8260_io/Config.in
@@ -26,7 +26,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
choice 'Type of PHY' \
"LXT970 CONFIG_FCC_LXT970 \
LXT971 CONFIG_FCC_LXT971 \
- QS6612 CONFIG_FCC_QS6612" CONFIG_FCC_LXT971
+ QS6612 CONFIG_FCC_QS6612" LXT971
fi
fi
fi
diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c
index 5a91f34ef630..84399fb8a1a7 100644
--- a/arch/sparc64/solaris/socksys.c
+++ b/arch/sparc64/solaris/socksys.c
@@ -181,7 +181,7 @@ init_socksys(void)
int (*sys_close)(unsigned int) =
(int (*)(unsigned int))SYS(close);
- ret = devfs_register_chrdev (30, "socksys", &socksys_fops);
+ ret = register_chrdev (30, "socksys", &socksys_fops);
if (ret < 0) {
printk ("Couldn't register socksys character device\n");
return ret;
@@ -208,7 +208,7 @@ init_socksys(void)
void
cleanup_socksys(void)
{
- if (devfs_unregister_chrdev(30, "socksys"))
+ if (unregister_chrdev(30, "socksys"))
printk ("Couldn't unregister socksys character device\n");
devfs_unregister (devfs_handle);
}
diff --git a/drivers/Makefile b/drivers/Makefile
index 3348f9765ba6..958ecc4df984 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -7,8 +7,9 @@
obj-$(CONFIG_PCI) += pci/
obj-$(CONFIG_ACPI) += acpi/
+obj-y += serial/
obj-$(CONFIG_PARPORT) += parport/
-obj-y += base/ serial/ char/ block/ misc/ net/ media/
+obj-y += base/ char/ block/ misc/ net/ media/
obj-$(CONFIG_NUBUS) += nubus/
obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_IDE) += ide/
diff --git a/drivers/base/fs.c b/drivers/base/fs.c
index 65225deedf7d..1429392c1533 100644
--- a/drivers/base/fs.c
+++ b/drivers/base/fs.c
@@ -26,23 +26,13 @@ extern struct driver_file_entry * device_default_files[];
*/
int device_create_file(struct device * dev, struct driver_file_entry * entry)
{
- struct driver_file_entry * new_entry;
- int error = -ENOMEM;
-
- if (!dev)
- return -EINVAL;
- get_device(dev);
-
- new_entry = kmalloc(sizeof(*new_entry),GFP_KERNEL);
- if (!new_entry)
- goto done;
-
- memcpy(new_entry,entry,sizeof(*entry));
- error = driverfs_create_file(new_entry,&dev->dir);
- if (error)
- kfree(new_entry);
- done:
- put_device(dev);
+ int error = -EINVAL;
+
+ if (dev) {
+ get_device(dev);
+ error = driverfs_create_file(entry,&dev->dir);
+ put_device(dev);
+ }
return error;
}
@@ -103,22 +93,6 @@ static void fill_devpath(struct device * dev, char * path, int length)
pr_debug("%s: path = '%s'\n",__FUNCTION__,path);
}
-static int create_symlink(struct driver_dir_entry * parent, char * name, char * path)
-{
- struct driver_file_entry * entry;
- int error;
-
- entry = kmalloc(sizeof(struct driver_file_entry),GFP_KERNEL);
- if (!entry)
- return -ENOMEM;
- entry->name = name;
- entry->mode = S_IRUGO;
- error = driverfs_create_symlink(parent,entry,path);
- if (error)
- kfree(entry);
- return error;
-}
-
int device_bus_link(struct device * dev)
{
char * path;
@@ -148,15 +122,13 @@ int device_bus_link(struct device * dev)
strcpy(path,"../../..");
fill_devpath(dev,path,length);
- error = create_symlink(&dev->bus->device_dir,dev->bus_id,path);
-
+ error = driverfs_create_symlink(&dev->bus->device_dir,dev->bus_id,path);
kfree(path);
return error;
}
int device_create_dir(struct driver_dir_entry * dir, struct driver_dir_entry * parent)
{
- INIT_LIST_HEAD(&dir->files);
dir->mode = (S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO);
return driverfs_create_dir(dir,parent);
}
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 59e4b53dfce5..be68e7e539bc 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -1934,7 +1934,7 @@ static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
/*
Register the Block Device Major Number for this DAC960 Controller.
*/
- if (devfs_register_blkdev(MajorNumber, "dac960",
+ if (register_blkdev(MajorNumber, "dac960",
&DAC960_BlockDeviceOperations) < 0)
{
DAC960_Error("UNABLE TO ACQUIRE MAJOR NUMBER %d - DETACHING\n",
@@ -1993,7 +1993,7 @@ static void DAC960_UnregisterBlockDevice(DAC960_Controller_T *Controller)
/*
Unregister the Block Device Major Number for this DAC960 Controller.
*/
- devfs_unregister_blkdev(MajorNumber, "dac960");
+ unregister_blkdev(MajorNumber, "dac960");
/*
Remove the I/O Request Queue.
*/
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index 48c250892cde..0e1aa84e691b 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -56,7 +56,6 @@
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/genhd.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/major.h>
@@ -1741,14 +1740,14 @@ int acsi_init( void )
int err = 0;
if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ACSI))
return 0;
- if (devfs_register_blkdev( MAJOR_NR, "ad", &acsi_fops )) {
+ if (register_blkdev( MAJOR_NR, "ad", &acsi_fops )) {
printk( KERN_ERR "Unable to get major %d for ACSI\n", MAJOR_NR );
return -EBUSY;
}
if (!(acsi_buffer =
(char *)atari_stram_alloc(ACSI_BUFFER_SIZE, "acsi"))) {
printk( KERN_ERR "Unable to get ACSI ST-Ram buffer.\n" );
- devfs_unregister_blkdev( MAJOR_NR, "ad" );
+ unregister_blkdev( MAJOR_NR, "ad" );
return -ENOMEM;
}
phys_acsi_buffer = virt_to_phys( acsi_buffer );
@@ -1786,7 +1785,7 @@ void cleanup_module(void)
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
atari_stram_free( acsi_buffer );
- if (devfs_unregister_blkdev( MAJOR_NR, "ad" ) != 0)
+ if (unregister_blkdev( MAJOR_NR, "ad" ) != 0)
printk( KERN_ERR "acsi: cleanup_module failed\n");
del_gendisk(&acsi_gendisk);
diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c
index 59ceb6203db8..b2bb106d2464 100644
--- a/drivers/block/acsi_slm.c
+++ b/drivers/block/acsi_slm.c
@@ -998,14 +998,14 @@ static devfs_handle_t devfs_handle;
int slm_init( void )
{
- if (devfs_register_chrdev( MAJOR_NR, "slm", &slm_fops )) {
+ if (register_chrdev( MAJOR_NR, "slm", &slm_fops )) {
printk( KERN_ERR "Unable to get major %d for ACSI SLM\n", MAJOR_NR );
return -EBUSY;
}
if (!(SLMBuffer = atari_stram_alloc( SLM_BUFFER_SIZE, NULL, "SLM" ))) {
printk( KERN_ERR "Unable to get SLM ST-Ram buffer.\n" );
- devfs_unregister_chrdev( MAJOR_NR, "slm" );
+ unregister_chrdev( MAJOR_NR, "slm" );
return -ENOMEM;
}
BufferP = SLMBuffer;
@@ -1038,7 +1038,7 @@ int init_module(void)
void cleanup_module(void)
{
devfs_unregister (devfs_handle);
- if (devfs_unregister_chrdev( MAJOR_NR, "slm" ) != 0)
+ if (unregister_chrdev( MAJOR_NR, "slm" ) != 0)
printk( KERN_ERR "acsi_slm: cleanup_module failed\n");
atari_stram_free( SLMBuffer );
}
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index 348497d2342a..b47b6d607011 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -220,7 +220,8 @@ void elevator_linus_merge_cleanup(request_queue_t *q, struct request *req, int c
}
}
-void elevator_linus_merge_req(struct request *req, struct request *next)
+void elevator_linus_merge_req(request_queue_t *q, struct request *req,
+ struct request *next)
{
if (elv_linus_sequence(next) < elv_linus_sequence(req))
elv_linus_sequence(req) = elv_linus_sequence(next);
@@ -232,6 +233,9 @@ void elevator_linus_add_request(request_queue_t *q, struct request *rq,
elevator_t *e = &q->elevator;
int lat = 0, *latency = e->elevator_data;
+ if (!insert_here)
+ insert_here = q->queue_head.prev;
+
if (!(rq->flags & REQ_BARRIER))
lat = latency[rq_data_dir(rq)];
@@ -318,7 +322,7 @@ void elevator_noop_add_request(request_queue_t *q, struct request *rq,
struct request *elevator_noop_next_request(request_queue_t *q)
{
- if (!blk_queue_empty(q))
+ if (!list_empty(&q->queue_head))
return list_entry_rq(q->queue_head.next);
return NULL;
@@ -376,7 +380,7 @@ void elv_merge_requests(request_queue_t *q, struct request *rq,
elevator_t *e = &q->elevator;
if (e->elevator_merge_req_fn)
- e->elevator_merge_req_fn(rq, next);
+ e->elevator_merge_req_fn(q, rq, next);
}
/*
@@ -433,6 +437,27 @@ void elv_remove_request(request_queue_t *q, struct request *rq)
e->elevator_remove_req_fn(q, rq);
}
+int elv_queue_empty(request_queue_t *q)
+{
+ elevator_t *e = &q->elevator;
+
+ if (e->elevator_queue_empty_fn)
+ return e->elevator_queue_empty_fn(q);
+
+ return list_empty(&q->queue_head);
+}
+
+inline struct list_head *elv_get_sort_head(request_queue_t *q,
+ struct request *rq)
+{
+ elevator_t *e = &q->elevator;
+
+ if (e->elevator_get_sort_head_fn)
+ return e->elevator_get_sort_head_fn(q, rq);
+
+ return &q->queue_head;
+}
+
elevator_t elevator_linus = {
elevator_merge_fn: elevator_linus_merge,
elevator_merge_cleanup_fn: elevator_linus_merge_cleanup,
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 262808665d82..97e1b16e16fa 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4233,7 +4233,7 @@ int __init floppy_init(void)
raw_cmd = NULL;
devfs_handle = devfs_mk_dir (NULL, "floppy", NULL);
- if (devfs_register_blkdev(MAJOR_NR,"fd",&floppy_fops)) {
+ if (register_blkdev(MAJOR_NR,"fd",&floppy_fops)) {
printk("Unable to get major %d for floppy\n",MAJOR_NR);
return -EBUSY;
}
@@ -4266,7 +4266,7 @@ int __init floppy_init(void)
use_virtual_dma = can_use_virtual_dma & 1;
fdc_state[0].address = FDC1;
if (fdc_state[0].address == -1) {
- devfs_unregister_blkdev(MAJOR_NR,"fd");
+ unregister_blkdev(MAJOR_NR,"fd");
del_timer(&fd_timeout);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
return -ENODEV;
@@ -4279,7 +4279,7 @@ int __init floppy_init(void)
if (floppy_grab_irq_and_dma()){
del_timer(&fd_timeout);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
- devfs_unregister_blkdev(MAJOR_NR,"fd");
+ unregister_blkdev(MAJOR_NR,"fd");
return -EBUSY;
}
@@ -4342,7 +4342,7 @@ int __init floppy_init(void)
if (usage_count)
floppy_release_irq_and_dma();
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
- devfs_unregister_blkdev(MAJOR_NR,"fd");
+ unregister_blkdev(MAJOR_NR,"fd");
}
for (drive = 0; drive < N_DRIVE; drive++) {
@@ -4539,7 +4539,7 @@ void cleanup_module(void)
int dummy;
devfs_unregister (devfs_handle);
- devfs_unregister_blkdev(MAJOR_NR, "fd");
+ unregister_blkdev(MAJOR_NR, "fd");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
/* eject disk, if any */
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index 52bdd58ebdfa..79c8f46da27c 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -1391,7 +1391,6 @@ static void attempt_merge(request_queue_t *q, struct request *req,
if (rq_data_dir(req) != rq_data_dir(next)
|| !kdev_same(req->rq_dev, next->rq_dev)
- || req->nr_sectors + next->nr_sectors > q->max_sectors
|| next->waiting || next->special)
return;
@@ -1402,15 +1401,14 @@ static void attempt_merge(request_queue_t *q, struct request *req,
* counts here.
*/
if (q->merge_requests_fn(q, req, next)) {
- elv_merge_requests(q, req, next);
-
- blkdev_dequeue_request(next);
-
req->biotail->bi_next = next->bio;
req->biotail = next->biotail;
req->nr_sectors = req->hard_nr_sectors += next->hard_nr_sectors;
+ elv_merge_requests(q, req, next);
+
+ blkdev_dequeue_request(next);
blk_put_request(next);
}
}
@@ -1418,16 +1416,18 @@ static void attempt_merge(request_queue_t *q, struct request *req,
static inline void attempt_back_merge(request_queue_t *q, struct request *rq)
{
struct list_head *next = rq->queuelist.next;
+ struct list_head *sort_head = elv_get_sort_head(q, rq);
- if (next != &q->queue_head)
+ if (next != sort_head)
attempt_merge(q, rq, list_entry_rq(next));
}
static inline void attempt_front_merge(request_queue_t *q, struct request *rq)
{
struct list_head *prev = rq->queuelist.prev;
+ struct list_head *sort_head = elv_get_sort_head(q, rq);
- if (prev != &q->queue_head)
+ if (prev != sort_head)
attempt_merge(q, list_entry_rq(prev), rq);
}
@@ -1487,7 +1487,7 @@ static int __make_request(request_queue_t *q, struct bio *bio)
spin_lock_irq(q->queue_lock);
again:
req = NULL;
- insert_here = q->queue_head.prev;
+ insert_here = NULL;
if (blk_queue_empty(q)) {
blk_plug_device(q);
@@ -1505,11 +1505,10 @@ again:
break;
}
- elv_merge_cleanup(q, req, nr_sectors);
-
req->biotail->bi_next = bio;
req->biotail = bio;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
+ elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_back_merge(q, req);
goto out;
@@ -1521,8 +1520,6 @@ again:
break;
}
- elv_merge_cleanup(q, req, nr_sectors);
-
bio->bi_next = req->bio;
req->bio = bio;
/*
@@ -1535,6 +1532,7 @@ again:
req->hard_cur_sectors = cur_nr_sectors;
req->sector = req->hard_sector = sector;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
+ elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_front_merge(q, req);
goto out;
@@ -1603,9 +1601,7 @@ get_rq:
req->buffer = bio_data(bio); /* see ->buffer comment above */
req->waiting = NULL;
req->bio = req->biotail = bio;
- if (bio->bi_bdev)
- req->rq_dev = to_kdev_t(bio->bi_bdev->bd_dev);
- else req->rq_dev = NODEV;
+ req->rq_dev = to_kdev_t(bio->bi_bdev->bd_dev);
add_request(q, req, insert_here);
out:
if (freereq)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 50c1052cae74..8235f3e205ff 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1027,7 +1027,7 @@ int __init loop_init(void)
max_loop = 8;
}
- if (devfs_register_blkdev(MAJOR_NR, "loop", &lo_fops)) {
+ if (register_blkdev(MAJOR_NR, "loop", &lo_fops)) {
printk(KERN_WARNING "Unable to get major number %d for loop"
" device\n", MAJOR_NR);
return -EIO;
@@ -1078,7 +1078,7 @@ out_mem:
void loop_exit(void)
{
devfs_unregister(devfs_handle);
- if (devfs_unregister_blkdev(MAJOR_NR, "loop"))
+ if (unregister_blkdev(MAJOR_NR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");
kfree(loop_dev);
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index f9b681ac6b86..a54a532bc70c 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -940,7 +940,7 @@ static int __init pd_init(void)
int unit;
if (disable) return -1;
- if (devfs_register_blkdev(MAJOR_NR,name,&pd_fops)) {
+ if (register_blkdev(MAJOR_NR,name,&pd_fops)) {
printk("%s: unable to get major number %d\n",
name,major);
return -1;
@@ -958,7 +958,7 @@ static int __init pd_init(void)
pd_init_units();
pd_gendisk.nr_real = pd_detect();
if (!pd_gendisk.nr_real) {
- devfs_unregister_blkdev(MAJOR_NR, name);
+ unregister_blkdev(MAJOR_NR, name);
del_gendisk(&pd_gendisk);
for (unit=0; unit<PD_UNITS; unit++)
if (PD.present)
@@ -971,7 +971,7 @@ static int __init pd_init(void)
static void __exit pd_exit(void)
{
int unit;
- devfs_unregister_blkdev(MAJOR_NR, name);
+ unregister_blkdev(MAJOR_NR, name);
del_gendisk(&pd_gendisk);
for (unit=0; unit<PD_UNITS; unit++)
if (PD.present)
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 0a43b4a5d61b..53650db8bc98 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -637,7 +637,7 @@ static int __init pg_init(void)
if (pg_detect())
return -1;
- if (devfs_register_chrdev(major,name,&pg_fops)) {
+ if (register_chrdev(major,name,&pg_fops)) {
printk("pg_init: unable to get major number %d\n",
major);
for (unit=0;unit<PG_UNITS;unit++)
@@ -656,7 +656,7 @@ static void __exit pg_exit(void)
int unit;
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(major,name);
+ unregister_chrdev(major,name);
for (unit=0;unit<PG_UNITS;unit++)
if (PG.present) pi_release(PI);
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index bc987791fd32..4f1866f36875 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -907,7 +907,7 @@ static int __init pt_init(void)
if (pt_detect())
return -1;
- if (devfs_register_chrdev(major,name,&pt_fops)) {
+ if (register_chrdev(major,name,&pt_fops)) {
printk("pt_init: unable to get major number %d\n",
major);
for (unit=0;unit<PT_UNITS;unit++)
@@ -929,7 +929,7 @@ static void __exit pt_exit(void)
{
int unit;
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(major,name);
+ unregister_chrdev(major,name);
for (unit=0;unit<PT_UNITS;unit++)
if (PT.present)
pi_release(PI);
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 1d734f15cab2..93d5bcf5cb12 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -43,7 +43,6 @@
#include <linux/kernel.h>
#include <linux/genhd.h>
#include <linux/ps2esdi.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/blk.h>
#include <linux/blkpg.h>
#include <linux/mca.h>
@@ -168,7 +167,7 @@ int __init ps2esdi_init(void)
/* register the device - pass the name, major number and operations
vector . */
- if (devfs_register_blkdev(MAJOR_NR, "ed", &ps2esdi_fops)) {
+ if (register_blkdev(MAJOR_NR, "ed", &ps2esdi_fops)) {
printk("%s: Unable to get major number %d\n", DEVICE_NAME, MAJOR_NR);
return -1;
}
@@ -182,7 +181,7 @@ int __init ps2esdi_init(void)
if (error) {
printk(KERN_WARNING "PS2ESDI: error initialising"
" device, releasing resources\n");
- devfs_unregister_blkdev(MAJOR_NR, "ed");
+ unregister_blkdev(MAJOR_NR, "ed");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
del_gendisk(&ps2esdi_gendisk);
blk_clear(MAJOR_NR);
@@ -233,7 +232,7 @@ cleanup_module(void) {
release_region(io_base, 4);
free_dma(dma_arb_level);
free_irq(PS2ESDI_IRQ, &ps2esdi_gendisk);
- devfs_unregister_blkdev(MAJOR_NR, "ed");
+ unregister_blkdev(MAJOR_NR, "ed");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
del_gendisk(&ps2esdi_gendisk);
blk_clear(MAJOR_NR);
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 92180c3c5108..dff2ddec1fa3 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1034,7 +1034,7 @@ int swim3_init(void)
if (floppy_count > 0)
{
- if (devfs_register_blkdev(MAJOR_NR, "fd", &floppy_fops)) {
+ if (register_blkdev(MAJOR_NR, "fd", &floppy_fops)) {
printk(KERN_ERR "Unable to get major %d for floppy\n",
MAJOR_NR);
return -EBUSY;
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index a1166a4e1394..cbb195f05c96 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -164,7 +164,7 @@ int __init xd_init (void)
init_timer (&xd_timer); xd_timer.function = xd_wakeup;
init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog;
- if (devfs_register_blkdev(MAJOR_NR,"xd",&xd_fops)) {
+ if (register_blkdev(MAJOR_NR,"xd",&xd_fops)) {
printk("xd: Unable to get major number %d\n",MAJOR_NR);
return -1;
}
@@ -1085,7 +1085,7 @@ int init_module(void)
printk(KERN_INFO "XD: Loaded as a module.\n");
if (!xd_drives) {
/* no drives detected - unload module */
- devfs_unregister_blkdev(MAJOR_NR, "xd");
+ unregister_blkdev(MAJOR_NR, "xd");
xd_done();
return (-1);
}
@@ -1095,7 +1095,7 @@ int init_module(void)
void cleanup_module(void)
{
- devfs_unregister_blkdev(MAJOR_NR, "xd");
+ unregister_blkdev(MAJOR_NR, "xd");
xd_done();
devfs_unregister (devfs_handle);
if (xd_drives) {
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index 5f8449ce1c6b..8ad58c7b1441 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -1931,7 +1931,7 @@ int __init aztcd_init(void)
}
devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,
S_IFBLK | S_IRUGO | S_IWUGO, &azt_fops, NULL);
- if (devfs_register_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0) {
+ if (register_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0) {
printk(KERN_WARNING "aztcd: Unable to get major %d for Aztech"
" CD-ROM\n", MAJOR_NR);
ret = -EIO;
@@ -1958,7 +1958,7 @@ int __init aztcd_init(void)
void __exit aztcd_exit(void)
{
devfs_find_and_unregister(NULL, "aztcd", 0, 0, DEVFS_SPECIAL_BLK, 0);
- if ((devfs_unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) {
+ if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) {
printk("What's that: can't unregister aztcd\n");
return;
}
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
index b57c880afe27..ab5136e92896 100644
--- a/drivers/cdrom/cdu31a.c
+++ b/drivers/cdrom/cdu31a.c
@@ -3367,7 +3367,7 @@ int __init cdu31a_init(void)
if (!request_region(cdu31a_port, 4, "cdu31a"))
goto errout3;
- if (devfs_register_blkdev(MAJOR_NR, "cdu31a", &scd_bdops)) {
+ if (register_blkdev(MAJOR_NR, "cdu31a", &scd_bdops)) {
printk("Unable to get major %d for CDU-31a\n",
MAJOR_NR);
goto errout2;
@@ -3460,7 +3460,7 @@ int __init cdu31a_init(void)
errout0:
printk("Unable to register CDU-31a with Uniform cdrom driver\n");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
- if (devfs_unregister_blkdev(MAJOR_NR, "cdu31a")) {
+ if (unregister_blkdev(MAJOR_NR, "cdu31a")) {
printk("Can't unregister block device for cdu31a\n");
}
errout2:
@@ -3477,7 +3477,7 @@ void __exit cdu31a_exit(void)
("Can't unregister cdu31a from Uniform cdrom driver\n");
return;
}
- if ((devfs_unregister_blkdev(MAJOR_NR, "cdu31a") == -EINVAL)) {
+ if ((unregister_blkdev(MAJOR_NR, "cdu31a") == -EINVAL)) {
printk("Can't unregister cdu31a\n");
return;
}
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index 0b5facfd1c28..9d6b0767e1bd 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -1367,7 +1367,7 @@ static void cleanup(int level)
printk("Can't unregister cdrom cm206\n");
return;
}
- if (devfs_unregister_blkdev(MAJOR_NR, "cm206")) {
+ if (unregister_blkdev(MAJOR_NR, "cm206")) {
printk("Can't unregister major cm206\n");
return;
}
@@ -1490,7 +1490,7 @@ int __init cm206_init(void)
return -EIO;
}
printk(".\n");
- if (devfs_register_blkdev(MAJOR_NR, "cm206", &cm206_bdops) != 0) {
+ if (register_blkdev(MAJOR_NR, "cm206", &cm206_bdops) != 0) {
printk(KERN_INFO "Cannot register for major %d!\n",
MAJOR_NR);
cleanup(3);
diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c
index 90f510585cb4..b37b983eeaad 100644
--- a/drivers/cdrom/gscd.c
+++ b/drivers/cdrom/gscd.c
@@ -934,7 +934,7 @@ void __exit exit_gscd(void)
CLEAR_TIMER;
devfs_find_and_unregister(NULL, "gscd", 0, 0, DEVFS_SPECIAL_BLK, 0);
- if ((devfs_unregister_blkdev(MAJOR_NR, "gscd") == -EINVAL)) {
+ if ((unregister_blkdev(MAJOR_NR, "gscd") == -EINVAL)) {
printk("What's that: can't unregister GoldStar-module\n");
return;
}
@@ -1012,7 +1012,7 @@ int __init my_gscd_init(void)
i++;
}
- if (devfs_register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0) {
+ if (register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0) {
printk(KERN_WARNING "GSCD: Unable to get major %d for GoldStar "
"CD-ROM\n", MAJOR_NR);
ret = -EIO;
diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c
index a948dbcac9ea..c4db9209059d 100644
--- a/drivers/cdrom/mcd.c
+++ b/drivers/cdrom/mcd.c
@@ -1039,7 +1039,7 @@ static void cleanup(int level)
case 2:
release_region(mcd_port, 4);
case 1:
- if (devfs_unregister_blkdev(MAJOR_NR, "mcd")) {
+ if (unregister_blkdev(MAJOR_NR, "mcd")) {
printk(KERN_WARNING "Can't unregister major mcd\n");
return;
}
@@ -1065,7 +1065,7 @@ int __init mcd_init(void)
return -EIO;
}
- if (devfs_register_blkdev(MAJOR_NR, "mcd", &mcd_bdops) != 0) {
+ if (register_blkdev(MAJOR_NR, "mcd", &mcd_bdops) != 0) {
printk(KERN_ERR "mcd: Unable to get major %d for Mitsumi CD-ROM\n", MAJOR_NR);
return -EIO;
}
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index 922bcd644048..7567fb2a6dc1 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -1166,7 +1166,7 @@ int __init mcdx_init_drive(int drive)
}
xtrace(INIT, "init() register blkdev\n");
- if (devfs_register_blkdev(MAJOR_NR, "mcdx", &mcdx_bdops) != 0) {
+ if (register_blkdev(MAJOR_NR, "mcdx", &mcdx_bdops) != 0) {
release_region((unsigned long) stuffp->wreg_data,
MCDX_IO_SIZE);
xwarn("%s=0x%3p,%d: Init failed. Can't get major %d.\n",
@@ -1222,7 +1222,7 @@ int __init mcdx_init_drive(int drive)
MCDX_IO_SIZE);
free_irq(stuffp->irq, NULL);
kfree(stuffp);
- if (devfs_unregister_blkdev(MAJOR_NR, "mcdx") != 0)
+ if (unregister_blkdev(MAJOR_NR, "mcdx") != 0)
xwarn("cleanup() unregister_blkdev() failed\n");
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
return 2;
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index b8a6aa0e991a..cb5a01220b25 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -2031,8 +2031,7 @@ int __init optcd_init(void)
DEBUG((DEBUG_VFS, "exec_cmd COMINITDOUBLE: %02x", -status));
return -EIO;
}
- if (devfs_register_blkdev(MAJOR_NR, "optcd", &opt_fops) != 0)
- {
+ if (register_blkdev(MAJOR_NR, "optcd", &opt_fops) != 0) {
printk(KERN_ERR "optcd: unable to get major %d\n", MAJOR_NR);
release_region(optcd_port, 4);
return -EIO;
@@ -2052,7 +2051,7 @@ int __init optcd_init(void)
void __exit optcd_exit(void)
{
devfs_find_and_unregister(NULL, "optcd", 0, 0, DEVFS_SPECIAL_BLK, 0);
- if (devfs_unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) {
+ if (unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) {
printk(KERN_ERR "optcd: what's that: can't unregister\n");
return;
}
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index 937c5f444828..c822f2d3546e 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -5771,7 +5771,7 @@ int __init sbpcd_init(void)
OUT(MIXER_data,0xCC); /* one nibble per channel, max. value: 0xFF */
#endif /* SOUND_BASE */
- if (devfs_register_blkdev(MAJOR_NR, major_name, &sbpcd_bdops) != 0)
+ if (register_blkdev(MAJOR_NR, major_name, &sbpcd_bdops) != 0)
{
msg(DBG_INF, "Can't get MAJOR %d for Matsushita CDROM\n", MAJOR_NR);
#ifdef MODULE
@@ -5806,7 +5806,7 @@ int __init sbpcd_init(void)
if (D_S[j].sbp_buf==NULL)
{
msg(DBG_INF,"data buffer (%d frames) not available.\n",D_S[j].sbp_bufsiz);
- if ((devfs_unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
+ if ((unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
{
printk("Can't unregister %s\n", major_name);
}
@@ -5858,7 +5858,7 @@ void sbpcd_exit(void)
{
int j;
- if ((devfs_unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
+ if ((unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
{
msg(DBG_INF, "What's that: can't unregister %s.\n", major_name);
return;
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
index 0619f9f58ceb..e152f72a2a15 100644
--- a/drivers/cdrom/sjcd.c
+++ b/drivers/cdrom/sjcd.c
@@ -1680,7 +1680,7 @@ int __init sjcd_init(void)
printk("SJCD: sjcd=0x%x: ", sjcd_base);
#endif
- if (devfs_register_blkdev(MAJOR_NR, "sjcd", &sjcd_fops) != 0) {
+ if (register_blkdev(MAJOR_NR, "sjcd", &sjcd_fops) != 0) {
printk("SJCD: Unable to get major %d for Sanyo CD-ROM\n",
MAJOR_NR);
return (-EIO);
@@ -1789,7 +1789,7 @@ int __init sjcd_init(void)
static int sjcd_cleanup(void)
{
- if ((devfs_unregister_blkdev(MAJOR_NR, "sjcd") == -EINVAL))
+ if ((unregister_blkdev(MAJOR_NR, "sjcd") == -EINVAL))
printk("SJCD: cannot unregister device.\n");
else {
release_region(sjcd_base, 4);
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index 46865fc9a162..b244be024ec7 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -1572,7 +1572,7 @@ sony535_init(void)
MAJOR_NR, 0,
S_IFBLK | S_IRUGO | S_IWUGO,
&cdu_fops, NULL);
- if (devfs_register_blkdev(MAJOR_NR, CDU535_HANDLE, &cdu_fops)) {
+ if (register_blkdev(MAJOR_NR, CDU535_HANDLE, &cdu_fops)) {
printk("Unable to get major %d for %s\n",
MAJOR_NR, CDU535_MESSAGE_NAME);
return -EIO;
@@ -1585,7 +1585,7 @@ sony535_init(void)
kmalloc(sizeof *sony_toc, GFP_KERNEL);
if (sony_toc == NULL) {
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
- devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
+ unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
devfs_unregister(sony_devfs_handle);
return -ENOMEM;
}
@@ -1594,7 +1594,7 @@ sony535_init(void)
if (last_sony_subcode == NULL) {
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
kfree(sony_toc);
- devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
+ unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
devfs_unregister(sony_devfs_handle);
return -ENOMEM;
}
@@ -1604,7 +1604,7 @@ sony535_init(void)
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
kfree(sony_toc);
kfree(last_sony_subcode);
- devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
+ unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
devfs_unregister(sony_devfs_handle);
return -ENOMEM;
}
@@ -1618,7 +1618,7 @@ sony535_init(void)
kfree(sony_buffer);
kfree(sony_toc);
kfree(last_sony_subcode);
- devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
+ unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
devfs_unregister(sony_devfs_handle);
return -ENOMEM;
}
@@ -1643,7 +1643,7 @@ sony535_init(void)
kfree(sony_buffer);
kfree(sony_toc);
kfree(last_sony_subcode);
- devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
+ unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
devfs_unregister(sony_devfs_handle);
if (sony535_irq_used)
free_irq(sony535_irq_used, NULL);
@@ -1702,7 +1702,7 @@ sony535_exit(void)
kfree(sony_toc);
devfs_find_and_unregister(NULL, CDU535_HANDLE, 0, 0,
DEVFS_SPECIAL_BLK, 0);
- if (devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE) == -EINVAL)
+ if (unregister_blkdev(MAJOR_NR, CDU535_HANDLE) == -EINVAL)
printk("Uh oh, couldn't unregister " CDU535_HANDLE "\n");
else
printk(KERN_INFO CDU535_HANDLE " module released\n");
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
index ba2602e73b50..1f5d9675583a 100644
--- a/drivers/char/drm/mga_drv.h
+++ b/drivers/char/drm/mga_drv.h
@@ -38,7 +38,7 @@ typedef struct drm_mga_primary_buffer {
u32 tail;
int space;
- volatile int wrapped;
+ volatile long wrapped;
volatile u32 *status;
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index c964b569878a..eefbe009c6f0 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -510,7 +510,7 @@ static int __init dsp56k_init_driver(void)
return -ENODEV;
}
- if(devfs_register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
+ if(register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
printk("DSP56k driver: Unable to register driver\n");
return -ENODEV;
}
@@ -526,7 +526,7 @@ module_init(dsp56k_init_driver);
static void __exit dsp56k_cleanup_driver(void)
{
- devfs_unregister_chrdev(DSP56K_MAJOR, "dsp56k");
+ unregister_chrdev(DSP56K_MAJOR, "dsp56k");
devfs_unregister(devfs_handle);
}
module_exit(dsp56k_cleanup_driver);
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index f8394c5f9288..82f5be2cf0de 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -340,7 +340,7 @@ static int __init dtlk_init(void)
dtlk_port_lpc = 0;
dtlk_port_tts = 0;
dtlk_busy = 0;
- dtlk_major = devfs_register_chrdev(0, "dtlk", &dtlk_fops);
+ dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops);
if (dtlk_major == 0) {
printk(KERN_ERR "DoubleTalk PC - cannot register device\n");
return 0;
@@ -369,7 +369,7 @@ static void __exit dtlk_cleanup (void)
signals... */
dtlk_write_tts(DTLK_CLEAR);
- devfs_unregister_chrdev(dtlk_major, "dtlk");
+ unregister_chrdev(dtlk_major, "dtlk");
devfs_unregister(devfs_handle);
release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
}
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index 4e2621270d0e..8d120c757ae3 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -67,7 +67,7 @@ const ftape_info *zft_status;
/* Local vars.
*/
-static int busy_flag;
+static unsigned long busy_flag;
static sigset_t orig_sigmask;
@@ -345,7 +345,7 @@ KERN_INFO
TRACE(ft_t_info, "zft_init @ 0x%p", zft_init);
TRACE(ft_t_info,
"installing zftape VFS interface for ftape driver ...");
- TRACE_CATCH(devfs_register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
+ TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
for (i = 0; i < 4; i++) {
char devname[9];
@@ -419,7 +419,7 @@ void cleanup_module(void)
TRACE_FUN(ft_t_flow);
- if (devfs_unregister_chrdev(QIC117_TAPE_MAJOR, "zft") != 0) {
+ if (unregister_chrdev(QIC117_TAPE_MAJOR, "zft") != 0) {
TRACE(ft_t_warn, "failed");
} else {
TRACE(ft_t_info, "successful");
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index 007a970c9623..a956deb09a6d 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -531,12 +531,7 @@ cleanup_module(void)
if ( ( err = tty_unregister_driver ( &ip2_callout_driver ) ) ) {
printk(KERN_ERR "IP2: failed to unregister callout driver (%d)\n", err);
}
-#ifdef CONFIG_DEVFS_FS
- if ( ( err = devfs_unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) )
-#else
- if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) )
-#endif
- {
+ if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) ) {
printk(KERN_ERR "IP2: failed to unregister IPL driver (%d)\n", err);
}
remove_proc_entry("ip2mem", &proc_root);
@@ -866,12 +861,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
printk(KERN_ERR "IP2: failed to register callout driver (%d)\n", err);
} else
/* Register the IPL driver. */
-#ifdef CONFIG_DEVFS_FS
- if (( err = devfs_register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl )))
-#else
- if ( ( err = register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl ) ) )
-#endif
- {
+ if ( ( err = register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl ) ) ) {
printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
} else
/* Register the read_procmem thing */
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index a2b10e0bc4fe..0bd3573facc0 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -869,7 +869,7 @@ void cleanup_module()
return;
}
devfs_unregister (devfs_handle);
- if ((i = devfs_unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
+ if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, "
"errno=%d\n", -i);
if (stli_tmpwritebuf != (char *) NULL)
@@ -5329,7 +5329,7 @@ int __init stli_init(void)
* Set up a character driver for the shared memory region. We need this
* to down load the slave code image. Also it is a useful debugging tool.
*/
- if (devfs_register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stli_fsiomem))
+ if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stli_fsiomem))
printk(KERN_ERR "STALLION: failed to register serial memory "
"device\n");
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 618664b56d28..d9360bb453a3 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -903,7 +903,7 @@ int __init lp_init (void)
lp_table[i].timeout = 10 * HZ;
}
- if (devfs_register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
+ if (register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
printk ("lp: unable to get major %d\n", LP_MAJOR);
return -EIO;
}
@@ -965,7 +965,7 @@ static void lp_cleanup_module (void)
#endif
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(LP_MAJOR, "lp");
+ unregister_chrdev(LP_MAJOR, "lp");
for (offset = 0; offset < LP_NO; offset++) {
if (lp_table[offset].dev == NULL)
continue;
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 07af77b4ad12..611aad3bbfc6 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -651,7 +651,7 @@ static struct file_operations memory_fops = {
int __init chr_dev_init(void)
{
- if (devfs_register_chrdev(MEM_MAJOR,"mem",&memory_fops))
+ if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
printk("unable to get major %d for memory devs\n", MEM_MAJOR);
memory_devfs_register();
rand_initialize();
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index e410c4a65a79..2149e30bbca2 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -281,7 +281,7 @@ int __init misc_init(void)
#ifdef CONFIG_I8K
i8k_init();
#endif
- if (devfs_register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
+ if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
printk("unable to get major %d for misc devices\n",
MISC_MAJOR);
return -EIO;
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 76ee4a4926d0..08402199fd5a 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -38,12 +38,12 @@
#include <linux/smp_lock.h>
#define PC 1
-#define ATARI 2
+#define ATARI 2
/* select machine configuration */
#if defined(CONFIG_ATARI)
#define MACH ATARI
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */
+#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */
#define MACH PC
#else
#error Cannot build nvram driver for this machine configuration.
@@ -52,12 +52,12 @@
#if MACH == PC
/* RTC in a PC */
-#define CHECK_DRIVER_INIT() 1
+#define CHECK_DRIVER_INIT() 1
/* On PCs, the checksum is built only over bytes 2..31 */
#define PC_CKS_RANGE_START 2
#define PC_CKS_RANGE_END 31
-#define PC_CKS_LOC 32
+#define PC_CKS_LOC 32
#define mach_check_checksum pc_check_checksum
#define mach_set_checksum pc_set_checksum
@@ -70,14 +70,14 @@
/* Special parameters for RTC in Atari machines */
#include <asm/atarihw.h>
#include <asm/atariints.h>
-#define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
-#define CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
+#define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
+#define CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
/* On Ataris, the checksum is over all bytes except the checksum bytes
* themselves; these are at the very end */
#define ATARI_CKS_RANGE_START 0
-#define ATARI_CKS_RANGE_END 47
-#define ATARI_CKS_LOC 48
+#define ATARI_CKS_RANGE_END 47
+#define ATARI_CKS_LOC 48
#define mach_check_checksum atari_check_checksum
#define mach_set_checksum atari_set_checksum
@@ -109,46 +109,50 @@
static int nvram_open_cnt; /* #times opened */
static int nvram_open_mode; /* special open modes */
-static spinlock_t nvram_open_lock = SPIN_LOCK_UNLOCKED;
- /* guards nvram_open_cnt and
- nvram_open_mode */
-#define NVRAM_WRITE 1 /* opened for writing (exclusive) */
-#define NVRAM_EXCL 2 /* opened with O_EXCL */
+static spinlock_t nvram_open_lock = SPIN_LOCK_UNLOCKED; /* guards
+ * nvram_open_cnt and
+ * nvram_open_mode */
+#define NVRAM_WRITE 1 /* opened for writing (exclusive) */
+#define NVRAM_EXCL 2 /* opened with O_EXCL */
-#define RTC_FIRST_BYTE 14 /* RTC register number of first NVRAM byte */
-#define NVRAM_BYTES 128-RTC_FIRST_BYTE /* number of NVRAM bytes */
+#define RTC_FIRST_BYTE 14 /* RTC register number of first
+ * NVRAM byte */
+#define NVRAM_BYTES 128-RTC_FIRST_BYTE /* number of NVRAM bytes */
+static int mach_check_checksum(void);
+static void mach_set_checksum(void);
-static int mach_check_checksum( void );
-static void mach_set_checksum( void );
#ifdef CONFIG_PROC_FS
-static int mach_proc_infos( unsigned char *contents, char *buffer, int *len,
- off_t *begin, off_t offset, int size );
+static int mach_proc_infos(unsigned char *contents, char *buffer, int *len,
+ off_t *begin, off_t offset, int size);
#endif
-
/*
* These are the internal NVRAM access functions, which do NOT disable
* interrupts and do not check the checksum. Both tasks are left to higher
* level function, so they need to be done only once per syscall.
*/
-static __inline__ unsigned char nvram_read_int( int i )
+static __inline__ unsigned char
+nvram_read_int(int i)
{
- return( CMOS_READ( RTC_FIRST_BYTE+i ) );
+ return CMOS_READ(RTC_FIRST_BYTE + i);
}
-static __inline__ void nvram_write_int( unsigned char c, int i )
+static __inline__ void
+nvram_write_int(unsigned char c, int i)
{
- CMOS_WRITE( c, RTC_FIRST_BYTE+i );
+ CMOS_WRITE(c, RTC_FIRST_BYTE + i);
}
-static __inline__ int nvram_check_checksum_int( void )
+static __inline__ int
+nvram_check_checksum_int(void)
{
- return( mach_check_checksum() );
+ return mach_check_checksum();
}
-static __inline__ void nvram_set_checksum_int( void )
+static __inline__ void
+nvram_set_checksum_int(void)
{
mach_set_checksum();
}
@@ -166,178 +170,183 @@ static __inline__ void nvram_set_checksum_int( void )
* module), so they access config information themselves.
*/
-unsigned char nvram_read_byte( int i )
+unsigned char
+nvram_read_byte(int i)
{
unsigned long flags;
unsigned char c;
- spin_lock_irqsave (&rtc_lock, flags);
- c = nvram_read_int( i );
- spin_unlock_irqrestore (&rtc_lock, flags);
- return( c );
+ spin_lock_irqsave(&rtc_lock, flags);
+ c = nvram_read_int(i);
+ spin_unlock_irqrestore(&rtc_lock, flags);
+ return c;
}
/* This races nicely with trying to read with checksum checking (nvram_read) */
-void nvram_write_byte( unsigned char c, int i )
+void
+nvram_write_byte(unsigned char c, int i)
{
unsigned long flags;
- spin_lock_irqsave (&rtc_lock, flags);
- nvram_write_int( c, i );
- spin_unlock_irqrestore (&rtc_lock, flags);
+ spin_lock_irqsave(&rtc_lock, flags);
+ nvram_write_int(c, i);
+ spin_unlock_irqrestore(&rtc_lock, flags);
}
-int nvram_check_checksum( void )
+int
+nvram_check_checksum(void)
{
unsigned long flags;
int rv;
- spin_lock_irqsave (&rtc_lock, flags);
+ spin_lock_irqsave(&rtc_lock, flags);
rv = nvram_check_checksum_int();
- spin_unlock_irqrestore (&rtc_lock, flags);
- return( rv );
+ spin_unlock_irqrestore(&rtc_lock, flags);
+ return rv;
}
-void nvram_set_checksum( void )
+void
+nvram_set_checksum(void)
{
unsigned long flags;
- spin_lock_irqsave (&rtc_lock, flags);
+ spin_lock_irqsave(&rtc_lock, flags);
nvram_set_checksum_int();
- spin_unlock_irqrestore (&rtc_lock, flags);
+ spin_unlock_irqrestore(&rtc_lock, flags);
}
#endif /* MACH == ATARI */
-
/*
* The are the file operation function for user access to /dev/nvram
*/
-static long long nvram_llseek(struct file *file,loff_t offset, int origin )
+static long long
+nvram_llseek(struct file *file, loff_t offset, int origin)
{
lock_kernel();
- switch( origin ) {
- case 0:
+ switch (origin) {
+ case 0:
/* nothing to do */
break;
- case 1:
+ case 1:
offset += file->f_pos;
break;
- case 2:
+ case 2:
offset += NVRAM_BYTES;
break;
}
unlock_kernel();
- return( (offset >= 0) ? (file->f_pos = offset) : -EINVAL );
+ return (offset >= 0) ? (file->f_pos = offset) : -EINVAL;
}
-static ssize_t nvram_read(struct file * file,
- char * buf, size_t count, loff_t *ppos )
+static ssize_t
+nvram_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
- char contents [NVRAM_BYTES];
+ char contents[NVRAM_BYTES];
unsigned i = *ppos;
char *tmp;
- spin_lock_irq (&rtc_lock);
-
+ spin_lock_irq(&rtc_lock);
+
if (!nvram_check_checksum_int())
goto checksum_err;
for (tmp = contents; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp)
*tmp = nvram_read_int(i);
- spin_unlock_irq (&rtc_lock);
+ spin_unlock_irq(&rtc_lock);
- if (copy_to_user (buf, contents, tmp - contents))
+ if (copy_to_user(buf, contents, tmp - contents))
return -EFAULT;
*ppos = i;
- return (tmp - contents);
+ return tmp - contents;
-checksum_err:
- spin_unlock_irq (&rtc_lock);
+ checksum_err:
+ spin_unlock_irq(&rtc_lock);
return -EIO;
}
-static ssize_t nvram_write(struct file * file,
- const char * buf, size_t count, loff_t *ppos )
+static ssize_t
+nvram_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
- char contents [NVRAM_BYTES];
+ char contents[NVRAM_BYTES];
unsigned i = *ppos;
- char * tmp;
+ char *tmp;
- if (copy_from_user (contents, buf, (NVRAM_BYTES - i) < count ?
- (NVRAM_BYTES - i) : count))
+ if (copy_from_user(contents, buf, (NVRAM_BYTES - i) < count ?
+ (NVRAM_BYTES - i) : count))
return -EFAULT;
- spin_lock_irq (&rtc_lock);
+ spin_lock_irq(&rtc_lock);
if (!nvram_check_checksum_int())
goto checksum_err;
for (tmp = contents; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp)
- nvram_write_int (*tmp, i);
+ nvram_write_int(*tmp, i);
nvram_set_checksum_int();
- spin_unlock_irq (&rtc_lock);
+ spin_unlock_irq(&rtc_lock);
*ppos = i;
- return (tmp - contents);
+ return tmp - contents;
-checksum_err:
- spin_unlock_irq (&rtc_lock);
+ checksum_err:
+ spin_unlock_irq(&rtc_lock);
return -EIO;
}
-static int nvram_ioctl( struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg )
+static int
+nvram_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
{
int i;
-
- switch( cmd ) {
- case NVRAM_INIT: /* initialize NVRAM contents and checksum */
+ switch (cmd) {
+
+ case NVRAM_INIT: /* initialize NVRAM contents and checksum */
if (!capable(CAP_SYS_ADMIN))
- return( -EACCES );
+ return -EACCES;
- spin_lock_irq (&rtc_lock);
+ spin_lock_irq(&rtc_lock);
- for( i = 0; i < NVRAM_BYTES; ++i )
- nvram_write_int( 0, i );
+ for (i = 0; i < NVRAM_BYTES; ++i)
+ nvram_write_int(0, i);
nvram_set_checksum_int();
-
- spin_unlock_irq (&rtc_lock);
- return( 0 );
-
- case NVRAM_SETCKS: /* just set checksum, contents unchanged
- * (maybe useful after checksum garbaged
- * somehow...) */
+
+ spin_unlock_irq(&rtc_lock);
+ return 0;
+
+ case NVRAM_SETCKS: /* just set checksum, contents unchanged
+ * (maybe useful after checksum garbaged
+ * somehow...) */
if (!capable(CAP_SYS_ADMIN))
- return( -EACCES );
+ return -EACCES;
- spin_lock_irq (&rtc_lock);
+ spin_lock_irq(&rtc_lock);
nvram_set_checksum_int();
- spin_unlock_irq (&rtc_lock);
- return( 0 );
+ spin_unlock_irq(&rtc_lock);
+ return 0;
- default:
- return( -ENOTTY );
+ default:
+ return -ENOTTY;
}
}
-static int nvram_open( struct inode *inode, struct file *file )
+static int
+nvram_open(struct inode *inode, struct file *file)
{
- spin_lock( &nvram_open_lock );
+ spin_lock(&nvram_open_lock);
if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
- (nvram_open_mode & NVRAM_EXCL) ||
- ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE)))
- {
- spin_unlock( &nvram_open_lock );
- return( -EBUSY );
+ (nvram_open_mode & NVRAM_EXCL) ||
+ ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
+ spin_unlock(&nvram_open_lock);
+ return -EBUSY;
}
if (file->f_flags & O_EXCL)
@@ -345,60 +354,65 @@ static int nvram_open( struct inode *inode, struct file *file )
if (file->f_mode & 2)
nvram_open_mode |= NVRAM_WRITE;
nvram_open_cnt++;
- spin_unlock( &nvram_open_lock );
- return( 0 );
+ spin_unlock(&nvram_open_lock);
+ return 0;
}
-static int nvram_release( struct inode *inode, struct file *file )
+static int
+nvram_release(struct inode *inode, struct file *file)
{
- spin_lock( &nvram_open_lock );
+ spin_lock(&nvram_open_lock);
nvram_open_cnt--;
if (file->f_flags & O_EXCL)
nvram_open_mode &= ~NVRAM_EXCL;
if (file->f_mode & 2)
nvram_open_mode &= ~NVRAM_WRITE;
- spin_unlock( &nvram_open_lock );
- return( 0 );
+ spin_unlock(&nvram_open_lock);
+ return 0;
}
-
#ifndef CONFIG_PROC_FS
-static int nvram_read_proc( char *buffer, char **start, off_t offset,
- int size, int *eof, void *data) { return 0; }
+static int
+nvram_read_proc(char *buffer, char **start, off_t offset,
+ int size, int *eof, void *data)
+{
+ return 0;
+}
#else
-static int nvram_read_proc( char *buffer, char **start, off_t offset,
- int size, int *eof, void *data )
+static int
+nvram_read_proc(char *buffer, char **start, off_t offset,
+ int size, int *eof, void *data)
{
unsigned char contents[NVRAM_BYTES];
- int i, len = 0;
- off_t begin = 0;
-
- spin_lock_irq (&rtc_lock);
- for( i = 0; i < NVRAM_BYTES; ++i )
- contents[i] = nvram_read_int( i );
- spin_unlock_irq (&rtc_lock);
-
- *eof = mach_proc_infos( contents, buffer, &len, &begin, offset, size );
-
- if (offset >= begin + len)
- return( 0 );
- *start = buffer + (offset - begin);
- return( size < begin + len - offset ? size : begin + len - offset );
-
+ int i, len = 0;
+ off_t begin = 0;
+
+ spin_lock_irq(&rtc_lock);
+ for (i = 0; i < NVRAM_BYTES; ++i)
+ contents[i] = nvram_read_int(i);
+ spin_unlock_irq(&rtc_lock);
+
+ *eof = mach_proc_infos(contents, buffer, &len, &begin, offset, size);
+
+ if (offset >= begin + len)
+ return 0;
+ *start = buffer + (offset - begin);
+ return (size < begin + len - offset) ? size : begin + len - offset;
+
}
/* This macro frees the machine specific function from bounds checking and
* this like that... */
-#define PRINT_PROC(fmt,args...) \
- do { \
- *len += sprintf( buffer+*len, fmt, ##args ); \
- if (*begin + *len > offset + size) \
- return( 0 ); \
- if (*begin + *len < offset) { \
- *begin += *len; \
- *len = 0; \
- } \
+#define PRINT_PROC(fmt,args...) \
+ do { \
+ *len += sprintf(buffer+*len, fmt, ##args); \
+ if (*begin + *len > offset + size) \
+ return 0; \
+ if (*begin + *len < offset) { \
+ *begin += *len; \
+ *len = 0; \
+ } \
} while(0)
#endif /* CONFIG_PROC_FS */
@@ -419,72 +433,74 @@ static struct miscdevice nvram_dev = {
&nvram_fops
};
-
-static int __init nvram_init(void)
+static int __init
+nvram_init(void)
{
int ret;
/* First test whether the driver should init at all */
if (!CHECK_DRIVER_INIT())
- return( -ENXIO );
+ return -ENXIO;
- ret = misc_register( &nvram_dev );
+ ret = misc_register(&nvram_dev);
if (ret) {
- printk(KERN_ERR "nvram: can't misc_register on minor=%d\n", NVRAM_MINOR);
+ printk(KERN_ERR "nvram: can't misc_register on minor=%d\n",
+ NVRAM_MINOR);
goto out;
}
- if (!create_proc_read_entry("driver/nvram",0,0,nvram_read_proc,NULL)) {
+ if (!create_proc_read_entry("driver/nvram", 0, 0, nvram_read_proc,
+ NULL)) {
printk(KERN_ERR "nvram: can't create /proc/driver/nvram\n");
ret = -ENOMEM;
goto outmisc;
}
ret = 0;
printk(KERN_INFO "Non-volatile memory driver v" NVRAM_VERSION "\n");
-out:
- return( ret );
-outmisc:
- misc_deregister( &nvram_dev );
+ out:
+ return ret;
+ outmisc:
+ misc_deregister(&nvram_dev);
goto out;
}
-static void __exit nvram_cleanup_module (void)
+static void __exit
+nvram_cleanup_module(void)
{
- remove_proc_entry( "driver/nvram", 0 );
- misc_deregister( &nvram_dev );
+ remove_proc_entry("driver/nvram", 0);
+ misc_deregister(&nvram_dev);
}
module_init(nvram_init);
module_exit(nvram_cleanup_module);
-
/*
* Machine specific functions
*/
-
#if MACH == PC
-static int pc_check_checksum( void )
+static int
+pc_check_checksum(void)
{
int i;
unsigned short sum = 0;
-
- for( i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i )
- sum += nvram_read_int( i );
- return( (sum & 0xffff) ==
- ((nvram_read_int(PC_CKS_LOC) << 8) |
- nvram_read_int(PC_CKS_LOC+1)) );
+
+ for (i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i)
+ sum += nvram_read_int(i);
+ return ((sum & 0xffff) ==
+ ((nvram_read_int(PC_CKS_LOC)<<8) | nvram_read_int(PC_CKS_LOC+1)));
}
-static void pc_set_checksum( void )
+static void
+pc_set_checksum(void)
{
int i;
unsigned short sum = 0;
-
- for( i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i )
- sum += nvram_read_int( i );
- nvram_write_int( sum >> 8, PC_CKS_LOC );
- nvram_write_int( sum & 0xff, PC_CKS_LOC+1 );
+
+ for (i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i)
+ sum += nvram_read_int(i);
+ nvram_write_int(sum >> 8, PC_CKS_LOC);
+ nvram_write_int(sum & 0xff, PC_CKS_LOC + 1);
}
#ifdef CONFIG_PROC_FS
@@ -501,69 +517,67 @@ static char *gfx_types[] = {
"monochrome",
};
-static int pc_proc_infos( unsigned char *nvram, char *buffer, int *len,
- off_t *begin, off_t offset, int size )
+static int
+pc_proc_infos(unsigned char *nvram, char *buffer, int *len,
+ off_t *begin, off_t offset, int size)
{
int checksum;
int type;
- spin_lock_irq (&rtc_lock);
+ spin_lock_irq(&rtc_lock);
checksum = nvram_check_checksum_int();
- spin_unlock_irq (&rtc_lock);
+ spin_unlock_irq(&rtc_lock);
- PRINT_PROC( "Checksum status: %svalid\n", checksum ? "" : "not " );
+ PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not ");
- PRINT_PROC( "# floppies : %d\n",
- (nvram[6] & 1) ? (nvram[6] >> 6) + 1 : 0 );
- PRINT_PROC( "Floppy 0 type : " );
+ PRINT_PROC("# floppies : %d\n",
+ (nvram[6] & 1) ? (nvram[6] >> 6) + 1 : 0);
+ PRINT_PROC("Floppy 0 type : ");
type = nvram[2] >> 4;
- if (type < sizeof(floppy_types)/sizeof(*floppy_types))
- PRINT_PROC( "%s\n", floppy_types[type] );
+ if (type < sizeof (floppy_types) / sizeof (*floppy_types))
+ PRINT_PROC("%s\n", floppy_types[type]);
else
- PRINT_PROC( "%d (unknown)\n", type );
- PRINT_PROC( "Floppy 1 type : " );
+ PRINT_PROC("%d (unknown)\n", type);
+ PRINT_PROC("Floppy 1 type : ");
type = nvram[2] & 0x0f;
- if (type < sizeof(floppy_types)/sizeof(*floppy_types))
- PRINT_PROC( "%s\n", floppy_types[type] );
+ if (type < sizeof (floppy_types) / sizeof (*floppy_types))
+ PRINT_PROC("%s\n", floppy_types[type]);
else
- PRINT_PROC( "%d (unknown)\n", type );
+ PRINT_PROC("%d (unknown)\n", type);
- PRINT_PROC( "HD 0 type : " );
+ PRINT_PROC("HD 0 type : ");
type = nvram[4] >> 4;
if (type)
- PRINT_PROC( "%02x\n", type == 0x0f ? nvram[11] : type );
+ PRINT_PROC("%02x\n", type == 0x0f ? nvram[11] : type);
else
- PRINT_PROC( "none\n" );
+ PRINT_PROC("none\n");
- PRINT_PROC( "HD 1 type : " );
+ PRINT_PROC("HD 1 type : ");
type = nvram[4] & 0x0f;
if (type)
- PRINT_PROC( "%02x\n", type == 0x0f ? nvram[12] : type );
+ PRINT_PROC("%02x\n", type == 0x0f ? nvram[12] : type);
else
- PRINT_PROC( "none\n" );
-
- PRINT_PROC( "HD type 48 data: %d/%d/%d C/H/S, precomp %d, lz %d\n",
- nvram[18] | (nvram[19] << 8),
- nvram[20], nvram[25],
- nvram[21] | (nvram[22] << 8),
- nvram[23] | (nvram[24] << 8) );
- PRINT_PROC( "HD type 49 data: %d/%d/%d C/H/S, precomp %d, lz %d\n",
- nvram[39] | (nvram[40] << 8),
- nvram[41], nvram[46],
- nvram[42] | (nvram[43] << 8),
- nvram[44] | (nvram[45] << 8) );
-
- PRINT_PROC( "DOS base memory: %d kB\n", nvram[7] | (nvram[8] << 8) );
- PRINT_PROC( "Extended memory: %d kB (configured), %d kB (tested)\n",
- nvram[9] | (nvram[10] << 8),
- nvram[34] | (nvram[35] << 8) );
-
- PRINT_PROC( "Gfx adapter : %s\n", gfx_types[ (nvram[6] >> 4)&3 ] );
-
- PRINT_PROC( "FPU : %sinstalled\n",
- (nvram[6] & 2) ? "" : "not " );
-
- return( 1 );
+ PRINT_PROC("none\n");
+
+ PRINT_PROC("HD type 48 data: %d/%d/%d C/H/S, precomp %d, lz %d\n",
+ nvram[18] | (nvram[19] << 8),
+ nvram[20], nvram[25],
+ nvram[21] | (nvram[22] << 8), nvram[23] | (nvram[24] << 8));
+ PRINT_PROC("HD type 49 data: %d/%d/%d C/H/S, precomp %d, lz %d\n",
+ nvram[39] | (nvram[40] << 8),
+ nvram[41], nvram[46],
+ nvram[42] | (nvram[43] << 8), nvram[44] | (nvram[45] << 8));
+
+ PRINT_PROC("DOS base memory: %d kB\n", nvram[7] | (nvram[8] << 8));
+ PRINT_PROC("Extended memory: %d kB (configured), %d kB (tested)\n",
+ nvram[9] | (nvram[10] << 8), nvram[34] | (nvram[35] << 8));
+
+ PRINT_PROC("Gfx adapter : %s\n", gfx_types[(nvram[6] >> 4) & 3]);
+
+ PRINT_PROC("FPU : %sinstalled\n",
+ (nvram[6] & 2) ? "" : "not ");
+
+ return 1;
}
#endif
@@ -571,26 +585,28 @@ static int pc_proc_infos( unsigned char *nvram, char *buffer, int *len,
#if MACH == ATARI
-static int atari_check_checksum( void )
+static int
+atari_check_checksum(void)
{
int i;
unsigned char sum = 0;
-
- for( i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i )
- sum += nvram_read_int( i );
- return( nvram_read_int( ATARI_CKS_LOC ) == (~sum & 0xff) &&
- nvram_read_int( ATARI_CKS_LOC+1 ) == (sum & 0xff) );
+
+ for (i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i)
+ sum += nvram_read_int(i);
+ return (nvram_read_int(ATARI_CKS_LOC) == (~sum & 0xff) &&
+ nvram_read_int(ATARI_CKS_LOC + 1) == (sum & 0xff));
}
-static void atari_set_checksum( void )
+static void
+atari_set_checksum(void)
{
int i;
unsigned char sum = 0;
-
- for( i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i )
- sum += nvram_read_int( i );
- nvram_write_int( ~sum, ATARI_CKS_LOC );
- nvram_write_int( sum, ATARI_CKS_LOC+1 );
+
+ for (i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i)
+ sum += nvram_read_int(i);
+ nvram_write_int(~sum, ATARI_CKS_LOC);
+ nvram_write_int(sum, ATARI_CKS_LOC + 1);
}
#ifdef CONFIG_PROC_FS
@@ -635,81 +651,74 @@ static char *colors[] = {
#define fieldsize(a) (sizeof(a)/sizeof(*a))
-static int atari_proc_infos( unsigned char *nvram, char *buffer, int *len,
- off_t *begin, off_t offset, int size )
+static int
+atari_proc_infos(unsigned char *nvram, char *buffer, int *len,
+ off_t *begin, off_t offset, int size)
{
int checksum = nvram_check_checksum();
int i;
unsigned vmode;
-
- PRINT_PROC( "Checksum status : %svalid\n", checksum ? "" : "not " );
- PRINT_PROC( "Boot preference : " );
- for( i = fieldsize(boot_prefs)-1; i >= 0; --i ) {
+ PRINT_PROC("Checksum status : %svalid\n", checksum ? "" : "not ");
+
+ PRINT_PROC("Boot preference : ");
+ for (i = fieldsize(boot_prefs) - 1; i >= 0; --i) {
if (nvram[1] == boot_prefs[i].val) {
- PRINT_PROC( "%s\n", boot_prefs[i].name );
+ PRINT_PROC("%s\n", boot_prefs[i].name);
break;
}
}
if (i < 0)
- PRINT_PROC( "0x%02x (undefined)\n", nvram[1] );
+ PRINT_PROC("0x%02x (undefined)\n", nvram[1]);
- PRINT_PROC( "SCSI arbitration : %s\n", (nvram[16] & 0x80) ? "on" : "off" );
- PRINT_PROC( "SCSI host ID : " );
+ PRINT_PROC("SCSI arbitration : %s\n",
+ (nvram[16] & 0x80) ? "on" : "off");
+ PRINT_PROC("SCSI host ID : ");
if (nvram[16] & 0x80)
- PRINT_PROC( "%d\n", nvram[16] & 7 );
+ PRINT_PROC("%d\n", nvram[16] & 7);
else
- PRINT_PROC( "n/a\n" );
+ PRINT_PROC("n/a\n");
/* the following entries are defined only for the Falcon */
if ((atari_mch_cookie >> 16) != ATARI_MCH_FALCON)
return 1;
- PRINT_PROC( "OS language : " );
+ PRINT_PROC("OS language : ");
if (nvram[6] < fieldsize(languages))
- PRINT_PROC( "%s\n", languages[nvram[6]] );
+ PRINT_PROC("%s\n", languages[nvram[6]]);
else
- PRINT_PROC( "%u (undefined)\n", nvram[6] );
- PRINT_PROC( "Keyboard language: " );
+ PRINT_PROC("%u (undefined)\n", nvram[6]);
+ PRINT_PROC("Keyboard language: ");
if (nvram[7] < fieldsize(languages))
- PRINT_PROC( "%s\n", languages[nvram[7]] );
+ PRINT_PROC("%s\n", languages[nvram[7]]);
else
- PRINT_PROC( "%u (undefined)\n", nvram[7] );
- PRINT_PROC( "Date format : " );
- PRINT_PROC( dateformat[nvram[8]&7],
- nvram[9] ? nvram[9] : '/', nvram[9] ? nvram[9] : '/' );
- PRINT_PROC( ", %dh clock\n", nvram[8] & 16 ? 24 : 12 );
- PRINT_PROC( "Boot delay : " );
+ PRINT_PROC("%u (undefined)\n", nvram[7]);
+ PRINT_PROC("Date format : ");
+ PRINT_PROC(dateformat[nvram[8] & 7],
+ nvram[9] ? nvram[9] : '/', nvram[9] ? nvram[9] : '/');
+ PRINT_PROC(", %dh clock\n", nvram[8] & 16 ? 24 : 12);
+ PRINT_PROC("Boot delay : ");
if (nvram[10] == 0)
- PRINT_PROC( "default" );
+ PRINT_PROC("default");
else
- PRINT_PROC( "%ds%s\n", nvram[10],
- nvram[10] < 8 ? ", no memory test" : "" );
+ PRINT_PROC("%ds%s\n", nvram[10],
+ nvram[10] < 8 ? ", no memory test" : "");
vmode = (nvram[14] << 8) || nvram[15];
- PRINT_PROC( "Video mode : %s colors, %d columns, %s %s monitor\n",
- colors[vmode & 7],
- vmode & 8 ? 80 : 40,
- vmode & 16 ? "VGA" : "TV",
- vmode & 32 ? "PAL" : "NTSC" );
- PRINT_PROC( " %soverscan, compat. mode %s%s\n",
- vmode & 64 ? "" : "no ",
- vmode & 128 ? "on" : "off",
- vmode & 256 ?
- (vmode & 16 ? ", line doubling" : ", half screen") : "" );
-
- return( 1 );
+ PRINT_PROC("Video mode : %s colors, %d columns, %s %s monitor\n",
+ colors[vmode & 7],
+ vmode & 8 ? 80 : 40,
+ vmode & 16 ? "VGA" : "TV", vmode & 32 ? "PAL" : "NTSC");
+ PRINT_PROC(" %soverscan, compat. mode %s%s\n",
+ vmode & 64 ? "" : "no ",
+ vmode & 128 ? "on" : "off",
+ vmode & 256 ?
+ (vmode & 16 ? ", line doubling" : ", half screen") : "");
+
+ return 1;
}
#endif
#endif /* MACH == ATARI */
MODULE_LICENSE("GPL");
-
-/*
- * Local variables:
- * c-indent-level: 4
- * tab-width: 4
- * End:
- */
-
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 87676b34c17c..ebd3bafe34e8 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -749,7 +749,7 @@ static devfs_handle_t devfs_handle;
static int __init ppdev_init (void)
{
- if (devfs_register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
+ if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
PP_MAJOR);
return -EIO;
@@ -768,7 +768,7 @@ static void __exit ppdev_cleanup (void)
{
/* Clean up all parport stuff */
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev (PP_MAJOR, CHRDEV);
+ unregister_chrdev (PP_MAJOR, CHRDEV);
}
module_init(ppdev_init);
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 6513edfc3045..4b1509ea7eb9 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1881,15 +1881,23 @@ static int __init init_ISA(int i, int *reserved_controller)
{
int num_aiops, num_chan;
int aiop, chan;
+ int extent = 0;
unsigned int aiopio[MAX_AIOPS_PER_BOARD];
CONTROLLER_t *ctlp;
if (rcktpt_io_addr[i] == 0)
return(0);
- if (check_region(rcktpt_io_addr[i],64)) {
+ if (rcktpt_io_addr[i] + 0x40 == controller) {
+ *reserved_controller = 1;
+ extent = 68;
+ } else {
+ extent = 64;
+ }
+ if (!request_region(rcktpt_io_addr[i], extent,
+ "Comtrol Rocketport")) {
printk("RocketPort board address 0x%lx in use...\n",
- rcktpt_io_addr[i]);
+ rcktpt_io_addr[i]);
rcktpt_io_addr[i] = 0;
return(0);
}
@@ -1901,6 +1909,7 @@ static int __init init_ISA(int i, int *reserved_controller)
aiopio, MAX_AIOPS_PER_BOARD, 0,
FREQ_DIS, 0);
if (num_aiops <= 0) {
+ release_region(rcktpt_io_addr[i], extent);
rcktpt_io_addr[i] = 0;
return(0);
}
@@ -1914,14 +1923,6 @@ static int __init init_ISA(int i, int *reserved_controller)
printk("Rocketport controller #%d found at 0x%lx, "
"%d AIOPs\n", i, rcktpt_io_addr[i],
num_aiops);
- if (rcktpt_io_addr[i] + 0x40 == controller) {
- *reserved_controller = 1;
- request_region(rcktpt_io_addr[i], 68,
- "Comtrol Rocketport");
- } else {
- request_region(rcktpt_io_addr[i], 64,
- "Comtrol Rocketport");
- }
return(1);
}
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 1acb3622b2af..1c539767fdb9 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -810,7 +810,7 @@ void cleanup_module()
return;
}
devfs_unregister (devfs_handle);
- if ((i = devfs_unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
+ if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, "
"errno=%d\n", -i);
@@ -3208,7 +3208,7 @@ int __init stl_init(void)
* Set up a character driver for per board stuff. This is mainly used
* to do stats ioctls on the ports.
*/
- if (devfs_register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
+ if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
printk("STALLION: failed to register serial board device\n");
devfs_handle = devfs_mk_dir (NULL, "staliomem", NULL);
devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT,
diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
index cf2d9e76e3d1..45fdc494a0a8 100644
--- a/drivers/char/tpqic02.c
+++ b/drivers/char/tpqic02.c
@@ -2846,7 +2846,7 @@ int __init qic02_tape_init(void)
#endif
printk(TPQIC02_NAME ": DMA buffers: %u blocks\n", NR_BLK_BUF);
/* If we got this far, install driver functions */
- if (devfs_register_chrdev
+ if (register_chrdev
(QIC02_TAPE_MAJOR, TPQIC02_NAME, &qic02_tape_fops)) {
printk(TPQIC02_NAME ": Unable to get chrdev major %d\n",
QIC02_TAPE_MAJOR);
@@ -2930,7 +2930,7 @@ void cleanup_module(void)
if (status_zombie == NO) {
qic02_release_resources();
}
- devfs_unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
+ unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
devfs_find_and_unregister(NULL, "ntpqic11", QIC02_TAPE_MAJOR, 2,
DEVFS_SPECIAL_CHR, 0);
devfs_find_and_unregister(NULL, "tpqic11", QIC02_TAPE_MAJOR, 3,
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 210b543954b3..370317b2104b 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2070,7 +2070,7 @@ int tty_register_driver(struct tty_driver *driver)
if (driver->flags & TTY_DRIVER_INSTALLED)
return 0;
- error = devfs_register_chrdev(driver->major, driver->name, &tty_fops);
+ error = register_chrdev(driver->major, driver->name, &tty_fops);
if (error < 0)
return error;
else if(driver->major == 0)
@@ -2117,11 +2117,11 @@ int tty_unregister_driver(struct tty_driver *driver)
return -ENOENT;
if (othername == NULL) {
- retval = devfs_unregister_chrdev(driver->major, driver->name);
+ retval = unregister_chrdev(driver->major, driver->name);
if (retval)
return retval;
} else
- devfs_register_chrdev(driver->major, othername, &tty_fops);
+ register_chrdev(driver->major, othername, &tty_fops);
if (driver->prev)
driver->prev->next = driver->next;
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index ecc1d318bf80..b74049de43c3 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -501,7 +501,7 @@ int __init vcs_init(void)
{
int error;
- error = devfs_register_chrdev(VCS_MAJOR, "vcs", &vcs_fops);
+ error = register_chrdev(VCS_MAJOR, "vcs", &vcs_fops);
if (error)
printk("unable to get major %d for vcs device", VCS_MAJOR);
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 24d4fff6383a..a6b93f4c580f 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -489,11 +489,7 @@ int __init i2c_dev_init(void)
printk(KERN_INFO "i2c-dev.o: i2c /dev entries driver module version %s (%s)\n", I2C_VERSION, I2C_DATE);
i2cdev_initialized = 0;
-#ifdef CONFIG_DEVFS_FS
- if (devfs_register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops)) {
-#else
if (register_chrdev(I2C_MAJOR,"i2c",&i2cdev_fops)) {
-#endif
printk(KERN_ERR "i2c-dev.o: unable to get major %d for i2c bus\n",
I2C_MAJOR);
return -EIO;
@@ -528,10 +524,8 @@ int i2cdev_cleanup(void)
if (i2cdev_initialized >= 1) {
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_handle);
- if ((res = devfs_unregister_chrdev(I2C_MAJOR, "i2c"))) {
-#else
- if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) {
#endif
+ if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) {
printk(KERN_ERR "i2c-dev.o: unable to release major %d for i2c bus\n",
I2C_MAJOR);
return res;
diff --git a/drivers/ide/cs5530.c b/drivers/ide/cs5530.c
index 86540a2709fe..b4fa6c78a38b 100644
--- a/drivers/ide/cs5530.c
+++ b/drivers/ide/cs5530.c
@@ -58,19 +58,18 @@ static unsigned int cs5530_pio_timings[2][5] =
* After chip reset, the PIO timings are set to 0x0000e132, which is not valid.
*/
#define CS5530_BAD_PIO(timings) (((timings)&~0x80000000)==0x0000e132)
-#define CS5530_BASEREG(hwif) (((hwif)->dma_base & ~0xf) + ((hwif)->unit ? 0x30 : 0x20))
+#define CS5530_BASEREG(ch) (((ch)->dma_base & ~0xf) + ((ch)->unit ? 0x30 : 0x20))
/*
- * cs5530_tuneproc() handles selection/setting of PIO modes
- * for both the chipset and drive.
+ * Handle selection/setting of PIO modes for both the chipset and drive.
*
- * The ide_init_cs5530() routine guarantees that all drives
- * will have valid default PIO timings set up before we get here.
+ * The ide_init_cs5530() routine guarantees that all drives will have valid
+ * default PIO timings set up before we get here.
*/
static void cs5530_tuneproc(struct ata_device *drive, u8 pio)
{
- struct ata_channel *hwif = drive->channel;
- unsigned int format, basereg = CS5530_BASEREG(hwif);
+ unsigned int format;
+ unsigned int basereg = CS5530_BASEREG(drive->channel);
if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
@@ -84,25 +83,26 @@ static void cs5530_tuneproc(struct ata_device *drive, u8 pio)
}
#ifdef CONFIG_BLK_DEV_IDEDMA
+
/*
- * cs5530_config_dma() handles selection/setting of DMA/UDMA modes
- * for both the chipset and drive.
+ * Handle selection/setting of DMA/UDMA modes for both the chipset and drive.
*/
static int cs5530_config_dma(struct ata_device *drive)
{
- int udma_ok = 1, mode = 0;
- struct ata_channel *hwif = drive->channel;
- int unit = drive->select.b.unit;
- struct ata_device *mate = &hwif->drives[unit^1];
- struct hd_driveid *id = drive->id;
- unsigned int basereg, reg, timings;
+ int udma_ok = 1;
+ int mode = 0;
+ struct ata_channel *ch = drive->channel;
+ int unit = drive->select.b.unit;
+ struct ata_device *mate = &ch->drives[unit^1];
+ struct hd_driveid *id = drive->id;
+ unsigned int basereg, reg, timings;
/*
* Default to DMA-off in case we run into trouble here.
*/
udma_enable(drive, 0, 0);
- outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */
+ outb(inb(ch->dma_base+2)&~(unit?0x40:0x20), ch->dma_base+2); /* clear DMA_capable bit */
/*
* The CS5530 specifies that two drives sharing a cable cannot
@@ -129,7 +129,7 @@ static int cs5530_config_dma(struct ata_device *drive)
* Now see what the current drive is capable of,
* selecting UDMA only if the mate said it was ok.
*/
- if (id && (id->capability & 1) && hwif->autodma && !udma_black_list(drive)) {
+ if (id && (id->capability & 1) && ch->autodma && !udma_black_list(drive)) {
if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) {
if (id->dma_ultra & 4)
mode = XFER_UDMA_2;
@@ -168,7 +168,7 @@ static int cs5530_config_dma(struct ata_device *drive)
printk("%s: cs5530_config_dma: huh? mode=%02x\n", drive->name, mode);
return 1; /* failure */
}
- basereg = CS5530_BASEREG(hwif);
+ basereg = CS5530_BASEREG(ch);
reg = inl(basereg+4); /* get drive0 config register */
timings |= reg & 0x80000000; /* preserve PIO format bit */
if (unit == 0) { /* are we configuring drive0? */
@@ -181,7 +181,7 @@ static int cs5530_config_dma(struct ata_device *drive)
outl(reg, basereg+4); /* write drive0 config register */
outl(timings, basereg+12); /* write drive1 config register */
}
- outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set DMA_capable bit */
+ outb(inb(ch->dma_base+2)|(unit?0x40:0x20), ch->dma_base+2); /* set DMA_capable bit */
/*
* Finally, turn DMA on in software, and exit.
@@ -202,7 +202,8 @@ static int cs5530_udma_setup(struct ata_device *drive, int map)
*/
static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
{
- struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
+ struct pci_dev *master_0 = NULL;
+ struct pci_dev *cs5530_0 = NULL;
unsigned short pcicmd = 0;
unsigned long flags;
@@ -277,35 +278,40 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
}
/*
- * This gets invoked by the IDE driver once for each channel,
- * and performs channel-specific pre-initialization before drive probing.
+ * This gets invoked once for each channel, and performs channel-specific
+ * pre-initialization before drive probing.
*/
-static void __init ide_init_cs5530(struct ata_channel *hwif)
+static void __init ide_init_cs5530(struct ata_channel *ch)
{
- u32 basereg, d0_timings;
+ u32 basereg;
+ u32 d0_timings;
+
+ ch->serialized = 1;
- hwif->serialized = 1;
+ /* We think a 64kB transfer is a 0 byte transfer, so set our
+ segment size to be one sector smaller than 64kB. */
+ ch->max_segment_size = (1<<16) - 512;
#ifdef CONFIG_BLK_DEV_IDEDMA
- if (hwif->dma_base) {
- hwif->highmem = 1;
- hwif->udma_setup = cs5530_udma_setup;
+ if (ch->dma_base) {
+ ch->highmem = 1;
+ ch->udma_setup = cs5530_udma_setup;
}
#endif
- hwif->tuneproc = &cs5530_tuneproc;
- basereg = CS5530_BASEREG(hwif);
- d0_timings = inl(basereg+0);
- if (CS5530_BAD_PIO(d0_timings)) { /* PIO timings not initialized? */
- outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+0);
- if (!hwif->drives[0].autotune)
- hwif->drives[0].autotune = 1; /* needs autotuning later */
- }
- if (CS5530_BAD_PIO(inl(basereg+8))) { /* PIO timings not initialized? */
- outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+8);
- if (!hwif->drives[1].autotune)
- hwif->drives[1].autotune = 1; /* needs autotuning later */
- }
+ ch->tuneproc = &cs5530_tuneproc;
+ basereg = CS5530_BASEREG(ch);
+ d0_timings = inl(basereg+0);
+ if (CS5530_BAD_PIO(d0_timings)) { /* PIO timings not initialized? */
+ outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+0);
+ if (!ch->drives[0].autotune)
+ ch->drives[0].autotune = 1; /* needs autotuning later */
+ }
+ if (CS5530_BAD_PIO(inl(basereg+8))) { /* PIO timings not initialized? */
+ outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+8);
+ if (!ch->drives[1].autotune)
+ ch->drives[1].autotune = 1; /* needs autotuning later */
+ }
}
diff --git a/drivers/ide/hd.c b/drivers/ide/hd.c
index 31de0290cd79..6441cad4816b 100644
--- a/drivers/ide/hd.c
+++ b/drivers/ide/hd.c
@@ -31,7 +31,6 @@
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/fs.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/kernel.h>
#include <linux/genhd.h>
#include <linux/slab.h>
@@ -858,7 +857,7 @@ static void __init hd_geninit(void)
int __init hd_init(void)
{
- if (devfs_register_blkdev(MAJOR_NR,"hd",&hd_fops)) {
+ if (register_blkdev(MAJOR_NR,"hd",&hd_fops)) {
printk("hd: unable to get major %d for hard disk\n",MAJOR_NR);
return -1;
}
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 574895510c0e..0eb454a5c8a3 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1617,16 +1617,11 @@ ide_cdrom_do_request(struct ata_device *drive, struct request *rq, sector_t bloc
if (rq->flags & REQ_CMD) {
if (CDROM_CONFIG_FLAGS(drive)->seeking) {
- unsigned long elpased = jiffies - info->start_seek;
-
- if (!ata_status(drive, SEEK_STAT, 0)) {
- if (elpased < IDECD_SEEK_TIMEOUT) {
- ide_stall_queue(drive, IDECD_SEEK_TIMER);
- return ATA_OP_FINISHED;
- }
+ if (ATA_OP_READY != ata_status_poll(drive, SEEK_STAT, 0, IDECD_SEEK_TIMEOUT, rq)) {
printk ("%s: DSC timeout\n", drive->name);
- }
- CDROM_CONFIG_FLAGS(drive)->seeking = 0;
+ CDROM_CONFIG_FLAGS(drive)->seeking = 0;
+ } else
+ return ATA_OP_FINISHED;
}
if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) {
ret = cdrom_start_seek(drive, rq, block);
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index ccd271701974..739f634fa69c 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -723,7 +723,7 @@ static int idedisk_check_media_change(struct ata_device *drive)
static sector_t idedisk_capacity(struct ata_device *drive)
{
- return drive->capacity - drive->sect0;
+ return drive->capacity;
}
/*
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index ab4ddba56fee..5d6e451dd92c 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -40,6 +40,7 @@
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/atapi.h>
+#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -1067,7 +1068,8 @@ static void idetape_analyze_error(struct ata_device *drive, atapi_request_sense_
if (tape->onstream && result->sense_key == 2 && result->asc == 0x53 && result->ascq == 2) {
clear_bit(PC_DMA_ERROR, &pc->flags);
- ide_stall_queue(drive, HZ / 2);
+ /* FIXME: we should use timeouts here */
+ mdelay(HZ / 2 * 1000);
return;
}
#ifdef CONFIG_BLK_DEV_IDEDMA
@@ -1434,7 +1436,8 @@ static void idetape_postpone_request(struct ata_device *drive, struct request *r
printk(KERN_INFO "ide-tape: idetape_postpone_request\n");
#endif
tape->postponed_rq = rq;
- ide_stall_queue(drive, tape->dsc_polling_frequency);
+ /* FIXME: we should use timeouts here */
+ mdelay(tape->dsc_polling_frequency * 1000);
}
/*
@@ -5529,7 +5532,7 @@ static int idetape_cleanup(struct ata_device *drive)
for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++)
if (idetape_chrdevs[minor].drive != NULL)
return 0;
- devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
+ unregister_chrdev (IDETAPE_MAJOR, "ht");
idetape_chrdev_present = 0;
return 0;
}
@@ -5591,7 +5594,7 @@ static void idetape_attach(struct ata_device *drive)
idetape_chrdevs[minor].drive = NULL;
if (!idetape_chrdev_present &&
- devfs_register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) {
+ register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) {
printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
return;
}
@@ -5635,7 +5638,7 @@ static void idetape_attach(struct ata_device *drive)
supported++;
if (!idetape_chrdev_present && !supported) {
- devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
+ unregister_chrdev (IDETAPE_MAJOR, "ht");
} else
idetape_chrdev_present = 1;
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0c9d9a41b390..e5d58dfc4e65 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -481,12 +481,9 @@ ide_startstop_t ata_error(struct ata_device *drive, struct request *rq, const ch
udelay(1);
ata_irq_enable(drive, 0);
- /* This command actually looks suspicious, since I couldn't
- * find it in any standard document.
- */
OUT_BYTE(0x04, ch->io_ports[IDE_CONTROL_OFFSET]);
udelay(10);
- OUT_BYTE(WIN_NOP, ch->io_ports[IDE_CONTROL_OFFSET]);
+ OUT_BYTE(0x00, ch->io_ports[IDE_CONTROL_OFFSET]);
ret = ata_status_poll(drive, 0, BUSY_STAT, WAIT_WORSTCASE, NULL);
ata_mask(drive);
@@ -503,138 +500,86 @@ ide_startstop_t ata_error(struct ata_device *drive, struct request *rq, const ch
}
/*
- * This is used by a drive to give excess bandwidth back by sleeping for
- * timeout jiffies.
- */
-void ide_stall_queue(struct ata_device *drive, unsigned long timeout)
-{
- if (timeout > WAIT_WORSTCASE)
- timeout = WAIT_WORSTCASE;
- drive->sleep = timeout + jiffies;
-}
-
-/*
* Issue a new request.
* Caller must have already done spin_lock_irqsave(channel->lock, ...)
*/
void do_ide_request(request_queue_t *q)
{
- struct ata_channel *channel = q->queuedata;
+ struct ata_device *drive = q->queuedata;
+ struct ata_channel *ch = drive->channel;
- while (!test_and_set_bit(IDE_BUSY, channel->active)) {
- struct ata_channel *ch;
- struct ata_device *drive = NULL;
+ while (!test_and_set_bit(IDE_BUSY, ch->active)) {
unsigned int unit;
ide_startstop_t ret;
- /*
- * Select the next device which will be serviced. This selects
- * only between devices on the same channel, since everything
- * else will be scheduled on the queue level.
- */
-
- for (unit = 0; unit < MAX_DRIVES; ++unit) {
- struct ata_device *tmp = &channel->drives[unit];
-
- if (!tmp->present)
- continue;
-
- /* There are no requests pending for this device.
- */
- if (blk_queue_empty(&tmp->queue))
- continue;
-
-
- /* This device still wants to remain idle.
- */
- if (tmp->sleep && time_after(tmp->sleep, jiffies))
- continue;
-
- /* Take this device, if there is no device choosen thus
- * far or which is more urgent.
- */
- if (!drive || (tmp->sleep && (!drive->sleep || time_after(drive->sleep, tmp->sleep)))) {
- if (!blk_queue_plugged(&tmp->queue))
- drive = tmp;
- }
+ if (drive) {
+ /* No request pending?! */
+ if (blk_queue_empty(&drive->queue))
+ drive = NULL;
+ /* Still resorting requests?! */
+ else if (blk_queue_plugged(&drive->queue))
+ drive = NULL;
}
if (!drive) {
- unsigned long sleep = 0;
-
+ /* We should never get here! */
+ /* Unless someone called us from IRQ context after
+ * finishing the actual request already. (Shrug!)
+ */
+ // printk(KERN_INFO "no device found!\n");
for (unit = 0; unit < MAX_DRIVES; ++unit) {
- struct ata_device *tmp = &channel->drives[unit];
+ struct ata_device *tmp = &ch->drives[unit];
if (!tmp->present)
continue;
- /* This device is sleeping and waiting to be serviced
- * earlier than any other device we checked thus far.
+ /* There are no requests pending for this
+ * device.
*/
- if (tmp->sleep && (!sleep || time_after(sleep, tmp->sleep)))
- sleep = tmp->sleep;
- }
+ if (blk_queue_empty(&tmp->queue))
+ continue;
- if (sleep) {
- /*
- * Take a short snooze, and then wake up again. Just
- * in case there are big differences in relative
- * throughputs.. don't want to hog the cpu too much.
+ /* Take this device, if there is no device
+ * choosen thus far and the queue is ready for
+ * processing.
*/
+ if (!drive && !blk_queue_plugged(&tmp->queue))
+ drive = tmp;
+ }
+ }
- if (time_after(jiffies, sleep - WAIT_MIN_SLEEP))
- sleep = jiffies + WAIT_MIN_SLEEP;
-#if 1
- if (timer_pending(&channel->timer))
- printk(KERN_ERR "%s: timer already active\n", __FUNCTION__);
-#endif
- set_bit(IDE_SLEEP, channel->active);
- mod_timer(&channel->timer, sleep);
-
- /*
- * We purposely leave us busy while sleeping becouse we
- * are prepared to handle the IRQ from it.
- *
- * FIXME: Make sure sleeping can't interferre with
- * operations of other devices on the same channel.
- */
- } else {
- /* FIXME: use queue plugging instead of active to block
- * upper layers from stomping on us */
- /* Ugly, but how can we sleep for the lock otherwise?
- * */
-
- ide_release_lock(&ide_irq_lock);/* for atari only */
- clear_bit(IDE_BUSY, channel->active);
-
- /* All requests are done.
- *
- * Disable IRQs from the last drive on this channel, to
- * make sure that it wan't throw stones at us when we
- * are not prepared to take them.
- */
+ if (!drive) {
+ /* Ugly, but how can we sleep for the lock otherwise?
+ */
- if (channel->drive && !channel->drive->using_tcq)
- ata_irq_enable(channel->drive, 0);
- }
+ ide_release_lock(&ide_irq_lock);/* for atari only */
+ clear_bit(IDE_BUSY, ch->active);
+
+ /* All requests are done.
+ *
+ * Disable IRQs from the last drive on this channel, to
+ * make sure that it wan't throw stones at us when we
+ * are not prepared to take them.
+ */
+
+ if (ch->drive && !ch->drive->using_tcq)
+ ata_irq_enable(ch->drive, 0);
return;
}
/* Remember the last drive we where acting on.
*/
- ch = drive->channel;
ch->drive = drive;
/* Feed commands to a drive until it barfs.
*/
do {
struct request *rq = NULL;
- sector_t block;
- /* Abort early if we can't queue another command. for non tcq,
- * ata_can_queue is always 1 since we never get here unless the
- * drive is idle.
+ /* Abort early if we can't queue another command. for
+ * non tcq, ata_can_queue is always 1 since we never
+ * get here unless the drive is idle.
*/
if (!ata_can_queue(drive)) {
@@ -646,18 +591,16 @@ void do_ide_request(request_queue_t *q)
break;
}
- drive->sleep = 0;
-
if (test_bit(IDE_DMA, ch->active)) {
printk(KERN_ERR "%s: error: DMA in progress...\n", drive->name);
break;
}
- /* There's a small window between where the queue could be
- * replugged while we are in here when using tcq (in which case
- * the queue is probably empty anyways...), so check and leave
- * if appropriate. When not using tcq, this is still a severe
- * BUG!
+ /* There's a small window between where the queue could
+ * be replugged while we are in here when using tcq (in
+ * which case the queue is probably empty anyways...),
+ * so check and leave if appropriate. When not using
+ * tcq, this is still a severe BUG!
*/
if (blk_queue_plugged(&drive->queue)) {
@@ -692,30 +635,12 @@ void do_ide_request(request_queue_t *q)
/*
* This initiates handling of a new I/O request.
*/
-
BUG_ON(!(rq->flags & REQ_STARTED));
-#ifdef DEBUG
- printk("%s: %s: current=0x%08lx\n", ch->name, __FUNCTION__, (unsigned long) rq);
-#endif
-
/* bail early if we've exceeded max_failures */
if (drive->max_failures && (drive->failures > drive->max_failures))
goto kill_rq;
- block = rq->sector;
-
- /* Strange disk manager remap.
- */
- if (rq->flags & REQ_CMD)
- if (drive->type == ATA_DISK || drive->type == ATA_FLOPPY)
- block += drive->sect0;
-
- /* Yecch - this will shift the entire interval, possibly killing some
- * innocent following sector.
- */
- if (block == 0 && drive->remap_0_to_1 == 1)
- block = 1; /* redirect MBR access to EZ-Drive partn table */
ata_select(drive, 0);
ret = ata_status_poll(drive, drive->ready_stat, BUSY_STAT | DRQ_STAT,
@@ -737,9 +662,9 @@ void do_ide_request(request_queue_t *q)
* handler down to the device type driver.
*/
- if (ata_ops(drive)->do_request) {
- ret = ata_ops(drive)->do_request(drive, rq, block);
- } else {
+ if (ata_ops(drive)->do_request)
+ ret = ata_ops(drive)->do_request(drive, rq, rq->sector);
+ else {
kill_rq:
if (ata_ops(drive) && ata_ops(drive)->end_request)
ata_ops(drive)->end_request(drive, rq, 0);
@@ -749,12 +674,8 @@ kill_rq:
}
spin_lock_irq(ch->lock);
-
/* continue if command started, so we are busy */
} while (ret != ATA_OP_CONTINUES);
- /* make sure the BUSY bit is set */
- /* FIXME: perhaps there is some place where we miss to set it? */
- // set_bit(IDE_BUSY, ch->active);
}
}
@@ -1200,6 +1121,5 @@ EXPORT_SYMBOL(ata_dump);
EXPORT_SYMBOL(ata_error);
EXPORT_SYMBOL(ata_end_request);
-EXPORT_SYMBOL(ide_stall_queue);
EXPORT_SYMBOL(ide_setup_ports);
diff --git a/drivers/ide/main.c b/drivers/ide/main.c
index 5649e68fb97e..a14e7934ed16 100644
--- a/drivers/ide/main.c
+++ b/drivers/ide/main.c
@@ -176,18 +176,26 @@ static void init_hwif_data(struct ata_channel *ch, unsigned int index)
};
unsigned int unit;
- hw_regs_t hw;
/* bulk initialize channel & drive info with zeros */
memset(ch, 0, sizeof(struct ata_channel));
- memset(&hw, 0, sizeof(hw_regs_t));
/* fill in any non-zero initial values */
ch->index = index;
- ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &ch->irq);
+ ide_init_hwif_ports(&ch->hw, ide_default_io_base(index), 0, &ch->irq);
- memcpy(&ch->hw, &hw, sizeof(hw));
- memcpy(ch->io_ports, hw.io_ports, sizeof(hw.io_ports));
+ memcpy(ch->io_ports, ch->hw.io_ports, sizeof(ch->hw.io_ports));
+
+ /* Most controllers cannot do transfers across 64kB boundaries.
+ trm290 can do transfers within a 4GB boundary, so it changes
+ this mask accordingly. */
+ ch->seg_boundary_mask = 0xffff;
+
+ /* Some chipsets (cs5530, any others?) think a 64kB transfer
+ is 0 byte transfer, so set the limit one sector smaller.
+ In the future, we may default to 64kB transfers and let
+ invidual chipsets with this problem change ch->max_segment_size. */
+ ch->max_segment_size = (1<<16) - 512;
ch->noprobe = !ch->io_ports[IDE_DATA_OFFSET];
#ifdef CONFIG_BLK_DEV_HD
@@ -728,7 +736,7 @@ static int __init ata_hd_setup(char *s)
if (s[0] >= 'a' && s[0] <= max_drive) {
static const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
"serialize", "autotune", "noautotune",
- "slow", "flash", "remap", "noremap", "scsi", NULL};
+ "slow", "flash", "scsi", NULL};
unit = s[0] - 'a';
hw = unit / MAX_DRIVES;
unit = unit % MAX_DRIVES;
@@ -783,13 +791,7 @@ static int __init ata_hd_setup(char *s)
case -9: /* "flash" */
drive->ata_flash = 1;
goto done;
- case -10: /* "remap" */
- drive->remap_0_to_1 = 1;
- goto done;
- case -11: /* "noremap" */
- drive->remap_0_to_1 = 2;
- goto done;
- case -12: /* "scsi" */
+ case -10: /* "scsi" */
#if defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI)
drive->scsi = 1;
goto done;
@@ -836,14 +838,14 @@ int __init ide_setup(char *s)
unsigned int hw;
const char max_ch = '0' + (MAX_HWIFS - 1);
- printk(KERN_INFO "ide_setup: ide%s", s);
+ printk(KERN_INFO "ide%s", s);
init_global_data();
#ifdef CONFIG_BLK_DEV_IDEDOUBLER
if (!strcmp(s, "=doubler")) {
extern int ide_doubler;
- printk(KERN_INFO" : Enabled support for IDE doublers\n");
+ printk(KERN_INFO" : Enabled support for ATA doublers\n");
ide_doubler = 1;
return 1;
}
@@ -888,7 +890,7 @@ int __init ide_setup(char *s)
ch = &ide_hwifs[hw];
- switch (match_parm(s+1, ide_options, vals, 1)) {
+ switch (match_parm(s + 1, ide_options, vals, 1)) {
case -7: /* ata66 */
#ifdef CONFIG_PCI
ch->udma_four = 1;
@@ -929,7 +931,7 @@ int __init ide_setup(char *s)
/*
* Check for specific chipset name
*/
- i = match_parm(s+1, ide_words, vals, 3);
+ i = match_parm(s + 1, ide_words, vals, 3);
/*
* Cryptic check to ensure chipset not already set for a channel:
@@ -956,7 +958,7 @@ int __init ide_setup(char *s)
#ifdef CONFIG_BLK_DEV_ALI14XX
case -6: /* "ali14xx" */
{
- extern void init_ali14xx (void);
+ extern void init_ali14xx(void);
init_ali14xx();
goto done;
}
@@ -964,7 +966,7 @@ int __init ide_setup(char *s)
#ifdef CONFIG_BLK_DEV_UMC8672
case -5: /* "umc8672" */
{
- extern void init_umc8672 (void);
+ extern void init_umc8672(void);
init_umc8672();
goto done;
}
@@ -972,7 +974,7 @@ int __init ide_setup(char *s)
#ifdef CONFIG_BLK_DEV_DTC2278
case -4: /* "dtc2278" */
{
- extern void init_dtc2278 (void);
+ extern void init_dtc2278(void);
init_dtc2278();
goto done;
}
@@ -988,7 +990,7 @@ int __init ide_setup(char *s)
#ifdef CONFIG_BLK_DEV_HT6560B
case -2: /* "ht6560b" */
{
- extern void init_ht6560b (void);
+ extern void init_ht6560b(void);
init_ht6560b();
goto done;
}
@@ -996,7 +998,7 @@ int __init ide_setup(char *s)
#if CONFIG_BLK_DEV_QD65XX
case -1: /* "qd65xx" */
{
- extern void init_qd65xx (void);
+ extern void init_qd65xx(void);
init_qd65xx();
goto done;
}
@@ -1136,7 +1138,7 @@ int register_ata_driver(struct ata_operations *driver)
EXPORT_SYMBOL(register_ata_driver);
/*
- * Unregister an ATA subdriver for a particular device type.
+ * Unregister an ATA sub-driver for a particular device type.
*/
void unregister_ata_driver(struct ata_operations *driver)
{
diff --git a/drivers/ide/pcidma.c b/drivers/ide/pcidma.c
index 2674e69327dc..479354e5cf74 100644
--- a/drivers/ide/pcidma.c
+++ b/drivers/ide/pcidma.c
@@ -379,12 +379,6 @@ int udma_new_table(struct ata_device *drive, struct request *rq)
{
struct ata_channel *ch = drive->channel;
unsigned int *table = ch->dmatable_cpu;
-#ifdef CONFIG_BLK_DEV_TRM290
- unsigned int is_trm290_chipset = (ch->chipset == ide_trm290);
-#else
- const int is_trm290_chipset = 0;
-#endif
- unsigned int count = 0;
int i;
struct scatterlist *sg;
@@ -392,68 +386,29 @@ int udma_new_table(struct ata_device *drive, struct request *rq)
if (!i)
return 0;
- sg = ch->sg_table;
- while (i) {
- u32 cur_addr;
- u32 cur_len;
-
- cur_addr = sg_dma_address(sg);
- cur_len = sg_dma_len(sg);
-
- /*
- * Fill in the dma table, without crossing any 64kB boundaries.
- * Most hardware requires 16-bit alignment of all blocks,
- * but the trm290 requires 32-bit alignment.
- */
+ BUG_ON(i > PRD_ENTRIES);
- while (cur_len) {
- u32 xcount, bcount = 0x10000 - (cur_addr & 0xffff);
+ sg = ch->sg_table;
+ while (i--) {
+ u32 cur_addr = sg_dma_address(sg);
+ u32 cur_len = sg_dma_len(sg) & 0xffff;
- if (count++ >= PRD_ENTRIES) {
- printk("ide-dma: count %d, sg_nents %d, cur_len %d, cur_addr %u\n",
- count, ch->sg_nents, cur_len, cur_addr);
- BUG();
- }
+ /* Delete this test after linux ~2.5.35, as we care
+ about performance in this loop. */
+ BUG_ON(cur_len > ch->max_segment_size);
- if (bcount > cur_len)
- bcount = cur_len;
- *table++ = cpu_to_le32(cur_addr);
- xcount = bcount & 0xffff;
- if (is_trm290_chipset)
- xcount = ((xcount >> 2) - 1) << 16;
- if (xcount == 0x0000) {
- /*
- * Most chipsets correctly interpret a length of
- * 0x0000 as 64KB, but at least one (e.g. CS5530)
- * misinterprets it as zero (!). So here we break
- * the 64KB entry into two 32KB entries instead.
- */
- if (count++ >= PRD_ENTRIES) {
- pci_unmap_sg(ch->pci_dev, sg,
- ch->sg_nents,
- ch->sg_dma_direction);
- return 0;
- }
-
- *table++ = cpu_to_le32(0x8000);
- *table++ = cpu_to_le32(cur_addr + 0x8000);
- xcount = 0x8000;
- }
- *table++ = cpu_to_le32(xcount);
- cur_addr += bcount;
- cur_len -= bcount;
- }
+ *table++ = cpu_to_le32(cur_addr);
+ *table++ = cpu_to_le32(cur_len);
sg++;
- i--;
}
- if (!count)
- printk(KERN_ERR "%s: empty DMA table?\n", ch->name);
- else if (!is_trm290_chipset)
+#ifdef CONFIG_BLK_DEV_TRM290
+ if (ch->chipset == ide_trm290)
*--table |= cpu_to_le32(0x80000000);
+#endif
- return count;
+ return ch->sg_nents;
}
/*
diff --git a/drivers/ide/probe.c b/drivers/ide/probe.c
index f6adc59bb0b5..801c178f559a 100644
--- a/drivers/ide/probe.c
+++ b/drivers/ide/probe.c
@@ -41,19 +41,10 @@
extern struct ata_device * get_info_ptr(kdev_t);
/*
- * This is called from the partition-table code in pt/msdos.c.
+ * This is called from the partition-table code in pt/msdos.c
+ * to invent a translated geometry.
*
- * It has two tasks:
- *
- * (I) to handle Ontrack DiskManager by offsetting everything by 63 sectors,
- * or to handle EZdrive by remapping sector 0 to sector 1.
- *
- * (II) to invent a translated geometry.
- *
- * Part (I) is suppressed if the user specifies the "noremap" option
- * on the command line.
- *
- * Part (II) is suppressed if the user specifies an explicit geometry.
+ * This is suppressed if the user specifies an explicit geometry.
*
* The ptheads parameter is either 0 or tells about the number of
* heads shown by the end of the first nonempty partition.
@@ -83,21 +74,6 @@ int ide_xlate_1024(kdev_t i_rdev, int xparm, int ptheads, const char *msg)
if (!drive)
return 0;
- /* remap? */
- if (drive->remap_0_to_1 != 2) {
- if (xparm == 1) { /* DM */
- drive->sect0 = 63;
- msg1 = " [remap +63]";
- ret = 1;
- } else if (xparm == -1) { /* EZ-Drive */
- if (drive->remap_0_to_1 == 0) {
- drive->remap_0_to_1 = 1;
- msg1 = " [remap 0->1]";
- ret = 1;
- }
- }
- }
-
/* There used to be code here that assigned drive->id->CHS to
* drive->CHS and that to drive->bios_CHS. However, some disks have
* id->C/H/S = 4092/16/63 but are larger than 2.1 GB. In such cases
@@ -1001,22 +977,24 @@ static int init_irq(struct ata_channel *ch)
ch->drive = drive;
/*
- * Init the per device request queue
+ * Init the per device request queue.
*/
q = &drive->queue;
- q->queuedata = drive->channel;
+ q->queuedata = drive;
blk_init_queue(q, do_ide_request, drive->channel->lock);
- blk_queue_segment_boundary(q, 0xffff);
+ blk_queue_segment_boundary(q, ch->seg_boundary_mask);
+ blk_queue_max_segment_size(q, ch->max_segment_size);
- /* ATA can do up to 128K per request, pdc4030 needs smaller limit */
+ /* ATA can do up to 128K per request, pdc4030 needs smaller
+ * limit. */
#ifdef CONFIG_BLK_DEV_PDC4030
if (drive->channel->chipset == ide_pdc4030)
max_sectors = 127;
#endif
blk_queue_max_sectors(q, max_sectors);
- /* IDE DMA can do PRD_ENTRIES number of segments. */
+ /* ATA DMA can do PRD_ENTRIES number of segments. */
blk_queue_max_hw_segments(q, PRD_ENTRIES);
/* FIXME: This is a driver limit and could be eliminated. */
@@ -1094,7 +1072,7 @@ static void channel_init(struct ata_channel *ch)
}
#endif
- if (devfs_register_blkdev(ch->major, ch->name, ide_fops)) {
+ if (register_blkdev(ch->major, ch->name, ide_fops)) {
printk("%s: UNABLE TO GET MAJOR NUMBER %d\n", ch->name, ch->major);
return;
diff --git a/drivers/ide/qd65xx.c b/drivers/ide/qd65xx.c
index 3ed266424233..3318115a2876 100644
--- a/drivers/ide/qd65xx.c
+++ b/drivers/ide/qd65xx.c
@@ -262,15 +262,11 @@ static int __init qd_testreg(int port)
{
u8 savereg;
u8 readreg;
- unsigned long flags;
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
savereg = inb_p(port);
outb_p(QD_TESTVAL, port); /* safe value */
readreg = inb_p(port);
outb(savereg, port);
- restore_flags(flags); /* all CPUs */
if (savereg == QD_TESTVAL) {
printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n");
diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c
index d37b405e4759..b46f79c7e884 100644
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -255,6 +255,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif)
struct pci_dev *dev = hwif->pci_dev;
hwif->chipset = ide_trm290;
+ hwif->seg_boundary_mask = 0xffffffff;
cfgbase = pci_resource_start(dev, 4);
if ((dev->class & 5) && cfgbase)
{
diff --git a/drivers/ide/umc8672.c b/drivers/ide/umc8672.c
index 61c986d226b3..3b94fd999185 100644
--- a/drivers/ide/umc8672.c
+++ b/drivers/ide/umc8672.c
@@ -108,19 +108,14 @@ static void umc_set_speeds(u8 speeds[])
static void tune_umc(struct ata_device *drive, u8 pio)
{
- unsigned long flags;
-
if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
else
pio = min_t(u8, pio, 4);
printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
umc_set_speeds (current_speeds);
- restore_flags(flags); /* all CPUs */
}
void __init init_umc8672(void) /* called from ide.c */
diff --git a/drivers/input/input.c b/drivers/input/input.c
index e51c910ff85f..0bd17fbd49fd 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -822,7 +822,7 @@ static int __init input_init(void)
entry = create_proc_read_entry("handlers", 0, proc_bus_input_dir, input_handlers_read, NULL);
entry->owner = THIS_MODULE;
#endif
- if (devfs_register_chrdev(INPUT_MAJOR, "input", &input_fops)) {
+ if (register_chrdev(INPUT_MAJOR, "input", &input_fops)) {
printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
return -EBUSY;
}
@@ -840,7 +840,7 @@ static void __exit input_exit(void)
remove_proc_entry("input", proc_bus);
#endif
devfs_unregister(input_devfs_handle);
- if (devfs_unregister_chrdev(INPUT_MAJOR, "input"))
+ if (unregister_chrdev(INPUT_MAJOR, "input"))
printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
}
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 2b223a22c5b7..c60458528187 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1485,7 +1485,7 @@ static int __init capi_init(void)
} else
strcpy(rev, "1.0");
- if (devfs_register_chrdev(capi_major, "capi20", &capi_fops)) {
+ if (register_chrdev(capi_major, "capi20", &capi_fops)) {
printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
MOD_DEC_USE_COUNT;
return -EIO;
@@ -1498,7 +1498,7 @@ static int __init capi_init(void)
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) {
- devfs_unregister_chrdev(capi_major, "capi20");
+ unregister_chrdev(capi_major, "capi20");
MOD_DEC_USE_COUNT;
return -ENOMEM;
}
@@ -1526,7 +1526,7 @@ static void __exit capi_exit(void)
{
proc_exit();
- devfs_unregister_chrdev(capi_major, "capi20");
+ unregister_chrdev(capi_major, "capi20");
devfs_find_and_unregister(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0);
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
diff --git a/drivers/isdn/hisax/Config.in b/drivers/isdn/hisax/Config.in
index 0d41ba9998df..997a2f255f66 100644
--- a/drivers/isdn/hisax/Config.in
+++ b/drivers/isdn/hisax/Config.in
@@ -43,9 +43,9 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
bool ' HFC-S+, HFC-SP, HFC-PCMCIA cards' CONFIG_HISAX_HFC_SX
if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
# bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
- bool ' Formula-n enter:now PCI card' CONFIG_HISAX_ENTERNOW_PCI
+ bool ' Formula-n enter:now PCI card (EXPERIMENTAL)' CONFIG_HISAX_ENTERNOW_PCI
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
- bool ' Am7930' CONFIG_HISAX_AMD7930
+ bool ' Am7930 (EXPERIMENTAL)' CONFIG_HISAX_AMD7930
fi
fi
bool ' HiSax debugging' CONFIG_HISAX_DEBUG
diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c
index 67c245a886c3..aae47971c5f0 100644
--- a/drivers/isdn/hysdn/boardergo.c
+++ b/drivers/isdn/hysdn/boardergo.c
@@ -424,16 +424,19 @@ ergo_releasehardware(hysdn_card * card)
int
ergo_inithardware(hysdn_card * card)
{
- if (check_region(card->iobase + PCI9050_INTR_REG, 1) ||
- check_region(card->iobase + PCI9050_USER_IO, 1))
+ if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN"))
+ return (-1);
+ if (!request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN")) {
+ release_region(card->iobase + PCI9050_INTR_REG, 1);
return (-1); /* ports already in use */
-
+ }
card->memend = card->membase + ERG_DPRAM_PAGE_SIZE - 1;
- if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE)))
+ if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE))) {
+ release_region(card->iobase + PCI9050_INTR_REG, 1);
+ release_region(card->iobase + PCI9050_USER_IO, 1);
return (-1);
+ }
- request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN");
- request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN");
ergo_stopcard(card); /* disable interrupts */
if (request_irq(card->irq, ergo_interrupt, SA_SHIRQ, "HYSDN", card)) {
ergo_releasehardware(card); /* return the acquired hardware */
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 5b82bf23537d..c2a14fa3c981 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -2266,7 +2266,7 @@ static int __init isdn_init(void)
init_waitqueue_head(&dev->mdm.info[i].open_wait);
init_waitqueue_head(&dev->mdm.info[i].close_wait);
}
- if (devfs_register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
+ if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
printk(KERN_WARNING "isdn: Could not register control devices\n");
vfree(dev);
return -EIO;
@@ -2280,7 +2280,7 @@ static int __init isdn_init(void)
tty_unregister_driver(&dev->mdm.tty_modem);
vfree(dev);
isdn_cleanup_devfs();
- devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
+ unregister_chrdev(ISDN_MAJOR, "isdn");
return -EIO;
}
#ifdef CONFIG_ISDN_PPP
@@ -2291,7 +2291,7 @@ static int __init isdn_init(void)
for (i = 0; i < ISDN_MAX_CHANNELS; i++)
kfree(dev->mdm.info[i].xmit_buf - 4);
isdn_cleanup_devfs();
- devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
+ unregister_chrdev(ISDN_MAJOR, "isdn");
vfree(dev);
return -EIO;
}
@@ -2354,7 +2354,7 @@ static void __exit isdn_exit(void)
kfree(dev->mdm.info[i].fax);
#endif
}
- if (devfs_unregister_chrdev(ISDN_MAJOR, "isdn") != 0) {
+ if (unregister_chrdev(ISDN_MAJOR, "isdn") != 0) {
printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
restore_flags(flags);
} else {
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 4280eaf5897a..f173a8c97e6b 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -815,7 +815,7 @@ static struct file_operations adb_fops = {
static void
adbdev_init(void)
{
- if (devfs_register_chrdev(ADB_MAJOR, "adb", &adb_fops))
+ if (register_chrdev(ADB_MAJOR, "adb", &adb_fops))
printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
else
devfs_register (NULL, "adb", DEVFS_FL_DEFAULT,
diff --git a/drivers/md/lvm.c b/drivers/md/lvm.c
index ab05b01ee4ce..207014c30a17 100644
--- a/drivers/md/lvm.c
+++ b/drivers/md/lvm.c
@@ -213,7 +213,6 @@
#include <linux/proc_fs.h>
#include <linux/blkdev.h>
#include <linux/genhd.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/smp_lock.h>
#include <asm/ioctl.h>
#include <asm/uaccess.h>
@@ -388,19 +387,18 @@ static struct gendisk lvm_gendisk =
*/
int lvm_init(void)
{
- if (devfs_register_chrdev(LVM_CHAR_MAJOR,
+ if (register_chrdev(LVM_CHAR_MAJOR,
lvm_name, &lvm_chr_fops) < 0) {
- printk(KERN_ERR "%s -- devfs_register_chrdev failed\n",
+ printk(KERN_ERR "%s -- register_chrdev failed\n",
lvm_name);
return -EIO;
}
- if (devfs_register_blkdev(MAJOR_NR, lvm_name, &lvm_blk_dops) < 0)
- {
- printk("%s -- devfs_register_blkdev failed\n", lvm_name);
- if (devfs_unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
+ if (register_blkdev(MAJOR_NR, lvm_name, &lvm_blk_dops) < 0) {
+ printk("%s -- register_blkdev failed\n", lvm_name);
+ if (unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
printk(KERN_ERR
- "%s -- devfs_unregister_chrdev failed\n",
+ "%s -- unregister_chrdev failed\n",
lvm_name);
return -EIO;
}
@@ -442,11 +440,11 @@ int lvm_init(void)
*/
static void lvm_cleanup(void)
{
- if (devfs_unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
- printk(KERN_ERR "%s -- devfs_unregister_chrdev failed\n",
+ if (unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
+ printk(KERN_ERR "%s -- unregister_chrdev failed\n",
lvm_name);
- if (devfs_unregister_blkdev(MAJOR_NR, lvm_name) < 0)
- printk(KERN_ERR "%s -- devfs_unregister_blkdev failed\n",
+ if (unregister_blkdev(MAJOR_NR, lvm_name) < 0)
+ printk(KERN_ERR "%s -- unregister_blkdev failed\n",
lvm_name);
del_gendisk(&lvm_gendisk);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b84ff3330b32..a4f962c3a469 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3207,8 +3207,7 @@ int __init md_init(void)
MD_MAJOR_VERSION, MD_MINOR_VERSION,
MD_PATCHLEVEL_VERSION, MAX_MD_DEVS, MD_SB_DISKS);
- if (devfs_register_blkdev (MAJOR_NR, "md", &md_fops))
- {
+ if (register_blkdev (MAJOR_NR, "md", &md_fops)) {
printk(KERN_ALERT "md: Unable to get major %d for md\n", MAJOR_NR);
return (-1);
}
@@ -3568,7 +3567,7 @@ void cleanup_module(void)
md_unregister_thread(md_recovery_thread);
devfs_unregister(devfs_handle);
- devfs_unregister_blkdev(MAJOR_NR,"md");
+ unregister_blkdev(MAJOR_NR,"md");
unregister_reboot_notifier(&md_notifier);
unregister_sysctl_table(raid_table_header);
#ifdef CONFIG_PROC_FS
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 1357c418d2a7..ead0e3dc5ee2 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -484,8 +484,7 @@ static struct file_operations video_fops=
static int __init videodev_init(void)
{
printk(KERN_INFO "Linux video capture interface: v1.00\n");
- if(devfs_register_chrdev(VIDEO_MAJOR,"video_capture", &video_fops))
- {
+ if (register_chrdev(VIDEO_MAJOR,"video_capture", &video_fops)) {
printk("video_dev: unable to get major %d\n", VIDEO_MAJOR);
return -EIO;
}
@@ -502,7 +501,7 @@ static void __exit videodev_exit(void)
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
videodev_proc_destroy ();
#endif
- devfs_unregister_chrdev(VIDEO_MAJOR, "video_capture");
+ unregister_chrdev(VIDEO_MAJOR, "video_capture");
}
module_init(videodev_init)
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 928ebe405251..df1ec9bdc9d0 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -593,22 +593,14 @@ int __init init_mtdblock(void)
int i;
spin_lock_init(&mtdblks_lock);
-#ifdef CONFIG_DEVFS_FS
- if (devfs_register_blkdev(MTD_BLOCK_MAJOR, DEVICE_NAME, &mtd_fops))
- {
- printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
- MTD_BLOCK_MAJOR);
- return -EAGAIN;
- }
-
- devfs_dir_handle = devfs_mk_dir(NULL, DEVICE_NAME, NULL);
- register_mtd_user(&notifier);
-#else
if (register_blkdev(MAJOR_NR,DEVICE_NAME,&mtd_fops)) {
printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
MTD_BLOCK_MAJOR);
return -EAGAIN;
}
+#ifdef CONFIG_DEVFS_FS
+ devfs_dir_handle = devfs_mk_dir(NULL, DEVICE_NAME, NULL);
+ register_mtd_user(&notifier);
#endif
/* We fill it in at open() time. */
@@ -630,10 +622,8 @@ static void __exit cleanup_mtdblock(void)
#ifdef CONFIG_DEVFS_FS
unregister_mtd_user(&notifier);
devfs_unregister(devfs_dir_handle);
- devfs_unregister_blkdev(MTD_BLOCK_MAJOR, DEVICE_NAME);
-#else
- unregister_blkdev(MAJOR_NR,DEVICE_NAME);
#endif
+ unregister_blkdev(MAJOR_NR,DEVICE_NAME);
blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
blk_size[MAJOR_NR] = NULL;
}
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 03404e440728..5b1fa29adc25 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -494,26 +494,17 @@ static void mtd_notify_remove(struct mtd_info* mtd)
static int __init init_mtdchar(void)
{
-#ifdef CONFIG_DEVFS_FS
- if (devfs_register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
- {
+ if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops)) {
printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
MTD_CHAR_MAJOR);
return -EAGAIN;
}
+#ifdef CONFIG_DEVFS_FS
devfs_dir_handle = devfs_mk_dir(NULL, "mtd", NULL);
register_mtd_user(&notifier);
-#else
- if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
- {
- printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
- MTD_CHAR_MAJOR);
- return -EAGAIN;
- }
#endif
-
return 0;
}
@@ -522,10 +513,8 @@ static void __exit cleanup_mtdchar(void)
#ifdef CONFIG_DEVFS_FS
unregister_mtd_user(&notifier);
devfs_unregister(devfs_dir_handle);
- devfs_unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
-#else
- unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
#endif
+ unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
}
module_init(init_mtdchar);
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index e5fdea9b57f7..0070502b0c3d 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -18,7 +18,7 @@
See the file COPYING in this distribution for more information.
- Contribuitors:
+ Contributors:
Wake-on-LAN support - Felipe Damasio <felipewd@terra.com.br>
diff --git a/drivers/net/Config.in b/drivers/net/Config.in
index c15e62b48281..c4104bab7f78 100644
--- a/drivers/net/Config.in
+++ b/drivers/net/Config.in
@@ -273,7 +273,7 @@ if [ ! "$CONFIG_PPP" = "n" ]; then
dep_tristate ' PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP
fi
if [ ! "$CONFIG_ATM" = "n" ]; then
- dep_tristate ' PPP over ATM (EXPERIMENTAL)' CONFIG_PPPOATM $CONFIG_PPP
+ dep_tristate ' PPP over ATM' CONFIG_PPPOATM $CONFIG_PPP
fi
fi
diff --git a/drivers/net/Makefile.lib b/drivers/net/Makefile.lib
index af22a0e02a3a..ed26632be260 100644
--- a/drivers/net/Makefile.lib
+++ b/drivers/net/Makefile.lib
@@ -25,7 +25,7 @@ obj-$(CONFIG_PCMCIA_XIRTULIP) += crc32.o
obj-$(CONFIG_PCNET32) += crc32.o
obj-$(CONFIG_SIS900) += crc32.o
obj-$(CONFIG_SMC9194) += crc32.o
-obj-$(CONFIG_STARFIRE) += crc32.o
+obj-$(CONFIG_ADAPTEC_STARFIRE) += crc32.o
obj-$(CONFIG_SUNBMAC) += crc32.o
obj-$(CONFIG_SUNDANCE) += crc32.o
obj-$(CONFIG_SUNGEM) += crc32.o
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index aab50f6e2219..64c2b53a6413 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -819,9 +819,9 @@ free_region:
MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS));
if (dev->priv != NULL)
kfree(dev->priv);
- kfree(dev);
printk(KERN_ERR "%s: au1000_probe1 failed. Returns %d\n",
dev->name, retval);
+ kfree(dev);
return retval;
}
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 9c860f1e5ef3..14e18b0b1df0 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -476,19 +476,22 @@ static int ser12_open(struct net_device *dev)
if (!dev->base_addr || dev->base_addr > 0x1000-SER12_EXTENT ||
dev->irq < 2 || dev->irq > 15)
return -ENXIO;
- if (check_region(dev->base_addr, SER12_EXTENT))
+ if (!request_region(dev->base_addr, SER12_EXTENT, "baycom_ser12"))
return -EACCES;
memset(&bc->modem, 0, sizeof(bc->modem));
bc->hdrv.par.bitrate = 1200;
- if ((u = ser12_check_uart(dev->base_addr)) == c_uart_unknown)
+ if ((u = ser12_check_uart(dev->base_addr)) == c_uart_unknown) {
+ release_region(dev->base_addr, SER12_EXTENT);
return -EIO;
+ }
outb(0, FCR(dev->base_addr)); /* disable FIFOs */
outb(0x0d, MCR(dev->base_addr));
outb(0, IER(dev->base_addr));
if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ,
- "baycom_ser12", dev))
+ "baycom_ser12", dev)) {
+ release_region(dev->base_addr, SER12_EXTENT);
return -EBUSY;
- request_region(dev->base_addr, SER12_EXTENT, "baycom_ser12");
+ }
/*
* enable transmitter empty interrupt
*/
diff --git a/drivers/net/irda/Config.in b/drivers/net/irda/Config.in
index 36d973f32956..19f98192ae06 100644
--- a/drivers/net/irda/Config.in
+++ b/drivers/net/irda/Config.in
@@ -19,20 +19,20 @@ if [ "$CONFIG_DONGLE" != "n" ]; then
dep_tristate ' EP7211 I/R support' CONFIG_EP7211_IR $CONFIG_IRDA
fi
if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
- dep_tristate ' ACTiSYS IR-200L dongle (Experimental)' CONFIG_ACT200L_DONGLE $CONFIG_IRDA
- dep_tristate ' Mobile Action MA600 dongle (Experimental)' CONFIG_MA600_DONGLE $CONFIG_IRDA
+ dep_tristate ' ACTiSYS IR-200L dongle (EXPERIMENTAL)' CONFIG_ACT200L_DONGLE $CONFIG_IRDA
+ dep_tristate ' Mobile Action MA600 dongle (EXPERIMENTAL)' CONFIG_MA600_DONGLE $CONFIG_IRDA
fi
fi
comment 'FIR device drivers'
-dep_tristate 'IrDA USB dongles (Experimental)' CONFIG_USB_IRDA $CONFIG_IRDA $CONFIG_USB $CONFIG_EXPERIMENTAL
+dep_tristate 'IrDA USB dongles (EXPERIMENTAL)' CONFIG_USB_IRDA $CONFIG_IRDA $CONFIG_USB $CONFIG_EXPERIMENTAL
dep_tristate 'NSC PC87108/PC87338' CONFIG_NSC_FIR $CONFIG_IRDA
dep_tristate 'Winbond W83977AF (IR)' CONFIG_WINBOND_FIR $CONFIG_IRDA
dep_tristate 'Toshiba Type-O IR Port' CONFIG_TOSHIBA_FIR $CONFIG_IRDA
if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
-dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
-dep_tristate 'ALi M5123 FIR (Experimental)' CONFIG_ALI_FIR $CONFIG_IRDA
-dep_tristate 'VLSI 82C147 SIR/MIR/FIR (Experimental)' CONFIG_VLSI_FIR $CONFIG_IRDA
+dep_tristate 'SMC IrCC (EXPERIMENTAL)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
+dep_tristate 'ALi M5123 FIR (EXPERIMENTAL)' CONFIG_ALI_FIR $CONFIG_IRDA
+dep_tristate 'VLSI 82C147 SIR/MIR/FIR (EXPERIMENTAL)' CONFIG_VLSI_FIR $CONFIG_IRDA
fi
if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
dep_tristate 'SA1100 Internal IR' CONFIG_SA1100_FIR $CONFIG_IRDA
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 770e415c2b18..10928840e3c9 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -785,7 +785,7 @@ int __init ppp_init(void)
int err;
printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
- err = devfs_register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
+ err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
if (err)
printk(KERN_ERR "failed to register PPP device (%d)\n", err);
devfs_handle = devfs_register(NULL, "ppp", DEVFS_FL_DEFAULT,
@@ -2509,7 +2509,7 @@ static void __exit ppp_cleanup(void)
if (atomic_read(&ppp_unit_count) || atomic_read(&channel_count))
printk(KERN_ERR "PPP: removing module but units remain!\n");
cardmap_destroy(&all_ppp_units);
- if (devfs_unregister_chrdev(PPP_MAJOR, "ppp") != 0)
+ if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
printk(KERN_ERR "PPP: failed to unregister PPP device\n");
devfs_unregister(devfs_handle);
}
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 30af146bb972..4730a342d23c 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -373,13 +373,13 @@ static int __init cosa_init(void)
printk(KERN_INFO "cosa: SMP found. Please mail any success/failure reports to the author.\n");
#endif
if (cosa_major > 0) {
- if (devfs_register_chrdev(cosa_major, "cosa", &cosa_fops)) {
+ if (register_chrdev(cosa_major, "cosa", &cosa_fops)) {
printk(KERN_WARNING "cosa: unable to get major %d\n",
cosa_major);
return -EIO;
}
} else {
- if (!(cosa_major=devfs_register_chrdev(0, "cosa", &cosa_fops))) {
+ if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) {
printk(KERN_WARNING "cosa: unable to register chardev\n");
return -EIO;
}
@@ -395,7 +395,7 @@ static int __init cosa_init(void)
&cosa_fops, NULL);
if (!nr_cards) {
printk(KERN_WARNING "cosa: no devices found.\n");
- devfs_unregister_chrdev(cosa_major, "cosa");
+ unregister_chrdev(cosa_major, "cosa");
return -ENODEV;
}
return 0;
@@ -422,7 +422,7 @@ void cleanup_module (void)
free_dma(cosa->dma);
release_region(cosa->datareg,is_8bit(cosa)?2:4);
}
- devfs_unregister_chrdev(cosa_major, "cosa");
+ unregister_chrdev(cosa_major, "cosa");
}
#endif
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index e5229cc967f9..643a069a38f5 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -92,8 +92,7 @@ dasd_register_major(int major)
}
/* Register block device. */
- new_major = devfs_register_blkdev(major, "dasd",
- &dasd_device_operations);
+ new_major = register_blkdev(major, "dasd", &dasd_device_operations);
if (new_major < 0) {
MESSAGE(KERN_WARNING,
"Cannot register to major no %d, rc = %d", major, rc);
@@ -168,7 +167,7 @@ dasd_unregister_major(struct major_info * mi)
bs = blk_size[major];
blk_clear(major);
- rc = devfs_unregister_blkdev(major, "dasd");
+ rc = unregister_blkdev(major, "dasd");
if (rc < 0)
MESSAGE(KERN_WARNING,
"Cannot unregister from major no %d, rc = %d",
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 3985f4274eac..94c04fccfee7 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -449,7 +449,7 @@ static int __init xpram_setup_blkdev(void)
/*
* Register xpram major.
*/
- rc = devfs_register_blkdev(XPRAM_MAJOR, XPRAM_NAME, &xpram_devops);
+ rc = register_blkdev(XPRAM_MAJOR, XPRAM_NAME, &xpram_devops);
if (rc < 0) {
PRINT_ERR("Can't get xpram major %d\n", XPRAM_MAJOR);
return rc;
@@ -489,7 +489,7 @@ static int __init xpram_setup_blkdev(void)
static void __exit xpram_exit(void)
{
blk_clear(XPRAM_MAJOR);
- devfs_unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
+ unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
devfs_unregister(xpram_devfs_handle);
unregister_sys_device(&xpram_sys_device);
}
diff --git a/drivers/s390/char/tapeblock.c b/drivers/s390/char/tapeblock.c
index 1a2ab633f422..2a493f0e3656 100644
--- a/drivers/s390/char/tapeblock.c
+++ b/drivers/s390/char/tapeblock.c
@@ -97,11 +97,7 @@ tapeblock_init(void) {
tape_dev_t* td;
tape_init();
/* Register the tape major number to the kernel */
-#ifdef CONFIG_DEVFS_FS
- result = devfs_register_blkdev(tapeblock_major, "tBLK", &tapeblock_fops);
-#else
result = register_blkdev(tapeblock_major, "tBLK", &tapeblock_fops);
-#endif
if (result < 0) {
PRINT_WARN(KERN_ERR "tape: can't get major %d for block device\n", tapeblock_major);
result=-ENODEV;
@@ -149,11 +145,7 @@ out_undo_hardsect_size:
out_undo_blk_size:
kfree(blk_size[tapeblock_major]);
out_undo_bdev:
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_blkdev(tapeblock_major, "tBLK");
-#else
unregister_blkdev(tapeblock_major, "tBLK");
-#endif
result=-ENOMEM;
blk_size[tapeblock_major]=
hardsect_size[tapeblock_major]=
@@ -181,11 +173,7 @@ tapeblock_uninit(void) {
max_sectors[tapeblock_major]=NULL;
}
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_blkdev(tapeblock_major, "tBLK");
-#else
unregister_blkdev(tapeblock_major, "tBLK");
-#endif
out:
return;
diff --git a/drivers/s390/char/tapechar.c b/drivers/s390/char/tapechar.c
index 1c5e6efd655a..98c82f1522a4 100644
--- a/drivers/s390/char/tapechar.c
+++ b/drivers/s390/char/tapechar.c
@@ -128,11 +128,7 @@ tapechar_init (void)
tape_init();
/* Register the tape major number to the kernel */
-#ifdef CONFIG_DEVFS_FS
- result = devfs_register_chrdev (tapechar_major, "tape", &tape_fops);
-#else
result = register_chrdev (tapechar_major, "tape", &tape_fops);
-#endif
if (result < 0) {
PRINT_WARN (KERN_ERR "tape: can't get major %d\n", tapechar_major);
tape_sprintf_event (tape_dbf_area,3,"c:initfail\n");
@@ -178,11 +174,7 @@ tapechar_init (void)
void
tapechar_uninit (void)
{
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_chrdev (tapechar_major, "tape");
-#else
unregister_chrdev (tapechar_major, "tape");
-#endif
}
diff --git a/drivers/s390/char/tubfs.c b/drivers/s390/char/tubfs.c
index c50e34830676..8486d77a4d8c 100644
--- a/drivers/s390/char/tubfs.c
+++ b/drivers/s390/char/tubfs.c
@@ -74,26 +74,19 @@ fs3270_init(void)
{
int rc;
-#ifdef CONFIG_DEVFS_FS
- rc = devfs_register_chrdev (IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
+ rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
if (rc) {
printk(KERN_ERR "tubmod can't get major nbr %d: error %d\n",
IBM_FS3270_MAJOR, rc);
return -1;
}
+#ifdef CONFIG_DEVFS_FS
fs3270_devfs_dir = devfs_mk_dir(NULL, "3270", NULL);
fs3270_devfs_tub =
devfs_register(fs3270_devfs_dir, "tub", DEVFS_FL_DEFAULT,
IBM_FS3270_MAJOR, 0,
S_IFCHR | S_IRUGO | S_IWUGO,
&fs3270_fops, NULL);
-#else
- rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
- if (rc) {
- printk(KERN_ERR "tubmod can't get major nbr %d: error %d\n",
- IBM_FS3270_MAJOR, rc);
- return -1;
- }
#endif
fs3270_major = IBM_FS3270_MAJOR;
return 0;
diff --git a/drivers/sbus/audio/audio.c b/drivers/sbus/audio/audio.c
index b83fa77ee48e..4b90c394f379 100644
--- a/drivers/sbus/audio/audio.c
+++ b/drivers/sbus/audio/audio.c
@@ -2123,7 +2123,7 @@ EXPORT_SYMBOL(sparcaudio_input_done);
static int __init sparcaudio_init(void)
{
/* Register our character device driver with the VFS. */
- if (devfs_register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
+ if (register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
return -EIO;
devfs_handle = devfs_mk_dir (NULL, "sound", NULL);
@@ -2132,7 +2132,7 @@ static int __init sparcaudio_init(void)
static void __exit sparcaudio_exit(void)
{
- devfs_unregister_chrdev(SOUND_MAJOR, "sparcaudio");
+ unregister_chrdev(SOUND_MAJOR, "sparcaudio");
devfs_unregister (devfs_handle);
}
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index 5ed0a0c90ad2..00bce39b7cda 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -1041,7 +1041,7 @@ static int __init bpp_init(void)
if (rc == 0)
return -ENODEV;
- rc = devfs_register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
+ rc = register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
if (rc < 0)
return rc;
@@ -1062,7 +1062,7 @@ static void __exit bpp_cleanup(void)
unsigned idx;
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(BPP_MAJOR, dev_name);
+ unregister_chrdev(BPP_MAJOR, dev_name);
for (idx = 0 ; idx < BPP_NO ; idx += 1) {
if (instances[idx].present)
diff --git a/drivers/sbus/char/sunkbd.c b/drivers/sbus/char/sunkbd.c
index 6d150d928e30..9f919c59036b 100644
--- a/drivers/sbus/char/sunkbd.c
+++ b/drivers/sbus/char/sunkbd.c
@@ -1615,7 +1615,7 @@ void __init keyboard_zsinit(void (*put_char)(unsigned char))
KBD_MAJOR, 0,
S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
&kbd_fops, NULL);
- if (devfs_register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
+ if (register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
printk ("Could not register /dev/kbd device\n");
return;
}
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index ea3894bd233c..9b6d4836e5f3 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -676,7 +676,7 @@ static int vfc_probe(void)
memset(vfc_dev_lst, 0, sizeof(struct vfc_dev *) * (cards + 1));
vfc_dev_lst[cards] = NULL;
- ret = devfs_register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
+ ret = register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
if(ret) {
printk(KERN_ERR "Unable to get major number %d\n", VFC_MAJOR);
kfree(vfc_dev_lst);
@@ -732,7 +732,7 @@ void cleanup_module(void)
{
struct vfc_dev **devp;
- devfs_unregister_chrdev(VFC_MAJOR,vfcstr);
+ unregister_chrdev(VFC_MAJOR,vfcstr);
for (devp = vfc_dev_lst; *devp; devp++)
deinit_vfc_device(*devp);
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 9ea4f1b68ca7..fc5f5aa2f1bb 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -5585,11 +5585,7 @@ static int osst_init()
if (osst_template.dev_noticed == 0) return 0;
if(!osst_registered) {
-#ifdef CONFIG_DEVFS_FS
- if (devfs_register_chrdev(MAJOR_NR,"osst",&osst_fops)) {
-#else
if (register_chrdev(MAJOR_NR,"osst",&osst_fops)) {
-#endif
printk(KERN_ERR "osst :W: Unable to get major %d for OnStream tapes\n",MAJOR_NR);
return 1;
}
@@ -5605,11 +5601,7 @@ static int osst_init()
GFP_ATOMIC);
if (os_scsi_tapes == NULL) {
printk(KERN_ERR "osst :W: Unable to allocate array for OnStream SCSI tapes.\n");
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
unregister_chrdev(MAJOR_NR, "osst");
-#endif
return 1;
}
@@ -5621,11 +5613,7 @@ static int osst_init()
GFP_ATOMIC);
if (osst_buffers == NULL) {
printk(KERN_ERR "osst :W: Unable to allocate tape buffer pointers.\n");
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
unregister_chrdev(MAJOR_NR, "osst");
-#endif
kfree(os_scsi_tapes);
return 1;
}
@@ -5684,11 +5672,7 @@ static void __exit exit_osst (void)
OS_Scsi_Tape * STp;
scsi_unregister_device(&osst_template);
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
unregister_chrdev(MAJOR_NR, "osst");
-#endif
osst_registered--;
if(os_scsi_tapes != NULL) {
for (i=0; i < osst_template.dev_max; ++i) {
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 11d9307d20f0..1c364e823c87 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1878,6 +1878,7 @@ void scsi_error_handler(void *data)
*/
daemonize();
+ reparent_to_init();
/*
* Set the name of this process.
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6f7be79667d3..556b92b3b3bf 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1198,8 +1198,7 @@ static int sd_init()
if (!sd_registered) {
for (k = 0; k < N_USED_SD_MAJORS; k++) {
- if (devfs_register_blkdev(SD_MAJOR(k), "sd",
- &sd_fops)) {
+ if (register_blkdev(SD_MAJOR(k), "sd", &sd_fops)) {
printk(KERN_NOTICE "Unable to get major %d "
"for SCSI disk\n", SD_MAJOR(k));
return 1;
@@ -1296,7 +1295,7 @@ cleanup_mem:
sd_dsk_arr = NULL;
}
for (k = 0; k < N_USED_SD_MAJORS; k++) {
- devfs_unregister_blkdev(SD_MAJOR(k), "sd");
+ unregister_blkdev(SD_MAJOR(k), "sd");
}
sd_registered--;
return 1;
@@ -1560,7 +1559,7 @@ static void __exit exit_sd(void)
SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
scsi_unregister_device(&sd_template);
for (k = 0; k < N_USED_SD_MAJORS; k++)
- devfs_unregister_blkdev(SD_MAJOR(k), "sd");
+ unregister_blkdev(SD_MAJOR(k), "sd");
sd_registered--;
if (sd_dsk_arr != NULL) {
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index c4a0e90de737..f77086e3a42e 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1348,8 +1348,7 @@ static int sg_init()
write_lock_irqsave(&sg_dev_arr_lock, iflags);
if(!sg_registered) {
- if (devfs_register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops))
- {
+ if (register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops)) {
printk(KERN_ERR "Unable to get major %d for generic SCSI device\n",
SCSI_GENERIC_MAJOR);
write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
@@ -1611,7 +1610,7 @@ static void __exit exit_sg( void)
sg_proc_cleanup();
#endif /* CONFIG_PROC_FS */
scsi_unregister_device(&sg_template);
- devfs_unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
+ unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
if(sg_dev_arr != NULL) {
kfree((char *)sg_dev_arr);
sg_dev_arr = NULL;
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index a9ae22858798..4a8480893d9c 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -702,7 +702,7 @@ static int sr_init()
return 0;
if (!sr_registered) {
- if (devfs_register_blkdev(MAJOR_NR, "sr", &sr_bdops)) {
+ if (register_blkdev(MAJOR_NR, "sr", &sr_bdops)) {
printk("Unable to get major %d for SCSI-CD\n", MAJOR_NR);
return 1;
}
@@ -714,7 +714,7 @@ static int sr_init()
sr_template.dev_max = sr_template.dev_noticed + SR_EXTRA_DEVS;
scsi_CDs = kmalloc(sr_template.dev_max * sizeof(Scsi_CD), GFP_ATOMIC);
if (!scsi_CDs)
- goto cleanup_devfs;
+ goto cleanup_dev;
memset(scsi_CDs, 0, sr_template.dev_max * sizeof(Scsi_CD));
sr_sizes = kmalloc(sr_template.dev_max * sizeof(int), GFP_ATOMIC);
@@ -725,8 +725,8 @@ static int sr_init()
cleanup_cds:
kfree(scsi_CDs);
-cleanup_devfs:
- devfs_unregister_blkdev(MAJOR_NR, "sr");
+cleanup_dev:
+ unregister_blkdev(MAJOR_NR, "sr");
sr_registered--;
return 1;
}
@@ -869,7 +869,7 @@ static int __init init_sr(void)
static void __exit exit_sr(void)
{
scsi_unregister_device(&sr_template);
- devfs_unregister_blkdev(MAJOR_NR, "sr");
+ unregister_blkdev(MAJOR_NR, "sr");
sr_registered--;
if (scsi_CDs != NULL) {
kfree(scsi_CDs);
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 9ba9b04048ba..c2ef2a258a8f 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3826,7 +3826,7 @@ static int __init init_st(void)
verstr, st_fixed_buffer_size, st_write_threshold,
st_max_sg_segs);
- if (devfs_register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) {
+ if (register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) {
if (scsi_register_device(&st_template) == 0) {
st_template.scsi_driverfs_driver.name =
(char *)st_template.tag;
@@ -3846,7 +3846,7 @@ static void __exit exit_st(void)
int i;
scsi_unregister_device(&st_template);
- devfs_unregister_chrdev(SCSI_TAPE_MAJOR, "st");
+ unregister_chrdev(SCSI_TAPE_MAJOR, "st");
if (scsi_tapes != NULL) {
for (i=0; i < st_template.dev_max; ++i)
if (scsi_tapes[i])
diff --git a/drivers/sgi/char/shmiq.c b/drivers/sgi/char/shmiq.c
index 0533e7c64bec..b8dd324f0cd6 100644
--- a/drivers/sgi/char/shmiq.c
+++ b/drivers/sgi/char/shmiq.c
@@ -466,7 +466,7 @@ void
shmiq_init (void)
{
printk ("SHMIQ setup\n");
- devfs_register_chrdev(SHMIQ_MAJOR, "shmiq", &shmiq_fops);
+ register_chrdev(SHMIQ_MAJOR, "shmiq", &shmiq_fops);
devfs_register (NULL, "shmiq", DEVFS_FL_DEFAULT,
SHMIQ_MAJOR, 0, S_IFCHR | S_IRUSR | S_IWUSR,
&shmiq_fops, NULL);
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 803fb19e5ad2..11845a102d11 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -71,7 +71,7 @@ static struct file_operations usb_fops = {
int usb_major_init(void)
{
- if (devfs_register_chrdev(USB_MAJOR, "usb", &usb_fops)) {
+ if (register_chrdev(USB_MAJOR, "usb", &usb_fops)) {
err("unable to get major %d for usb devices", USB_MAJOR);
return -EBUSY;
}
@@ -84,7 +84,7 @@ int usb_major_init(void)
void usb_major_cleanup(void)
{
devfs_unregister(usb_devfs_handle);
- devfs_unregister_chrdev(USB_MAJOR, "usb");
+ unregister_chrdev(USB_MAJOR, "usb");
}
/**
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index f80a98621d26..cfeb3f5b6d2e 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1059,9 +1059,9 @@ static int usb_hub_thread(void *__hub)
/* Send me a signal to get me die (for debugging) */
do {
usb_hub_events();
+ wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
- wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
} while (!signal_pending(current));
dbg("usb_hub_thread exiting");
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index 0fe88b71cc30..7518b8992b8f 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -534,6 +534,8 @@ td_fill (unsigned int info,
/* aim for only one interrupt per urb. mostly applies to control
* and iso; other urbs rarely need more than one TD per urb.
* this way, only final tds (or ones with an error) cause IRQs.
+ * at least immediately; use DI=6 in case any control request is
+ * tempted to die part way through.
*
* NOTE: could delay interrupts even for the last TD, and get fewer
* interrupts ... increasing per-urb latency by sharing interrupts.
@@ -541,7 +543,7 @@ td_fill (unsigned int info,
*/
if (index != (urb_priv->length - 1)
|| (urb->transfer_flags & URB_NO_INTERRUPT))
- info |= TD_DI_SET (7);
+ info |= TD_DI_SET (6);
/* use this td as the next dummy */
td_pt = urb_priv->td [index];
@@ -809,12 +811,16 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
ohci->hcca->done_head = 0;
while (td_list_hc) {
+ int cc;
+
td_list = dma_to_td (ohci, td_list_hc);
td_list->hwINFO |= cpu_to_le32 (TD_DONE);
- if (TD_CC_GET (le32_to_cpup (&td_list->hwINFO))) {
+ cc = TD_CC_GET (le32_to_cpup (&td_list->hwINFO));
+ if (cc != TD_CC_NOERROR) {
urb_priv = (urb_priv_t *) td_list->urb->hcpriv;
+
/* Non-iso endpoints can halt on error; un-halt,
* and dequeue any other TDs from this urb.
* No other TD could have caused the halt.
@@ -822,12 +828,21 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci)
if (td_list->ed->hwHeadP & ED_H) {
if (urb_priv && ((td_list->index + 1)
< urb_priv->length)) {
-#ifdef OHCI_VERBOSE_DEBUG
- dbg ("urb %p TD %p (%d/%d), patch ED",
- td_list->urb, td_list,
+ struct urb *urb = td_list->urb;
+
+ /* help for troubleshooting: */
+ dbg ("urb %p usb-%s-%s ep-%d-%s "
+ "(td %d/%d), "
+ "cc %d --> status %d",
+ td_list->urb,
+ urb->dev->bus->bus_name,
+ urb->dev->devpath,
+ usb_pipeendpoint (urb->pipe),
+ usb_pipein (urb->pipe)
+ ? "IN" : "OUT",
1 + td_list->index,
- urb_priv->length);
-#endif
+ urb_priv->length,
+ cc, cc_to_error [cc]);
td_list->ed->hwHeadP =
(urb_priv->td [urb_priv->length - 1]->hwNextTD
& __constant_cpu_to_le32 (TD_MASK))
diff --git a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
index 15332a4d3dad..bd9b38810f3c 100644
--- a/drivers/usb/misc/tiglusb.c
+++ b/drivers/usb/misc/tiglusb.c
@@ -476,7 +476,7 @@ tiglusb_init (void)
}
/* register device */
- if (devfs_register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
+ if (register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
err ("unable to get major %d", TIUSB_MAJOR);
return -EIO;
}
@@ -487,7 +487,7 @@ tiglusb_init (void)
/* register USB module */
result = usb_register (&tiglusb_driver);
if (result < 0) {
- devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+ unregister_chrdev (TIUSB_MAJOR, "tiglusb");
return -1;
}
@@ -501,7 +501,7 @@ tiglusb_cleanup (void)
{
usb_deregister (&tiglusb_driver);
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+ unregister_chrdev (TIUSB_MAJOR, "tiglusb");
}
/* --------------------------------------------------------------------- */
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index b0010753f346..45f94b158904 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -845,7 +845,7 @@ fbmem_init(void)
create_proc_read_entry("fb", 0, 0, fbmem_read_proc, NULL);
devfs_handle = devfs_mk_dir (NULL, "fb", NULL);
- if (devfs_register_chrdev(FB_MAJOR,"fb",&fb_fops))
+ if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
printk("unable to get major %d for fb devs\n", FB_MAJOR);
#ifdef CONFIG_FB_OF
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index b8b70836a5e6..16d0aeb9184d 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -111,10 +111,6 @@ static const struct fb_videomode modedb[] __initdata = {
NULL, 87, 1280, 1024, 12500, 56, 16, 128, 1, 216, 12,
0, FB_VMODE_INTERLACED
}, {
- /* 1400x1050 @ 60Hz, 63.9 kHz hsync */
- NULL, 68, 1400, 1050, 9259, 136, 40, 13, 1, 112, 3,
- 0, FB_VMODE_NONINTERLACED
- }, {
/* 800x600 @ 100 Hz, 64.02 kHz hsync */
NULL, 100, 800, 600, 14357, 160, 64, 30, 4, 64, 6,
0, FB_VMODE_NONINTERLACED
diff --git a/fs/Config.in b/fs/Config.in
index ffb3b91725c0..1c8e8253459e 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -26,7 +26,7 @@ dep_tristate 'Apple Macintosh file system support (EXPERIMENTAL)' CONFIG_HFS_FS
dep_tristate 'BFS file system support (EXPERIMENTAL)' CONFIG_BFS_FS $CONFIG_EXPERIMENTAL
-tristate 'Ext3 journalling file system support (EXPERIMENTAL)' CONFIG_EXT3_FS
+tristate 'Ext3 journalling file system support' CONFIG_EXT3_FS
# CONFIG_JBD could be its own option (even modular), but until there are
# other users than ext3, we will simply make it be the same as CONFIG_EXT3_FS
# dep_tristate ' Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 093eafdfe7b3..62c973eeb278 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -453,6 +453,8 @@ struct block_device_operations * get_blkfops(unsigned int major)
int register_blkdev(unsigned int major, const char * name, struct block_device_operations *bdops)
{
+ if (devfs_only())
+ return 0;
if (major == 0) {
for (major = MAX_BLKDEV-1; major > 0; major--) {
if (blkdevs[major].bdops == NULL) {
@@ -474,6 +476,8 @@ int register_blkdev(unsigned int major, const char * name, struct block_device_o
int unregister_blkdev(unsigned int major, const char * name)
{
+ if (devfs_only())
+ return 0;
if (major >= MAX_BLKDEV)
return -EINVAL;
if (!blkdevs[major].bdops)
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 7929ce018c96..10e45309f7dd 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -366,7 +366,7 @@ static devfs_handle_t devfs_handle;
static int init_coda_psdev(void)
{
- if(devfs_register_chrdev(CODA_PSDEV_MAJOR,"coda_psdev",
+ if(register_chrdev(CODA_PSDEV_MAJOR,"coda_psdev",
&coda_psdev_fops)) {
printk(KERN_ERR "coda_psdev: unable to get major %d\n",
CODA_PSDEV_MAJOR);
@@ -411,7 +411,7 @@ static int __init init_coda(void)
return 0;
out:
devfs_unregister(devfs_handle);
- devfs_unregister_chrdev(CODA_PSDEV_MAJOR,"coda_psdev");
+ unregister_chrdev(CODA_PSDEV_MAJOR,"coda_psdev");
coda_sysctl_clean();
out1:
coda_destroy_inodecache();
@@ -428,7 +428,7 @@ static void __exit exit_coda(void)
printk("coda: failed to unregister filesystem\n");
}
devfs_unregister(devfs_handle);
- devfs_unregister_chrdev(CODA_PSDEV_MAJOR, "coda_psdev");
+ unregister_chrdev(CODA_PSDEV_MAJOR, "coda_psdev");
coda_sysctl_clean();
coda_destroy_inodecache();
}
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 0e563abb6802..7731d36ef133 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -2228,75 +2228,17 @@ const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
/**
- * devfs_register_chrdev - Optionally register a conventional character driver.
- * @major: The major number for the driver.
- * @name: The name of the driver (as seen in /proc/devices).
- * @fops: The &file_operations structure pointer.
+ * devfs_only - returns if "devfs=only" is a boot option
*
- * This function will register a character driver provided the "devfs=only"
- * option was not provided at boot time.
- * Returns 0 on success, else a negative error code on failure.
+ * If "devfs=only" this function will return 1, otherwise 0 is returned.
*/
-
-int devfs_register_chrdev (unsigned int major, const char *name,
- struct file_operations *fops)
-{
- if (boot_options & OPTION_ONLY) return 0;
- return register_chrdev (major, name, fops);
-} /* End Function devfs_register_chrdev */
-
-
-/**
- * devfs_register_blkdev - Optionally register a conventional block driver.
- * @major: The major number for the driver.
- * @name: The name of the driver (as seen in /proc/devices).
- * @bdops: The &block_device_operations structure pointer.
- *
- * This function will register a block driver provided the "devfs=only"
- * option was not provided at boot time.
- * Returns 0 on success, else a negative error code on failure.
- */
-
-int devfs_register_blkdev (unsigned int major, const char *name,
- struct block_device_operations *bdops)
+int devfs_only (void)
{
- if (boot_options & OPTION_ONLY) return 0;
- return register_blkdev (major, name, bdops);
-} /* End Function devfs_register_blkdev */
-
-
-/**
- * devfs_unregister_chrdev - Optionally unregister a conventional character driver.
- * @major: The major number for the driver.
- * @name: The name of the driver (as seen in /proc/devices).
- *
- * This function will unregister a character driver provided the "devfs=only"
- * option was not provided at boot time.
- * Returns 0 on success, else a negative error code on failure.
- */
-
-int devfs_unregister_chrdev (unsigned int major, const char *name)
-{
- if (boot_options & OPTION_ONLY) return 0;
- return unregister_chrdev (major, name);
-} /* End Function devfs_unregister_chrdev */
-
-
-/**
- * devfs_unregister_blkdev - Optionally unregister a conventional block driver.
- * @major: The major number for the driver.
- * @name: The name of the driver (as seen in /proc/devices).
- *
- * This function will unregister a block driver provided the "devfs=only"
- * option was not provided at boot time.
- * Returns 0 on success, else a negative error code on failure.
- */
+ if (boot_options & OPTION_ONLY)
+ return 1;
+ return 0;
+}
-int devfs_unregister_blkdev (unsigned int major, const char *name)
-{
- if (boot_options & OPTION_ONLY) return 0;
- return unregister_blkdev (major, name);
-} /* End Function devfs_unregister_blkdev */
/**
* devfs_setup - Process kernel boot options.
@@ -2385,10 +2327,6 @@ EXPORT_SYMBOL(devfs_get_next_sibling);
EXPORT_SYMBOL(devfs_auto_unregister);
EXPORT_SYMBOL(devfs_get_unregister_slave);
EXPORT_SYMBOL(devfs_get_name);
-EXPORT_SYMBOL(devfs_register_chrdev);
-EXPORT_SYMBOL(devfs_register_blkdev);
-EXPORT_SYMBOL(devfs_unregister_chrdev);
-EXPORT_SYMBOL(devfs_unregister_blkdev);
/**
diff --git a/fs/devices.c b/fs/devices.c
index 0447d805a77e..69874923b79f 100644
--- a/fs/devices.c
+++ b/fs/devices.c
@@ -19,6 +19,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
@@ -97,6 +98,8 @@ static struct file_operations * get_chrfops(unsigned int major, unsigned int min
int register_chrdev(unsigned int major, const char * name, struct file_operations *fops)
{
+ if (devfs_only())
+ return 0;
if (major == 0) {
write_lock(&chrdevs_lock);
for (major = MAX_CHRDEV-1; major > 0; major--) {
@@ -125,6 +128,8 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation
int unregister_chrdev(unsigned int major, const char * name)
{
+ if (devfs_only())
+ return 0;
if (major >= MAX_CHRDEV)
return -EINVAL;
write_lock(&chrdevs_lock);
diff --git a/fs/driverfs/inode.c b/fs/driverfs/inode.c
index 56c037a3385a..08df41832bb1 100644
--- a/fs/driverfs/inode.c
+++ b/fs/driverfs/inode.c
@@ -50,7 +50,6 @@
static struct super_operations driverfs_ops;
static struct file_operations driverfs_file_operations;
static struct inode_operations driverfs_dir_inode_operations;
-static struct dentry_operations driverfs_dentry_file_ops;
static struct address_space_operations driverfs_aops;
static struct vfsmount *driverfs_mount;
@@ -139,7 +138,7 @@ static int driverfs_mknod(struct inode *dir, struct dentry *dentry, int mode, in
/* only allow create if ->d_fsdata is not NULL (so we can assume it
* comes from the driverfs API below. */
- if (dentry->d_fsdata && inode) {
+ if (inode) {
d_instantiate(dentry, inode);
dget(dentry);
error = 0;
@@ -161,7 +160,6 @@ static int driverfs_create(struct inode *dir, struct dentry *dentry, int mode)
{
int res;
mode = (mode & S_IALLUGO) | S_IFREG;
- dentry->d_op = &driverfs_dentry_file_ops;
res = driverfs_mknod(dir, dentry, mode, 0);
return res;
}
@@ -278,11 +276,13 @@ static ssize_t
driverfs_read_file(struct file *file, char *buf, size_t count, loff_t *ppos)
{
struct driver_file_entry * entry;
+ struct driver_dir_entry * dir;
unsigned char *page;
ssize_t retval = 0;
struct device * dev;
- entry = (struct driver_file_entry *)file->private_data;
+ dir = file->f_dentry->d_parent->d_fsdata;
+ entry = (struct driver_file_entry *)file->f_dentry->d_fsdata;
if (!entry) {
DBG("%s: file entry is NULL\n",__FUNCTION__);
return -ENOENT;
@@ -293,7 +293,7 @@ driverfs_read_file(struct file *file, char *buf, size_t count, loff_t *ppos)
if (count > PAGE_SIZE)
count = PAGE_SIZE;
- dev = to_device(entry->parent);
+ dev = to_device(dir);
page = (unsigned char*)__get_free_page(GFP_KERNEL);
if (!page)
@@ -342,11 +342,14 @@ static ssize_t
driverfs_write_file(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
struct driver_file_entry * entry;
+ struct driver_dir_entry * dir;
struct device * dev;
ssize_t retval = 0;
char * page;
- entry = (struct driver_file_entry *)file->private_data;
+ dir = file->f_dentry->d_parent->d_fsdata;
+
+ entry = (struct driver_file_entry *)file->f_dentry->d_fsdata;
if (!entry) {
DBG("%s: file entry is NULL\n",__FUNCTION__);
return -ENOENT;
@@ -354,7 +357,7 @@ driverfs_write_file(struct file *file, const char *buf, size_t count, loff_t *pp
if (!entry->store)
return 0;
- dev = to_device(entry->parent);
+ dev = to_device(dir);
page = (char *)__get_free_page(GFP_KERNEL);
if (!page)
@@ -414,41 +417,28 @@ driverfs_file_lseek(struct file *file, loff_t offset, int orig)
static int driverfs_open_file(struct inode * inode, struct file * filp)
{
- struct driver_file_entry * entry;
+ struct driver_dir_entry * dir;
struct device * dev;
- entry = (struct driver_file_entry *)inode->u.generic_ip;
- if (!entry)
+ dir = (struct driver_dir_entry *)filp->f_dentry->d_parent->d_fsdata;
+ if (!dir)
return -EFAULT;
- dev = to_device(entry->parent);
+ dev = to_device(dir);
get_device(dev);
- filp->private_data = entry;
return 0;
}
static int driverfs_release(struct inode * inode, struct file * filp)
{
- struct driver_file_entry * entry;
+ struct driver_dir_entry * dir;
struct device * dev;
- entry = (struct driver_file_entry *)filp->private_data;
- if (!entry)
- return -EFAULT;
- dev = to_device(entry->parent);
+ dir = (struct driver_dir_entry *)filp->f_dentry->d_parent->d_fsdata;
+ dev = to_device(dir);
put_device(dev);
return 0;
}
-static int driverfs_d_delete_file (struct dentry * dentry)
-{
- struct driver_file_entry * entry;
-
- entry = (struct driver_file_entry *)dentry->d_fsdata;
- if (entry)
- kfree(entry);
- return 0;
-}
-
static struct file_operations driverfs_file_operations = {
.read = driverfs_read_file,
.write = driverfs_write_file,
@@ -468,10 +458,6 @@ static struct address_space_operations driverfs_aops = {
.commit_write = driverfs_commit_write
};
-static struct dentry_operations driverfs_dentry_file_ops = {
- .d_delete = driverfs_d_delete_file,
-};
-
static struct super_operations driverfs_ops = {
.statfs = simple_statfs,
.drop_inode = generic_delete_inode,
@@ -572,6 +558,16 @@ int __init init_driverfs_fs(void)
return register_filesystem(&driverfs_fs_type);
}
+static struct dentry * get_dentry(struct dentry * parent, const char * name)
+{
+ struct qstr qstr;
+
+ qstr.name = name;
+ qstr.len = strlen(name);
+ qstr.hash = full_name_hash(name,qstr.len);
+ return lookup_hash(&qstr,parent);
+}
+
/**
* driverfs_create_dir - create a directory in the filesystem
* @entry: directory entry
@@ -583,7 +579,6 @@ driverfs_create_dir(struct driver_dir_entry * entry,
{
struct dentry * dentry = NULL;
struct dentry * parent_dentry;
- struct qstr qstr;
int error = 0;
if (!entry)
@@ -603,10 +598,7 @@ driverfs_create_dir(struct driver_dir_entry * entry,
}
down(&parent_dentry->d_inode->i_sem);
- qstr.name = entry->name;
- qstr.len = strlen(entry->name);
- qstr.hash = full_name_hash(entry->name,qstr.len);
- dentry = lookup_hash(&qstr,parent_dentry);
+ dentry = get_dentry(parent_dentry,entry->name);
if (!IS_ERR(dentry)) {
dentry->d_fsdata = (void *) entry;
entry->dentry = dentry;
@@ -630,7 +622,6 @@ driverfs_create_file(struct driver_file_entry * entry,
struct driver_dir_entry * parent)
{
struct dentry * dentry;
- struct qstr qstr;
int error = 0;
if (!entry || !parent)
@@ -645,21 +636,10 @@ driverfs_create_file(struct driver_file_entry * entry,
}
down(&parent->dentry->d_inode->i_sem);
- qstr.name = entry->name;
- qstr.len = strlen(entry->name);
- qstr.hash = full_name_hash(entry->name,qstr.len);
- dentry = lookup_hash(&qstr,parent->dentry);
+ dentry = get_dentry(parent->dentry,entry->name);
if (!IS_ERR(dentry)) {
dentry->d_fsdata = (void *)entry;
error = driverfs_create(parent->dentry->d_inode,dentry,entry->mode);
-
- /* Still good? Ok, then fill in the blanks: */
- if (!error) {
- dentry->d_inode->u.generic_ip = (void *)entry;
- entry->dentry = dentry;
- entry->parent = parent;
- list_add_tail(&entry->node,&parent->files);
- }
} else
error = PTR_ERR(dentry);
up(&parent->dentry->d_inode->i_sem);
@@ -676,14 +656,12 @@ driverfs_create_file(struct driver_file_entry * entry,
*
*/
int driverfs_create_symlink(struct driver_dir_entry * parent,
- struct driver_file_entry * entry,
- char * target)
+ char * name, char * target)
{
struct dentry * dentry;
- struct qstr qstr;
int error = 0;
- if (!entry || !parent)
+ if (!parent)
return -EINVAL;
get_mount();
@@ -693,20 +671,10 @@ int driverfs_create_symlink(struct driver_dir_entry * parent,
return -EINVAL;
}
down(&parent->dentry->d_inode->i_sem);
- qstr.name = entry->name;
- qstr.len = strlen(entry->name);
- qstr.hash = full_name_hash(entry->name,qstr.len);
- dentry = lookup_hash(&qstr,parent->dentry);
- if (!IS_ERR(dentry)) {
- dentry->d_fsdata = (void *)entry;
+ dentry = get_dentry(parent->dentry,name);
+ if (!IS_ERR(dentry))
error = driverfs_symlink(parent->dentry->d_inode,dentry,target);
- if (!error) {
- dentry->d_inode->u.generic_ip = (void *)entry;
- entry->dentry = dentry;
- entry->parent = parent;
- list_add_tail(&entry->node,&parent->files);
- }
- } else
+ else
error = PTR_ERR(dentry);
up(&parent->dentry->d_inode->i_sem);
if (error)
@@ -724,26 +692,21 @@ int driverfs_create_symlink(struct driver_dir_entry * parent,
*/
void driverfs_remove_file(struct driver_dir_entry * dir, const char * name)
{
- struct list_head * node;
+ struct dentry * dentry;
if (!dir->dentry)
return;
down(&dir->dentry->d_inode->i_sem);
-
- node = dir->files.next;
- while (node != &dir->files) {
- struct driver_file_entry * entry = NULL;
-
- entry = list_entry(node,struct driver_file_entry,node);
- if (!strcmp(entry->name,name)) {
- list_del_init(node);
- driverfs_unlink(entry->dentry->d_parent->d_inode,entry->dentry);
- dput(entry->dentry);
+ dentry = get_dentry(dir->dentry,name);
+ if (!IS_ERR(dentry)) {
+ /* make sure dentry is really there */
+ if (dentry->d_inode &&
+ (dentry->d_parent->d_inode == dir->dentry->d_inode)) {
+ driverfs_unlink(dir->dentry->d_inode,dentry);
+ dput(dir->dentry);
put_mount();
- break;
}
- node = node->next;
}
up(&dir->dentry->d_inode->i_sem);
}
@@ -767,19 +730,16 @@ void driverfs_remove_dir(struct driver_dir_entry * dir)
down(&dentry->d_parent->d_inode->i_sem);
down(&dentry->d_inode->i_sem);
- node = dir->files.next;
- while (node != &dir->files) {
- struct driver_file_entry * entry;
- entry = list_entry(node,struct driver_file_entry,node);
+ node = dentry->d_subdirs.next;
+ while (node != &dentry->d_subdirs) {
+ struct dentry * d = list_entry(node,struct dentry,d_child);
- list_del_init(node);
- driverfs_unlink(dentry->d_inode,entry->dentry);
- dput(entry->dentry);
+ node = node->next;
+ driverfs_unlink(dentry->d_inode,d);
+ dput(dentry);
put_mount();
- node = dir->files.next;
}
up(&dentry->d_inode->i_sem);
-
driverfs_rmdir(dentry->d_parent->d_inode,dentry);
up(&dentry->d_parent->d_inode->i_sem);
dput(dentry);
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 42f58d5f061a..bba0eb57f54a 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -198,7 +198,7 @@ int find_dirent_page(nfs_readdir_descriptor_t *desc)
dfprintk(VFS, "NFS: find_dirent_page() searching directory page %ld\n", desc->page_index);
- page = read_cache_page(&inode->i_data, desc->page_index,
+ page = read_cache_page(inode->i_mapping, desc->page_index,
(filler_t *)nfs_readdir_filler, desc);
if (IS_ERR(page)) {
status = PTR_ERR(page);
@@ -566,7 +566,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, int flags)
goto out_valid;
shrink_dcache_parent(dentry);
}
- d_drop(dentry);
unlock_kernel();
dput(parent);
return 0;
@@ -639,7 +638,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry)
nfs_renew_times(dentry);
error = 0;
}
- goto out;
+ goto out_unlock;
}
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr);
@@ -655,8 +654,10 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry)
}
nfs_renew_times(dentry);
}
+out_unlock:
unlock_kernel();
out:
+ BUG_ON(error > 0);
return ERR_PTR(error);
}
@@ -712,7 +713,7 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
desc.page_index = 0;
desc.plus = 1;
- for(;(page = find_get_page(&dir->i_data, desc.page_index)); desc.page_index++) {
+ for(;(page = find_get_page(dir->i_mapping, desc.page_index)); desc.page_index++) {
res = -EIO;
if (PageUptodate(page)) {
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 5e083b6b3bca..4883b923d5f1 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -420,9 +420,9 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
kunmap(*page);
return nr;
short_pkt:
- kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
entry[0] = entry[1] = 0;
+ kunmap(*page);
return nr;
err_unmap:
kunmap(*page);
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 784720607bf8..4ebce82ad8e0 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -574,10 +574,10 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
kunmap(*page);
return nr;
short_pkt:
- kunmap(*page);
printk(KERN_NOTICE "NFS: short packet in readdir reply!\n");
/* truncate listing */
entry[0] = entry[1] = 0;
+ kunmap(*page);
return nr;
err_unmap:
kunmap(*page);
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index 98e5bae274f2..732449552331 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -269,6 +269,7 @@ static void smbiod_doio(struct smb_sb_info *server)
set_bit(SMBIOD_DATA_READY, &smbiod_flags);
out:
+ return;
}
/*
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index a046374ab085..c60ae7e1fcde 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -673,7 +673,7 @@ magic_found:
}
if (uspi->s_bsize < 4096) {
printk("ufs_read_super: block size %u is too small\n",
- uspi->s_fsize);
+ uspi->s_bsize);
goto failed;
}
if (uspi->s_bsize / uspi->s_fsize > 8) {
diff --git a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h
index 07a63df9024e..e821ac372464 100644
--- a/include/asm-alpha/socket.h
+++ b/include/asm-alpha/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
/*
* Note: we only bother about making the SOL_SOCKET options
* same as OSF/1, as that's all that "normal" programs are
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h
index 1e09a6483716..5c1428e41b06 100644
--- a/include/asm-arm/socket.h
+++ b/include/asm-arm/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h
index 30524cbe1719..182b104dad2d 100644
--- a/include/asm-i386/desc.h
+++ b/include/asm-i386/desc.h
@@ -86,10 +86,9 @@ static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size)
_set_tssldt_desc(&cpu_gdt_table[cpu][LDT_ENTRY], (int)addr, ((size << 3)-1), 0x82);
}
-#define TLS_FLAGS_MASK 0x00000003
+#define TLS_FLAGS_MASK 0x00000001
#define TLS_FLAG_WRITABLE 0x00000001
-#define TLS_FLAG_CLEAR 0x00000002
static inline void load_TLS_desc(struct thread_struct *t, unsigned int cpu)
{
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 6b116b38a4e2..a6d46dec1d09 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -85,7 +85,9 @@ extern volatile int logical_apicid_to_cpu[MAX_APICID];
*/
#define smp_processor_id() (current_thread_info()->cpu)
-#define cpu_possible(cpu) (phys_cpu_present_map & (1<<(cpu)))
+extern volatile unsigned long cpu_callout_map;
+
+#define cpu_possible(cpu) (cpu_callout_map & (1<<(cpu)))
#define cpu_online(cpu) (cpu_online_map & (1<<(cpu)))
extern inline unsigned int num_online_cpus(void)
@@ -113,7 +115,6 @@ static __inline int logical_smp_processor_id(void)
return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR));
}
-extern volatile unsigned long cpu_callout_map;
/* We don't mark CPUs online until __cpu_up(), so we need another measure */
static inline int num_booting_cpus(void)
{
diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h
index fbcc44d3430e..525f83218cd8 100644
--- a/include/asm-i386/socket.h
+++ b/include/asm-i386/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 678a64fed800..d565c78c2d81 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -39,7 +39,7 @@ typedef struct {
* We make no fairness assumptions. They have a cost.
*/
-#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0)
+#define spin_is_locked(x) (*(volatile signed char *)(&(x)->lock) <= 0)
#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
#define spin_lock_string \
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index df4f1cc4f1ac..7f4fe87d047b 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -247,6 +247,7 @@
#define __NR_futex 240
#define __NR_sched_setaffinity 241
#define __NR_sched_getaffinity 242
+#define __NR_set_thread_area 243
/* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */
diff --git a/include/asm-ia64/socket.h b/include/asm-ia64/socket.h
index 8e75850169af..01e3b50760d3 100644
--- a/include/asm-ia64/socket.h
+++ b/include/asm-ia64/socket.h
@@ -10,7 +10,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h
index a328c84b9f23..1959b608d477 100644
--- a/include/asm-m68k/socket.h
+++ b/include/asm-m68k/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index b8a570fa0af9..7288078773e1 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -4,7 +4,7 @@
#include <asm/sockios.h>
/*
- * For setsockoptions(2)
+ * For setsockopt(2)
*
* This defines are ABI conformant as far as Linux supports these ...
*/
diff --git a/include/asm-mips64/socket.h b/include/asm-mips64/socket.h
index e1e69473022e..df9fcb53d71e 100644
--- a/include/asm-mips64/socket.h
+++ b/include/asm-mips64/socket.h
@@ -12,7 +12,7 @@
#include <asm/sockios.h>
/*
- * For setsockoptions(2)
+ * For setsockopt(2)
*
* This defines are ABI conformant as far as Linux supports these ...
*/
diff --git a/include/asm-parisc/socket.h b/include/asm-parisc/socket.h
index a292ad715eb2..7833ff68f2e4 100644
--- a/include/asm-parisc/socket.h
+++ b/include/asm-parisc/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 0xffff
#define SO_DEBUG 0x0001
diff --git a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h
index 6d233588f599..beccec2431fb 100644
--- a/include/asm-ppc/socket.h
+++ b/include/asm-ppc/socket.h
@@ -12,7 +12,7 @@
#define SIOCATMARK 0x8905
#define SIOCGSTAMP 0x8906 /* Get stamp */
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-s390/socket.h b/include/asm-s390/socket.h
index 5576c366b35d..d7b7f5bb6a39 100644
--- a/include/asm-s390/socket.h
+++ b/include/asm-s390/socket.h
@@ -11,7 +11,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-sh/socket.h b/include/asm-sh/socket.h
index e668153e67b9..918e2f225959 100644
--- a/include/asm-sh/socket.h
+++ b/include/asm-sh/socket.h
@@ -3,7 +3,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 1
#define SO_DEBUG 1
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h
index 9521e1386eb8..254d446bdcf9 100644
--- a/include/asm-sparc/socket.h
+++ b/include/asm-sparc/socket.h
@@ -4,7 +4,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 0xffff
#define SO_DEBUG 0x0001
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
index fb99636b12be..d041e3352970 100644
--- a/include/asm-sparc64/socket.h
+++ b/include/asm-sparc64/socket.h
@@ -4,7 +4,7 @@
#include <asm/sockios.h>
-/* For setsockoptions(2) */
+/* For setsockopt(2) */
#define SOL_SOCKET 0xffff
#define SO_DEBUG 0x0001
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
index 3448d862d976..d93fce08bc3e 100644
--- a/include/linux/devfs_fs_kernel.h
+++ b/include/linux/devfs_fs_kernel.h
@@ -94,12 +94,7 @@ extern devfs_handle_t devfs_get_next_sibling (devfs_handle_t de);
extern void devfs_auto_unregister (devfs_handle_t master,devfs_handle_t slave);
extern devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master);
extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen);
-extern int devfs_register_chrdev (unsigned int major, const char *name,
- struct file_operations *fops);
-extern int devfs_register_blkdev (unsigned int major, const char *name,
- struct block_device_operations *bdops);
-extern int devfs_unregister_chrdev (unsigned int major, const char *name);
-extern int devfs_unregister_blkdev (unsigned int major, const char *name);
+extern int devfs_only (void);
extern void devfs_register_tape (devfs_handle_t de);
extern void devfs_register_series (devfs_handle_t dir, const char *format,
@@ -239,23 +234,9 @@ static inline const char *devfs_get_name (devfs_handle_t de,
{
return NULL;
}
-static inline int devfs_register_chrdev (unsigned int major, const char *name,
- struct file_operations *fops)
+static inline int devfs_only (void)
{
- return register_chrdev (major, name, fops);
-}
-static inline int devfs_register_blkdev (unsigned int major, const char *name,
- struct block_device_operations *bdops)
-{
- return register_blkdev (major, name, bdops);
-}
-static inline int devfs_unregister_chrdev (unsigned int major,const char *name)
-{
- return unregister_chrdev (major, name);
-}
-static inline int devfs_unregister_blkdev (unsigned int major,const char *name)
-{
- return unregister_blkdev (major, name);
+ return 0;
}
static inline void devfs_register_tape (devfs_handle_t de)
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h
index d077bc18a424..ab4ee81a94e9 100644
--- a/include/linux/dqblk_xfs.h
+++ b/include/linux/dqblk_xfs.h
@@ -30,8 +30,8 @@
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
-#ifndef _LINUX_XQM_H
-#define _LINUX_XQM_H
+#ifndef _LINUX_DQBLK_XFS_H
+#define _LINUX_DQBLK_XFS_H
#include <linux/types.h>
@@ -156,4 +156,4 @@ typedef struct fs_quota_stat {
__u16 qs_iwarnlimit; /* limit for num warnings */
} fs_quota_stat_t;
-#endif /* _LINUX_XQM_H */
+#endif /* _LINUX_DQBLK_XFS_H */
diff --git a/include/linux/driverfs_fs.h b/include/linux/driverfs_fs.h
index f9cc70450e6b..758dc23f09f6 100644
--- a/include/linux/driverfs_fs.h
+++ b/include/linux/driverfs_fs.h
@@ -30,17 +30,13 @@ struct driver_dir_entry {
char * name;
struct dentry * dentry;
mode_t mode;
- struct list_head files;
};
struct device;
struct driver_file_entry {
- struct driver_dir_entry * parent;
- struct list_head node;
char * name;
mode_t mode;
- struct dentry * dentry;
ssize_t (*show)(struct device * dev, char * buf, size_t count, loff_t off);
ssize_t (*store)(struct device * dev, const char * buf, size_t count, loff_t off);
@@ -58,8 +54,7 @@ driverfs_create_file(struct driver_file_entry * entry,
extern int
driverfs_create_symlink(struct driver_dir_entry * parent,
- struct driver_file_entry * entry,
- char * target);
+ char * name, char * target);
extern void
driverfs_remove_file(struct driver_dir_entry *, const char * name);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 3bd08ecdaf0b..5730a5bd5a78 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -6,13 +6,14 @@ typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
typedef void (elevator_merge_cleanup_fn) (request_queue_t *, struct request *, int);
-typedef void (elevator_merge_req_fn) (struct request *, struct request *);
+typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
typedef struct request *(elevator_next_req_fn) (request_queue_t *);
typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, struct list_head *);
typedef int (elevator_queue_empty_fn) (request_queue_t *);
typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
+typedef struct list_head *(elevator_get_sort_head_fn) (request_queue_t *, struct request *);
typedef int (elevator_init_fn) (request_queue_t *, elevator_t *);
typedef void (elevator_exit_fn) (request_queue_t *, elevator_t *);
@@ -28,6 +29,7 @@ struct elevator_s
elevator_remove_req_fn *elevator_remove_req_fn;
elevator_queue_empty_fn *elevator_queue_empty_fn;
+ elevator_get_sort_head_fn *elevator_get_sort_head_fn;
elevator_init_fn *elevator_init_fn;
elevator_exit_fn *elevator_exit_fn;
@@ -45,6 +47,8 @@ extern int elv_merge(request_queue_t *, struct request **, struct bio *);
extern void elv_merge_requests(request_queue_t *, struct request *,
struct request *);
extern void elv_remove_request(request_queue_t *, struct request *);
+extern int elv_queue_empty(request_queue_t *);
+extern inline struct list_head *elv_get_sort_head(request_queue_t *, struct request *);
/*
* noop I/O scheduler. always merges, always inserts new request at tail
@@ -72,6 +76,10 @@ typedef struct blkelv_ioctl_arg_s {
extern int elevator_init(request_queue_t *, elevator_t *, elevator_t);
extern void elevator_exit(request_queue_t *, elevator_t *);
+extern inline int bio_rq_in_between(struct bio *, struct request *, struct list_head *);
+extern inline int elv_rq_merge_ok(struct request *, struct bio *);
+extern inline int elv_try_merge(struct request *, struct bio *);
+extern inline int elv_try_last_merge(request_queue_t *, struct request **, struct bio *);
/*
* Return values from elevator merger
@@ -80,10 +88,4 @@ extern void elevator_exit(request_queue_t *, elevator_t *);
#define ELEVATOR_FRONT_MERGE 1
#define ELEVATOR_BACK_MERGE 2
-/*
- * will change once we move to a more complex data structure than a simple
- * list for pending requests
- */
-#define elv_queue_empty(q) list_empty(&(q)->queue_head)
-
#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 4dd795f055e6..f65e5649c0e0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -764,8 +764,6 @@ struct ata_device {
request_queue_t queue; /* per device request queue */
struct request *rq; /* current request */
- unsigned long sleep; /* sleep until this time */
-
u8 retry_pio; /* retrying dma capable host in pio */
u8 state; /* retry state */
@@ -785,7 +783,6 @@ struct ata_device {
unsigned atapi_overlap : 1; /* flag: ATAPI overlap (not supported) */
unsigned doorlocking : 1; /* flag: for removable only: door lock/unlock works */
unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */
- unsigned remap_0_to_1 : 2; /* 0=remap if ezdrive, 1=remap, 2=noremap */
unsigned ata_flash : 1; /* 1=present, 0=default */
unsigned addressing; /* : 2; 0=28-bit, 1=48-bit, 2=64-bit */
u8 scsi; /* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */
@@ -797,7 +794,6 @@ struct ata_device {
u8 mult_count; /* current multiple sector setting */
u8 bad_wstat; /* used for ignoring WRERR_STAT */
u8 nowerr; /* used for ignoring WRERR_STAT */
- u8 sect0; /* offset of first sector for DM6:DDO */
u8 head; /* "real" number of heads */
u8 sect; /* "real" sectors per track */
u8 bios_head; /* BIOS/fdisk/LILO number of heads */
@@ -947,6 +943,8 @@ struct ata_channel {
void (*udma_timeout) (struct ata_device *);
void (*udma_irq_lost) (struct ata_device *);
+ unsigned long seg_boundary_mask;
+ unsigned int max_segment_size;
unsigned int *dmatable_cpu; /* dma physical region descriptor table (cpu view) */
dma_addr_t dmatable_dma; /* dma physical region descriptor table (dma view) */
struct scatterlist *sg_table; /* Scatter-gather list used to build the above */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 747312505986..8cfa042a42fc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -401,8 +401,6 @@ extern void swapin_readahead(swp_entry_t);
extern int can_share_swap_page(struct page *);
extern int remove_exclusive_swap_page(struct page *);
-extern void __free_pte(pte_t);
-
/* mmap.c */
extern void lock_vma_mappings(struct vm_area_struct *);
extern void unlock_vma_mappings(struct vm_area_struct *);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c5f593251536..def54af56e32 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -569,6 +569,8 @@ int pci_write_config_dword(struct pci_dev *dev, int where, u32 val);
extern spinlock_t pci_lock;
+extern spinlock_t pci_lock;
+
int pci_enable_device(struct pci_dev *dev);
void pci_disable_device(struct pci_dev *dev);
void pci_set_master(struct pci_dev *dev);
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 1f1fbb1254eb..4209f934d03f 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -221,6 +221,7 @@ static inline void init_sigpending(struct sigpending *sig)
extern long do_sigpending(void *, unsigned long);
#ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER
+struct pt_regs;
extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs);
#endif
diff --git a/init/main.c b/init/main.c
index 93efbf4fb7f6..cd99093e0193 100644
--- a/init/main.c
+++ b/init/main.c
@@ -526,10 +526,12 @@ static void __init do_basic_setup(void)
static void do_pre_smp_initcalls(void)
{
- extern int migration_init(void);
extern int spawn_ksoftirqd(void);
+#ifdef CONFIG_SMP
+ extern int migration_init(void);
migration_init();
+#endif
spawn_ksoftirqd();
}
diff --git a/kernel/futex.c b/kernel/futex.c
index dca7e1a84864..ef3dc8b00a5f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -245,8 +245,8 @@ static unsigned int futex_poll(struct file *filp,
}
static struct file_operations futex_fops = {
- release: futex_close,
- poll: futex_poll,
+ .release = futex_close,
+ .poll = futex_poll,
};
/* Signal allows caller to avoid the race which would occur if they
@@ -357,8 +357,8 @@ futexfs_get_sb(struct file_system_type *fs_type,
}
static struct file_system_type futex_fs_type = {
- name: "futexfs",
- get_sb: futexfs_get_sb,
+ .name = "futexfs",
+ .get_sb = futexfs_get_sb,
};
static int __init init(void)
diff --git a/kernel/kmod.c b/kernel/kmod.c
index d063d20001a4..53dd3ca194c3 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -346,15 +346,15 @@ int call_usermodehelper(char *path, char **argv, char **envp)
{
DECLARE_COMPLETION(work);
struct subprocess_info sub_info = {
- complete: &work,
- path: path,
- argv: argv,
- envp: envp,
- retval: 0,
+ .complete = &work,
+ .path = path,
+ .argv = argv,
+ .envp = envp,
+ .retval = 0,
};
struct tq_struct tqs = {
- routine: __call_usermodehelper,
- data: &sub_info,
+ .routine = __call_usermodehelper,
+ .data = &sub_info,
};
if (path[0] == '\0')
diff --git a/kernel/module.c b/kernel/module.c
index 8d2f2a46de0e..b9e8e9190944 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -44,15 +44,15 @@ extern const char __stop___kallsyms[] __attribute__ ((weak));
struct module kernel_module =
{
- size_of_struct: sizeof(struct module),
- name: "",
- uc: {ATOMIC_INIT(1)},
- flags: MOD_RUNNING,
- syms: __start___ksymtab,
- ex_table_start: __start___ex_table,
- ex_table_end: __stop___ex_table,
- kallsyms_start: __start___kallsyms,
- kallsyms_end: __stop___kallsyms,
+ .size_of_struct = sizeof(struct module),
+ .name = "",
+ .uc = {ATOMIC_INIT(1)},
+ .flags = MOD_RUNNING,
+ .syms = __start___ksymtab,
+ .ex_table_start = __start___ex_table,
+ .ex_table_end = __stop___ex_table,
+ .kallsyms_start = __start___kallsyms,
+ .kallsyms_end = __stop___kallsyms,
};
struct module *module_list = &kernel_module;
@@ -1132,10 +1132,10 @@ static int m_show(struct seq_file *m, void *p)
return 0;
}
struct seq_operations modules_op = {
- start: m_start,
- next: m_next,
- stop: m_stop,
- show: m_show
+ .start = m_start,
+ .next = m_next,
+ .stop = m_stop,
+ .show = m_show
};
/*
@@ -1214,10 +1214,10 @@ static int s_show(struct seq_file *m, void *p)
}
struct seq_operations ksyms_op = {
- start: s_start,
- next: s_next,
- stop: s_stop,
- show: s_show
+ .start = s_start,
+ .next = s_next,
+ .stop = s_stop,
+ .show = s_show
};
#else /* CONFIG_MODULES */
diff --git a/kernel/platform.c b/kernel/platform.c
index 9848541526a6..66eb41af168d 100644
--- a/kernel/platform.c
+++ b/kernel/platform.c
@@ -23,13 +23,13 @@ int default_suspend(int state, int flags)
}
static struct platform_t default_platform = {
- name: "Default Platform",
- suspend_states: 0,
- reboot: default_reboot,
- halt: default_halt,
- power_off: default_halt,
- suspend: default_suspend,
- idle: default_idle,
+ .name = "Default Platform",
+ .suspend_states = 0,
+ .reboot = default_reboot,
+ .halt = default_halt,
+ .power_off = default_halt,
+ .suspend = default_suspend,
+ .idle = default_idle,
};
struct platform_t * platform = &default_platform;
diff --git a/kernel/sched.c b/kernel/sched.c
index 12e54306d4c0..c196fbddbab9 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1963,7 +1963,7 @@ out:
*/
static int migration_thread(void * data)
{
- struct sched_param param = { sched_priority: MAX_RT_PRIO-1 };
+ struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
int cpu = (long) data;
runqueue_t *rq;
int ret;
diff --git a/kernel/suspend.c b/kernel/suspend.c
index 771d44b5ea39..f11214bb9a67 100644
--- a/kernel/suspend.c
+++ b/kernel/suspend.c
@@ -65,6 +65,7 @@
#include <linux/swapops.h>
extern void signal_wake_up(struct task_struct *t);
+extern int sys_sync(void);
unsigned char software_suspend_enabled = 0;
@@ -814,17 +815,17 @@ void do_magic_suspend_2(void)
PRINTK(KERN_WARNING "%sLeaving do_magic_suspend_2...\n", name_suspend);
}
-/*
- * We try to swap out as much as we can then make a copy of the
- * occupied pages in memory so we can make a copy of kernel state
- * atomically, the I/O needed by saving won't bother us anymore.
- */
void do_software_suspend(void)
{
arch_prepare_suspend();
if (prepare_suspend_console())
printk( "%sCan't allocate a console... proceeding\n", name_suspend);
if (!prepare_suspend_processes()) {
+
+ /* At this point, all user processes and "dangerous"
+ kernel threads are stopped. Free some memory, as we
+ need half of memory free. */
+
free_some_memory();
/* No need to invalidate any vfsmnt list -- they will be valid after resume, anyway.
@@ -834,8 +835,19 @@ void do_software_suspend(void)
*/
PRINTK("Syncing disks before copy\n");
do_suspend_sync();
+
+ /* Save state of all device drivers, and stop them. */
if(drivers_suspend()==0)
- do_magic(0); /* This function returns after machine woken up from resume */
+ /* If stopping device drivers worked, we proceed basically into
+ * suspend_save_image.
+ *
+ * do_magic(0) returns after system is resumed.
+ *
+ * do_magic() copies all "used" memory to "free" memory, then
+ * unsuspends all device drivers, and writes memory to disk
+ * using normal kernel mechanism.
+ */
+ do_magic(0);
PRINTK("Restarting processes...\n");
thaw_processes();
}
@@ -1003,8 +1015,8 @@ static int bdev_read_page(struct block_device *bdev, long pos, void *buf)
static int bdev_write_page(struct block_device *bdev, long pos, void *buf)
{
- struct buffer_head *bh;
#if 0
+ struct buffer_head *bh;
BUG_ON (pos%PAGE_SIZE);
bh = __bread(bdev, pos/PAGE_SIZE, PAGE_SIZE);
if (!bh || (!bh->b_data)) {
diff --git a/kernel/sys.c b/kernel/sys.c
index 37a9525b3f1d..316a63de74ea 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -391,7 +391,7 @@ static void deferred_cad(void *dummy)
void ctrl_alt_del(void)
{
static struct tq_struct cad_tq = {
- routine: deferred_cad,
+ .routine = deferred_cad,
};
if (C_A_D)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 7317c78306c3..4b9619033b07 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -126,12 +126,12 @@ static ssize_t proc_writesys(struct file *, const char *, size_t, loff_t *);
static int proc_sys_permission(struct inode *, int);
struct file_operations proc_sys_file_operations = {
- read: proc_readsys,
- write: proc_writesys,
+ .read = proc_readsys,
+ .write = proc_writesys,
};
static struct inode_operations proc_sys_inode_operations = {
- permission: proc_sys_permission,
+ .permission = proc_sys_permission,
};
extern struct proc_dir_entry *proc_sys_root;
diff --git a/kernel/user.c b/kernel/user.c
index c77f52ea9cff..752cda29c965 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -28,9 +28,9 @@ static struct list_head uidhash_table[UIDHASH_SZ];
static spinlock_t uidhash_lock = SPIN_LOCK_UNLOCKED;
struct user_struct root_user = {
- __count: ATOMIC_INIT(1),
- processes: ATOMIC_INIT(1),
- files: ATOMIC_INIT(0)
+ .__count = ATOMIC_INIT(1),
+ .processes = ATOMIC_INIT(1),
+ .files = ATOMIC_INIT(0)
};
/*
diff --git a/mm/filemap.c b/mm/filemap.c
index 52ffe553927c..2e84aab17412 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1346,7 +1346,7 @@ page_not_uptodate:
}
static struct vm_operations_struct generic_file_vm_ops = {
- nopage: filemap_nopage,
+ .nopage = filemap_nopage,
};
/* This is used for a general mmap of a disk file */
diff --git a/mm/numa.c b/mm/numa.c
index b18eea382b6a..a7605cdae51b 100644
--- a/mm/numa.c
+++ b/mm/numa.c
@@ -12,7 +12,7 @@
int numnodes = 1; /* Initialized for UMA platforms */
static bootmem_data_t contig_bootmem_data;
-pg_data_t contig_page_data = { bdata: &contig_bootmem_data };
+pg_data_t contig_page_data = { .bdata = &contig_bootmem_data };
#ifndef CONFIG_DISCONTIGMEM
diff --git a/mm/page_io.c b/mm/page_io.c
index 5ecf8adba196..e42e33511a09 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -132,11 +132,11 @@ static int swap_vm_writeback(struct page *page, int *nr_to_write)
}
struct address_space_operations swap_aops = {
- vm_writeback: swap_vm_writeback,
- writepage: swap_writepage,
- readpage: swap_readpage,
- sync_page: block_sync_page,
- set_page_dirty: __set_page_dirty_nobuffers,
+ .vm_writeback = swap_vm_writeback,
+ .writepage = swap_writepage,
+ .readpage = swap_readpage,
+ .sync_page = block_sync_page,
+ .set_page_dirty = __set_page_dirty_nobuffers,
};
/*
diff --git a/mm/readahead.c b/mm/readahead.c
index e1f471b9be5c..194f56db2ae4 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -14,8 +14,8 @@
#include <linux/backing-dev.h>
struct backing_dev_info default_backing_dev_info = {
- ra_pages: (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
- state: 0,
+ .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
+ .state = 0,
};
/*
diff --git a/mm/rmap.c b/mm/rmap.c
index 6287e9cacc2a..891583e3438f 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -208,8 +208,6 @@ void page_remove_rmap(struct page * page, pte_t * ptep)
}
printk("\n");
printk(KERN_ERR "page_remove_rmap: driver cleared PG_reserved ?\n");
-#else
- BUG();
#endif
out:
diff --git a/mm/shmem.c b/mm/shmem.c
index c2cd99b6f953..abb0685049e2 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1312,14 +1312,14 @@ static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
}
static struct inode_operations shmem_symlink_inline_operations = {
- readlink: shmem_readlink_inline,
- follow_link: shmem_follow_link_inline,
+ .readlink = shmem_readlink_inline,
+ .follow_link = shmem_follow_link_inline,
};
static struct inode_operations shmem_symlink_inode_operations = {
- truncate: shmem_truncate,
- readlink: shmem_readlink,
- follow_link: shmem_follow_link,
+ .truncate = shmem_truncate,
+ .readlink = shmem_readlink,
+ .follow_link = shmem_follow_link,
};
static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long * blocks, unsigned long *inodes)
@@ -1520,52 +1520,52 @@ static void destroy_inodecache(void)
}
static struct address_space_operations shmem_aops = {
- writepage: shmem_writepage,
- set_page_dirty: __set_page_dirty_nobuffers,
+ .writepage = shmem_writepage,
+ .set_page_dirty = __set_page_dirty_nobuffers,
};
static struct file_operations shmem_file_operations = {
- mmap: shmem_mmap,
+ .mmap = shmem_mmap,
#ifdef CONFIG_TMPFS
- read: shmem_file_read,
- write: shmem_file_write,
- fsync: shmem_sync_file,
+ .read = shmem_file_read,
+ .write = shmem_file_write,
+ .fsync = shmem_sync_file,
#endif
};
static struct inode_operations shmem_inode_operations = {
- truncate: shmem_truncate,
- setattr: shmem_notify_change,
+ .truncate = shmem_truncate,
+ .setattr = shmem_notify_change,
};
static struct inode_operations shmem_dir_inode_operations = {
#ifdef CONFIG_TMPFS
- create: shmem_create,
- lookup: simple_lookup,
- link: shmem_link,
- unlink: shmem_unlink,
- symlink: shmem_symlink,
- mkdir: shmem_mkdir,
- rmdir: shmem_rmdir,
- mknod: shmem_mknod,
- rename: shmem_rename,
+ .create = shmem_create,
+ .lookup = simple_lookup,
+ .link = shmem_link,
+ .unlink = shmem_unlink,
+ .symlink = shmem_symlink,
+ .mkdir = shmem_mkdir,
+ .rmdir = shmem_rmdir,
+ .mknod = shmem_mknod,
+ .rename = shmem_rename,
#endif
};
static struct super_operations shmem_ops = {
- alloc_inode: shmem_alloc_inode,
- destroy_inode: shmem_destroy_inode,
+ .alloc_inode = shmem_alloc_inode,
+ .destroy_inode = shmem_destroy_inode,
#ifdef CONFIG_TMPFS
- statfs: shmem_statfs,
- remount_fs: shmem_remount_fs,
+ .statfs = shmem_statfs,
+ .remount_fs = shmem_remount_fs,
#endif
- delete_inode: shmem_delete_inode,
- drop_inode: generic_delete_inode,
- put_super: shmem_put_super,
+ .delete_inode = shmem_delete_inode,
+ .drop_inode = generic_delete_inode,
+ .put_super = shmem_put_super,
};
static struct vm_operations_struct shmem_vm_ops = {
- nopage: shmem_nopage,
+ .nopage = shmem_nopage,
};
static struct super_block *shmem_get_sb(struct file_system_type *fs_type,
@@ -1577,17 +1577,17 @@ static struct super_block *shmem_get_sb(struct file_system_type *fs_type,
#ifdef CONFIG_TMPFS
/* type "shm" will be tagged obsolete in 2.5 */
static struct file_system_type shmem_fs_type = {
- owner: THIS_MODULE,
- name: "shmem",
- get_sb: shmem_get_sb,
- kill_sb: kill_litter_super,
+ .owner = THIS_MODULE,
+ .name = "shmem",
+ .get_sb = shmem_get_sb,
+ .kill_sb = kill_litter_super,
};
#endif
static struct file_system_type tmpfs_fs_type = {
- owner: THIS_MODULE,
- name: "tmpfs",
- get_sb: shmem_get_sb,
- kill_sb: kill_litter_super,
+ .owner = THIS_MODULE,
+ .name = "tmpfs",
+ .get_sb = shmem_get_sb,
+ .kill_sb = kill_litter_super,
};
static struct vfsmount *shm_mnt;
diff --git a/mm/slab.c b/mm/slab.c
index af2e657d54d4..f15e274aba6c 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -126,7 +126,7 @@
* Bufctl's are used for linking objs within a slab
* linked offsets.
*
- * This implementaion relies on "struct page" for locating the cache &
+ * This implementation relies on "struct page" for locating the cache &
* slab an object belongs to.
* This allows the bufctl structure to be small (one int), but limits
* the number of objects a slab (not a cache) can contain when off-slab
@@ -384,14 +384,14 @@ static struct {
/* internal cache of cache description objs */
static kmem_cache_t cache_cache = {
- slabs_full: LIST_HEAD_INIT(cache_cache.slabs_full),
- slabs_partial: LIST_HEAD_INIT(cache_cache.slabs_partial),
- slabs_free: LIST_HEAD_INIT(cache_cache.slabs_free),
- objsize: sizeof(kmem_cache_t),
- flags: SLAB_NO_REAP,
- spinlock: SPIN_LOCK_UNLOCKED,
- colour_off: L1_CACHE_BYTES,
- name: "kmem_cache",
+ .slabs_full = LIST_HEAD_INIT(cache_cache.slabs_full),
+ .slabs_partial = LIST_HEAD_INIT(cache_cache.slabs_partial),
+ .slabs_free = LIST_HEAD_INIT(cache_cache.slabs_free),
+ .objsize = sizeof(kmem_cache_t),
+ .flags = SLAB_NO_REAP,
+ .spinlock = SPIN_LOCK_UNLOCKED,
+ .colour_off = L1_CACHE_BYTES,
+ .name = "kmem_cache",
};
/* Guard access to the cache-chain. */
@@ -2053,10 +2053,10 @@ static int s_show(struct seq_file *m, void *p)
*/
struct seq_operations slabinfo_op = {
- start: s_start,
- next: s_next,
- stop: s_stop,
- show: s_show
+ .start = s_start,
+ .next = s_next,
+ .stop = s_stop,
+ .show = s_show,
};
#define MAX_SLABINFO_WRITE 128
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 2069d022595c..a9856bced919 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -22,23 +22,23 @@
* avoid some special-casing in other parts of the kernel.
*/
static struct inode swapper_inode = {
- i_mapping: &swapper_space,
+ .i_mapping = &swapper_space,
};
extern struct address_space_operations swap_aops;
struct address_space swapper_space = {
- page_tree: RADIX_TREE_INIT(GFP_ATOMIC),
- page_lock: RW_LOCK_UNLOCKED,
- clean_pages: LIST_HEAD_INIT(swapper_space.clean_pages),
- dirty_pages: LIST_HEAD_INIT(swapper_space.dirty_pages),
- io_pages: LIST_HEAD_INIT(swapper_space.io_pages),
- locked_pages: LIST_HEAD_INIT(swapper_space.locked_pages),
- host: &swapper_inode,
- a_ops: &swap_aops,
- i_shared_lock: SPIN_LOCK_UNLOCKED,
- private_lock: SPIN_LOCK_UNLOCKED,
- private_list: LIST_HEAD_INIT(swapper_space.private_list),
+ .page_tree = RADIX_TREE_INIT(GFP_ATOMIC),
+ .page_lock = RW_LOCK_UNLOCKED,
+ .clean_pages = LIST_HEAD_INIT(swapper_space.clean_pages),
+ .dirty_pages = LIST_HEAD_INIT(swapper_space.dirty_pages),
+ .io_pages = LIST_HEAD_INIT(swapper_space.io_pages),
+ .locked_pages = LIST_HEAD_INIT(swapper_space.locked_pages),
+ .host = &swapper_inode,
+ .a_ops = &swap_aops,
+ .i_shared_lock = SPIN_LOCK_UNLOCKED,
+ .private_lock = SPIN_LOCK_UNLOCKED,
+ .private_list = LIST_HEAD_INIT(swapper_space.private_list),
};
#define INC_CACHE_INFO(x) do { swap_cache_info.x++; } while (0)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 4ee3ed1be090..e2d3fbd665a2 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -469,7 +469,7 @@ drop:
/*
- * Send RARP request packet over a signle interface.
+ * Send RARP request packet over a single interface.
*/
static void __init ic_rarp_send_if(struct ic_device *d)
{
diff --git a/net/netlink/netlink_dev.c b/net/netlink/netlink_dev.c
index 131209fea01d..f5b4a4294fcf 100644
--- a/net/netlink/netlink_dev.c
+++ b/net/netlink/netlink_dev.c
@@ -182,7 +182,7 @@ static void __init make_devfs_entries (const char *name, int minor)
int __init init_netlink(void)
{
- if (devfs_register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
+ if (register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
printk(KERN_ERR "netlink: unable to get major %d\n", NETLINK_MAJOR);
return -EIO;
}
@@ -217,7 +217,7 @@ int init_module(void)
void cleanup_module(void)
{
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(NETLINK_MAJOR, "netlink");
+ unregister_chrdev(NETLINK_MAJOR, "netlink");
}
#endif
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 7ef8543de0e5..6f3d7152cf56 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -106,7 +106,7 @@ static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
#endif
DPRINTK("ingress_change(sch %p,[qdisc %p],classid %x,parent %x),"
"arg 0x%lx\n", sch, p, classid, parent, *arg);
- DPRINTK("No effect. sch_ingress doesnt maintain classes at the moment");
+ DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
return 0;
}
@@ -118,7 +118,7 @@ static void ingress_walk(struct Qdisc *sch,struct qdisc_walker *walker)
struct ingress_qdisc_data *p = PRIV(sch);
#endif
DPRINTK("ingress_walk(sch %p,[qdisc %p],walker %p)\n", sch, p, walker);
- DPRINTK("No effect. sch_ingress doesnt maintain classes at the moment");
+ DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
}
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 001c2253ec8f..283fac6a3951 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -605,17 +605,17 @@ call_status(struct rpc_task *task)
{
struct rpc_clnt *clnt = task->tk_client;
struct rpc_xprt *xprt = clnt->cl_xprt;
- struct rpc_rqst *req;
- int status = task->tk_status;
+ struct rpc_rqst *req = task->tk_rqstp;
+ int status;
+
+ if (req->rq_received != 0)
+ task->tk_status = req->rq_received;
dprintk("RPC: %4d call_status (status %d)\n",
task->tk_pid, task->tk_status);
- req = task->tk_rqstp;
- if (req->rq_received != 0)
- status = req->rq_received;
+ status = task->tk_status;
if (status >= 0) {
- req->rq_received = 0;
task->tk_action = call_decode;
return;
}
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 3d4ba37b48e1..e6ae990b0cc8 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -137,17 +137,14 @@ xprt_from_sock(struct sock *sk)
* Also prevents TCP socket reconnections from colliding with writes.
*/
static int
-xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
+__xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
{
- int retval;
- spin_lock_bh(&xprt->sock_lock);
if (!xprt->snd_task) {
if (xprt->nocong || __xprt_get_cong(xprt, task))
xprt->snd_task = task;
}
if (xprt->snd_task != task) {
- dprintk("RPC: %4d TCP write queue full (task %d)\n",
- task->tk_pid, xprt->snd_task->tk_pid);
+ dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
task->tk_timeout = 0;
task->tk_status = -EAGAIN;
if (task->tk_rqstp->rq_nresend)
@@ -155,11 +152,21 @@ xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
else
rpc_sleep_on(&xprt->sending, task, NULL, NULL);
}
- retval = xprt->snd_task == task;
+ return xprt->snd_task == task;
+}
+
+static inline int
+xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
+{
+ int retval;
+
+ spin_lock_bh(&xprt->sock_lock);
+ retval = __xprt_lock_write(xprt, task);
spin_unlock_bh(&xprt->sock_lock);
return retval;
}
+
static void
__xprt_lock_write_next(struct rpc_xprt *xprt)
{
@@ -564,8 +571,8 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied)
#endif
dprintk("RPC: %4d has input (%d bytes)\n", task->tk_pid, copied);
- task->tk_status = copied;
req->rq_received = copied;
+ list_del_init(&req->rq_list);
/* ... and wake up the process. */
rpc_wake_up_task(task);
@@ -1057,8 +1064,16 @@ xprt_transmit(struct rpc_task *task)
*marker = htonl(0x80000000|(req->rq_slen-sizeof(*marker)));
}
- if (!xprt_lock_write(xprt, task))
+ spin_lock_bh(&xprt->sock_lock);
+ if (!__xprt_lock_write(xprt, task)) {
+ spin_unlock_bh(&xprt->sock_lock);
return;
+ }
+ if (list_empty(&req->rq_list)) {
+ list_add_tail(&req->rq_list, &xprt->recv);
+ req->rq_received = 0;
+ }
+ spin_unlock_bh(&xprt->sock_lock);
do_xprt_transmit(task);
}
@@ -1242,9 +1257,6 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
if (!xid)
xid++;
INIT_LIST_HEAD(&req->rq_list);
- spin_lock_bh(&xprt->sock_lock);
- list_add_tail(&req->rq_list, &xprt->recv);
- spin_unlock_bh(&xprt->sock_lock);
}
/*
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 31efb472613c..ece4af1107e9 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -315,10 +315,8 @@ static int __init alsa_sound_init(void)
#else
devfs_handle = devfs_mk_dir(NULL, "snd", NULL);
#endif
- if (devfs_register_chrdev(snd_major, "alsa", &snd_fops)) {
-#else
- if (register_chrdev(snd_major, "alsa", &snd_fops)) {
#endif
+ if (register_chrdev(snd_major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major);
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
@@ -386,11 +384,7 @@ static void __exit alsa_sound_exit(void)
#ifdef CONFIG_SND_DEBUG_MEMORY
snd_memory_done();
#endif
-#ifdef CONFIG_DEVFS_FS
- if (devfs_unregister_chrdev(snd_major, "alsa") != 0)
-#else
if (unregister_chrdev(snd_major, "alsa") != 0)
-#endif
snd_printk(KERN_ERR "unable to unregister major device number %d\n", snd_major);
#ifdef CONFIG_DEVFS_FS
devfs_unregister(devfs_handle);
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index e539f7ef89bd..250e4c46155d 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -1733,7 +1733,6 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
spin_unlock_irqrestore(&state->card->lock, flags);
- synchronize_irq(state->card->irq);
dmabuf->ready = 0;
dmabuf->swptr = dmabuf->hwptr = 0;
dmabuf->count = dmabuf->total_bytes = 0;
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 3616220d1b5e..8110a6f19205 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -554,14 +554,13 @@ static void __exit cleanup_soundcore(void)
{
/* We have nothing to really do here - we know the lists must be
empty */
- devfs_unregister_chrdev(SOUND_MAJOR, "sound");
+ unregister_chrdev(SOUND_MAJOR, "sound");
devfs_unregister (devfs_handle);
}
static int __init init_soundcore(void)
{
- if(devfs_register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1)
- {
+ if (register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1) {
printk(KERN_ERR "soundcore: sound device already in use.\n");
return -EBUSY;
}