Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-31 21:58:01 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-31 21:58:01 -0700
commit50ebdf7960d5e162d2e985e6e3de7ac9c36eff17 (patch)
tree9707b2a93217a7795491f5f0306069ca27fd2a17
parenta9ae3e34951d8f719190ce50c991b3ec815c7d0d (diff)
parent495f02bab67c1967c5b2935c5651ca014964bc90 (diff)
Merge bk://ldm.bkbits.net/linux-2.5-driverfs
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
-rw-r--r--Documentation/ide.txt15
-rw-r--r--arch/alpha/kernel/osf_sys.c4
-rw-r--r--arch/m68k/atari/joystick.c2
-rw-r--r--arch/sparc64/solaris/socksys.c4
-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/dsp56k.c4
-rw-r--r--drivers/char/dtlk.c4
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c4
-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/ppdev.c4
-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/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/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/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/host/ohci-q.c29
-rw-r--r--drivers/usb/misc/tiglusb.c6
-rw-r--r--drivers/video/fbmem.c2
-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/nfs/dir.c9
-rw-r--r--fs/nfs/nfs2xdr.c2
-rw-r--r--fs/nfs/nfs3xdr.c2
-rw-r--r--include/asm-i386/smp.h5
-rw-r--r--include/linux/devfs_fs_kernel.h25
-rw-r--r--include/linux/elevator.h16
-rw-r--r--include/linux/ide.h6
-rw-r--r--include/linux/pci.h2
-rw-r--r--init/main.c4
-rw-r--r--mm/rmap.c2
-rw-r--r--net/netlink/netlink_dev.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
103 files changed, 472 insertions, 739 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/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/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/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/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/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..da92cbbbf0a4 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -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/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/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 6f3d59aafe04..faf9232383a6 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -820,7 +820,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;
}
@@ -838,7 +838,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/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/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/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/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/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/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/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/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/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/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/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/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/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/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;
}