diff options
author | Len Brown <len.brown@intel.com> | 2004-08-05 16:40:33 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2004-08-05 16:40:33 -0400 |
commit | c69dedacfbebfb489ae0089959e8a44b0267e0ba (patch) | |
tree | 5c2fdd7bf2147323c2e54533051730b6d321bcd2 /drivers | |
parent | bb4a8c3941694965b5c15b441b006bc46ee66f0c (diff) | |
parent | ca4a69853b12f29c5fe2bf97480f255750d96677 (diff) | |
download | history-c69dedacfbebfb489ae0089959e8a44b0267e0ba.tar.gz |
Merge intel.com:/home/lenb/bk/linux-2.6.8
into intel.com:/home/lenb/src/linux-acpi-test-2.6.8
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/system.c | 40 | ||||
-rw-r--r-- | drivers/md/multipath.c | 9 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0020.c | 7 | ||||
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 14 | ||||
-rw-r--r-- | drivers/mtd/mtdcore.c | 3 | ||||
-rw-r--r-- | drivers/mtd/nand/autcpu12.c | 10 | ||||
-rw-r--r-- | drivers/mtd/nand/tx4925ndfmc.c | 10 | ||||
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 41 | ||||
-rw-r--r-- | drivers/scsi/imm.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 17 |
10 files changed, 34 insertions, 124 deletions
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index f686992ebcec0e..9919e76d7d49cc 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c @@ -92,8 +92,7 @@ acpi_system_read_dsdt ( { acpi_status status = AE_OK; struct acpi_buffer dsdt = {ACPI_ALLOCATE_BUFFER, NULL}; - void *data = NULL; - size_t size = 0; + ssize_t res; ACPI_FUNCTION_TRACE("acpi_system_read_dsdt"); @@ -101,22 +100,11 @@ acpi_system_read_dsdt ( if (ACPI_FAILURE(status)) return_VALUE(-ENODEV); - if (*ppos < dsdt.length) { - data = dsdt.pointer + file->f_pos; - size = dsdt.length - file->f_pos; - if (size > count) - size = count; - if (copy_to_user(buffer, data, size)) { - acpi_os_free(dsdt.pointer); - return_VALUE(-EFAULT); - } - } - + res = simple_read_from_buffer(buffer, count, ppos, + dsdt.pointer, dsdt.length); acpi_os_free(dsdt.pointer); - *ppos += size; - - return_VALUE(size); + return_VALUE(res); } @@ -135,8 +123,7 @@ acpi_system_read_fadt ( { acpi_status status = AE_OK; struct acpi_buffer fadt = {ACPI_ALLOCATE_BUFFER, NULL}; - void *data = NULL; - size_t size = 0; + ssize_t res; ACPI_FUNCTION_TRACE("acpi_system_read_fadt"); @@ -144,22 +131,11 @@ acpi_system_read_fadt ( if (ACPI_FAILURE(status)) return_VALUE(-ENODEV); - if (*ppos < fadt.length) { - data = fadt.pointer + file->f_pos; - size = fadt.length - file->f_pos; - if (size > count) - size = count; - if (copy_to_user(buffer, data, size)) { - acpi_os_free(fadt.pointer); - return_VALUE(-EFAULT); - } - } - + res = simple_read_from_buffer(buffer, count, ppos, + fadt.pointer, fadt.length); acpi_os_free(fadt.pointer); - *ppos += size; - - return_VALUE(size); + return_VALUE(res); } diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 3d8790135a058a..a9df710daa524f 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -120,7 +120,7 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error) if (uptodate) multipath_end_bh_io(mp_bh, uptodate); - else { + else if ((bio->bi_rw & (1 << BIO_RW_AHEAD)) == 0) { /* * oops, IO error: */ @@ -130,7 +130,8 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error) bdevname(rdev->bdev,b), (unsigned long long)bio->bi_sector); multipath_reschedule_retry(mp_bh); - } + } else + multipath_end_bh_io(mp_bh, 0); rdev_dec_pending(rdev, conf->mddev); return 0; } @@ -382,7 +383,11 @@ static void multipathd (mddev_t *mddev) " to another IO path\n", bdevname(bio->bi_bdev,b), (unsigned long long)bio->bi_sector); + *bio = *(mp_bh->master_bio); bio->bi_bdev = conf->multipaths[mp_bh->path].rdev->bdev; + bio->bi_rw |= (1 << BIO_RW_FAILFAST); + bio->bi_end_io = multipath_end_request; + bio->bi_private = mp_bh; generic_make_request(bio); } } diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 98817c2d906f3b..7a552263f2da3a 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0020.c,v 1.13 2004/07/12 21:52:50 dwmw2 Exp $ + * $Id: cfi_cmdset_0020.c,v 1.14 2004/07/20 02:44:25 dwmw2 Exp $ * * 10/10/2000 Nicolas Pitre <nico@cam.org> * - completely revamped method functions so they are aware and @@ -1400,11 +1400,6 @@ static void cfi_staa_destroy(struct mtd_info *mtd) kfree(cfi); } -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE) -#define cfi_staa_init init_module -#define cfi_staa_exit cleanup_module -#endif - static char im_name[]="cfi_cmdset_0020"; int __init cfi_staa_init(void) diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 80d4287564553e..cebb2821bc4e8b 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -1,5 +1,5 @@ /* - * $Id: pmc551.c,v 1.26 2004/07/14 17:25:07 dwmw2 Exp $ + * $Id: pmc551.c,v 1.27 2004/07/20 02:44:26 dwmw2 Exp $ * * PMC551 PCI Mezzanine Ram Device * @@ -109,12 +109,6 @@ #include <linux/mtd/pmc551.h> #include <linux/mtd/compatmac.h> -#if LINUX_VERSION_CODE > 0x20300 -#define PCI_BASE_ADDRESS(dev) (dev->resource[0].start) -#else -#define PCI_BASE_ADDRESS(dev) (dev->base_address[0]) -#endif - static struct mtd_info *pmc551list; static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr) @@ -564,7 +558,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) (size<1024)?size:(size<1048576)?size>>10:size>>20, (size<1024)?'B':(size<1048576)?'K':'M', size, ((dcmd&(0x1<<3)) == 0)?"non-":"", - PCI_BASE_ADDRESS(dev)&PCI_BASE_ADDRESS_MEM_MASK ); + (dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK ); /* * Check to see the state of the memory @@ -694,7 +688,7 @@ int __init init_pmc551(void) } printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n", - PCI_BASE_ADDRESS(PCI_Device)); + PCI_Device->resource[0].start); /* * The PMC551 device acts VERY weird if you don't init it @@ -748,7 +742,7 @@ int __init init_pmc551(void) printk(KERN_NOTICE "pmc551: Using specified aperture size %dM\n", asize>>20); priv->asize = asize; } - priv->start = ioremap((PCI_BASE_ADDRESS(PCI_Device) + priv->start = ioremap(((PCI_Device->resource[0].start) & PCI_BASE_ADDRESS_MEM_MASK), priv->asize); diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9c5af1dd7cf608..842e7412fd5e82 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -1,12 +1,11 @@ /* - * $Id: mtdcore.c,v 1.42 2004/07/13 10:21:13 dwmw2 Exp $ + * $Id: mtdcore.c,v 1.43 2004/07/23 15:20:46 dwmw2 Exp $ * * Core registration and callback routines for MTD * drivers and users. * */ -#include <linux/version.h> #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c index 6d8ecf695cca57..33779a8dadf4f2 100644 --- a/drivers/mtd/nand/autcpu12.c +++ b/drivers/mtd/nand/autcpu12.c @@ -6,7 +6,7 @@ * Derived from drivers/mtd/spia.c * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) * - * $Id: autcpu12.c,v 1.19 2004/07/12 15:02:15 dwmw2 Exp $ + * $Id: autcpu12.c,v 1.20 2004/07/20 02:44:26 dwmw2 Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -44,14 +44,6 @@ */ static struct mtd_info *autcpu12_mtd = NULL; -/* - * Module stuff - */ -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE) -#define autcpu12_init init_module -#define autcpu12_cleanup cleanup_module -#endif - static int autcpu12_io_base = CS89712_VIRT_BASE; static int autcpu12_fio_pbase = AUTCPU12_PHYS_SMC; static int autcpu12_fio_ctrl = AUTCPU12_SMC_SELECT_OFFSET; diff --git a/drivers/mtd/nand/tx4925ndfmc.c b/drivers/mtd/nand/tx4925ndfmc.c index 94a61656173b0a..5f6a2f5ed1384b 100644 --- a/drivers/mtd/nand/tx4925ndfmc.c +++ b/drivers/mtd/nand/tx4925ndfmc.c @@ -11,7 +11,7 @@ * Derived from drivers/mtd/autcpu12.c * Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de) * - * $Id: tx4925ndfmc.c,v 1.2 2004/03/27 19:55:53 gleixner Exp $ + * $Id: tx4925ndfmc.c,v 1.3 2004/07/20 02:44:26 dwmw2 Exp $ * * Copyright (C) 2001 Toshiba Corporation * @@ -40,14 +40,6 @@ extern struct nand_oobinfo jffs2_oobinfo; static struct mtd_info *tx4925ndfmc_mtd = NULL; /* - * Module stuff - */ -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE) -#define tx4925ndfmc_init init_module -#define tx4925ndfmc_cleanup cleanup_module -#endif - -/* * Define partitions for flash devices */ diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index b80990df0a9004..d9746f1b51376d 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -47,23 +47,7 @@ static struct super_operations s_ops = { ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset) { - size_t len = strlen(str); - - if (!count) - return 0; - - if (*offset > len) - return 0; - - if (count > len - *offset) - count = len - *offset; - - if (copy_to_user(buf, str + *offset, count)) - return -EFAULT; - - *offset += count; - - return count; + return simple_read_from_buffer(buf, count, offset, str, strlen(str)); } @@ -72,29 +56,10 @@ ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset) { char tmpbuf[TMPBUFSIZE]; - size_t maxlen; - - if (!count) - return 0; - - spin_lock(&oprofilefs_lock); - maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val); - spin_unlock(&oprofilefs_lock); + size_t maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val); if (maxlen > TMPBUFSIZE) maxlen = TMPBUFSIZE; - - if (*offset > maxlen) - return 0; - - if (count > maxlen - *offset) - count = maxlen - *offset; - - if (copy_to_user(buf, tmpbuf + *offset, count)) - return -EFAULT; - - *offset += count; - - return count; + return simple_read_from_buffer(buf, count, offset, tmpbuf, maxlen); } diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 1bf42180f2d48d..915d593fbf21b2 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -1118,6 +1118,12 @@ static int device_check(imm_struct *dev) return -ENODEV; } +static int imm_adjust_queue(struct scsi_device *device) +{ + blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH); + return 0; +} + static struct scsi_host_template imm_template = { .module = THIS_MODULE, .proc_name = "imm", @@ -1133,6 +1139,7 @@ static struct scsi_host_template imm_template = { .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, .can_queue = 1, + .slave_alloc = imm_adjust_queue, }; /*************************************************************************** diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 133e50c1b75aee..a0721d06059eb4 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c @@ -571,22 +571,7 @@ static ssize_t uhci_proc_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { struct uhci_proc *up = file->private_data; - unsigned int pos; - unsigned int size; - - pos = *ppos; - size = up->size; - if (pos >= size) - return 0; - if (nbytes > size - pos) - nbytes = size - pos; - - if (copy_to_user(buf, up->data + pos, nbytes)) - return -EFAULT; - - *ppos += nbytes; - - return nbytes; + return simple_read_from_buffer(buf, nbytes, ppos, up->data, up->size); } static int uhci_proc_release(struct inode *inode, struct file *file) |