aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/agp/amd64-agp.c10
-rw-r--r--drivers/char/agp/backend.c13
-rw-r--r--drivers/char/agp/hp-agp.c6
-rw-r--r--drivers/char/agp/intel-agp.c6
-rw-r--r--drivers/char/hw_random/core.c5
-rw-r--r--drivers/char/hw_random/virtio-rng.c6
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c4
-rw-r--r--drivers/char/nozomi.c2
-rw-r--r--drivers/char/nwflash.c1
-rw-r--r--drivers/char/sonypi.c11
-rw-r--r--drivers/char/toshiba.c12
-rw-r--r--drivers/char/tty_io.c2
13 files changed, 48 insertions, 32 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 31be3ac2e21b..e023682be2c4 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -669,7 +669,7 @@ config VIRTIO_CONSOLE
669 669
670config HVCS 670config HVCS
671 tristate "IBM Hypervisor Virtual Console Server support" 671 tristate "IBM Hypervisor Virtual Console Server support"
672 depends on PPC_PSERIES 672 depends on PPC_PSERIES && HVC_CONSOLE
673 help 673 help
674 Partitionable IBM Power5 ppc64 machines allow hosting of 674 Partitionable IBM Power5 ppc64 machines allow hosting of
675 firmware virtual consoles from one Linux partition by 675 firmware virtual consoles from one Linux partition by
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 2fb2e6cc322a..1afb8968a342 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -728,6 +728,10 @@ int __init agp_amd64_init(void)
728 728
729 if (agp_off) 729 if (agp_off)
730 return -EINVAL; 730 return -EINVAL;
731
732 if (gart_iommu_aperture)
733 return agp_bridges_found ? 0 : -ENODEV;
734
731 err = pci_register_driver(&agp_amd64_pci_driver); 735 err = pci_register_driver(&agp_amd64_pci_driver);
732 if (err < 0) 736 if (err < 0)
733 return err; 737 return err;
@@ -766,17 +770,15 @@ int __init agp_amd64_init(void)
766 770
767static void __exit agp_amd64_cleanup(void) 771static void __exit agp_amd64_cleanup(void)
768{ 772{
773 if (gart_iommu_aperture)
774 return;
769 if (aperture_resource) 775 if (aperture_resource)
770 release_resource(aperture_resource); 776 release_resource(aperture_resource);
771 pci_unregister_driver(&agp_amd64_pci_driver); 777 pci_unregister_driver(&agp_amd64_pci_driver);
772} 778}
773 779
774/* On AMD64 the PCI driver needs to initialize this driver early
775 for the IOMMU, so it has to be called via a backdoor. */
776#ifndef CONFIG_GART_IOMMU
777module_init(agp_amd64_init); 780module_init(agp_amd64_init);
778module_exit(agp_amd64_cleanup); 781module_exit(agp_amd64_cleanup);
779#endif
780 782
781MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen"); 783MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen");
782module_param(agp_try_unsupported, bool, 0); 784module_param(agp_try_unsupported, bool, 0);
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index a56ca080e108..c3ab46da51a3 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -285,18 +285,22 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
285{ 285{
286 int error; 286 int error;
287 287
288 if (agp_off) 288 if (agp_off) {
289 return -ENODEV; 289 error = -ENODEV;
290 goto err_put_bridge;
291 }
290 292
291 if (!bridge->dev) { 293 if (!bridge->dev) {
292 printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); 294 printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n");
293 return -EINVAL; 295 error = -EINVAL;
296 goto err_put_bridge;
294 } 297 }
295 298
296 /* Grab reference on the chipset driver. */ 299 /* Grab reference on the chipset driver. */
297 if (!try_module_get(bridge->driver->owner)) { 300 if (!try_module_get(bridge->driver->owner)) {
298 dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); 301 dev_info(&bridge->dev->dev, "can't lock chipset driver\n");
299 return -EINVAL; 302 error = -EINVAL;
303 goto err_put_bridge;
300 } 304 }
301 305
302 error = agp_backend_initialize(bridge); 306 error = agp_backend_initialize(bridge);
@@ -326,6 +330,7 @@ frontend_err:
326 agp_backend_cleanup(bridge); 330 agp_backend_cleanup(bridge);
327err_out: 331err_out:
328 module_put(bridge->driver->owner); 332 module_put(bridge->driver->owner);
333err_put_bridge:
329 agp_put_bridge(bridge); 334 agp_put_bridge(bridge);
330 return error; 335 return error;
331} 336}
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 9047b2714653..58752b70efea 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -488,9 +488,8 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
488 handle = obj; 488 handle = obj;
489 do { 489 do {
490 status = acpi_get_object_info(handle, &info); 490 status = acpi_get_object_info(handle, &info);
491 if (ACPI_SUCCESS(status)) { 491 if (ACPI_SUCCESS(status) && (info->valid & ACPI_VALID_HID)) {
492 /* TBD check _CID also */ 492 /* TBD check _CID also */
493 info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0';
494 match = (strcmp(info->hardware_id.string, "HWP0001") == 0); 493 match = (strcmp(info->hardware_id.string, "HWP0001") == 0);
495 kfree(info); 494 kfree(info);
496 if (match) { 495 if (match) {
@@ -509,6 +508,9 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
509 handle = parent; 508 handle = parent;
510 } while (ACPI_SUCCESS(status)); 509 } while (ACPI_SUCCESS(status));
511 510
511 if (ACPI_FAILURE(status))
512 return AE_OK; /* found no enclosing IOC */
513
512 if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) 514 if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa))
513 return AE_OK; 515 return AE_OK;
514 516
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 30c36ac2cd00..3999a5f25f38 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -2460,10 +2460,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
2460 &bridge->mode); 2460 &bridge->mode);
2461 } 2461 }
2462 2462
2463 if (bridge->driver->mask_memory == intel_i965_mask_memory) 2463 if (bridge->driver->mask_memory == intel_i965_mask_memory) {
2464 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36))) 2464 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
2465 dev_err(&intel_private.pcidev->dev, 2465 dev_err(&intel_private.pcidev->dev,
2466 "set gfx device dma mask 36bit failed!\n"); 2466 "set gfx device dma mask 36bit failed!\n");
2467 else
2468 pci_set_consistent_dma_mask(intel_private.pcidev,
2469 DMA_BIT_MASK(36));
2470 }
2467 2471
2468 pci_set_drvdata(pdev, bridge); 2472 pci_set_drvdata(pdev, bridge);
2469 return agp_add_bridge(bridge); 2473 return agp_add_bridge(bridge);
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index e989f67bb61f..3d9c61e5acbf 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -158,10 +158,11 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
158 goto out; 158 goto out;
159 } 159 }
160 } 160 }
161out_unlock:
162 mutex_unlock(&rng_mutex);
163out: 161out:
164 return ret ? : err; 162 return ret ? : err;
163out_unlock:
164 mutex_unlock(&rng_mutex);
165 goto out;
165} 166}
166 167
167 168
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index bdaef8e94021..64fe0a793efd 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -114,7 +114,7 @@ static struct virtio_device_id id_table[] = {
114 { 0 }, 114 { 0 },
115}; 115};
116 116
117static struct virtio_driver virtio_rng = { 117static struct virtio_driver virtio_rng_driver = {
118 .driver.name = KBUILD_MODNAME, 118 .driver.name = KBUILD_MODNAME,
119 .driver.owner = THIS_MODULE, 119 .driver.owner = THIS_MODULE,
120 .id_table = id_table, 120 .id_table = id_table,
@@ -124,12 +124,12 @@ static struct virtio_driver virtio_rng = {
124 124
125static int __init init(void) 125static int __init init(void)
126{ 126{
127 return register_virtio_driver(&virtio_rng); 127 return register_virtio_driver(&virtio_rng_driver);
128} 128}
129 129
130static void __exit fini(void) 130static void __exit fini(void)
131{ 131{
132 unregister_virtio_driver(&virtio_rng); 132 unregister_virtio_driver(&virtio_rng_driver);
133} 133}
134module_init(init); 134module_init(init);
135module_exit(fini); 135module_exit(fini);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 679cd08b80b4..176f1751237f 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -3204,7 +3204,7 @@ static __devinit int init_ipmi_si(void)
3204#ifdef CONFIG_ACPI 3204#ifdef CONFIG_ACPI
3205 spmi_find_bmc(); 3205 spmi_find_bmc();
3206#endif 3206#endif
3207#ifdef CONFIG_PNP 3207#ifdef CONFIG_ACPI
3208 pnp_register_driver(&ipmi_pnp_driver); 3208 pnp_register_driver(&ipmi_pnp_driver);
3209#endif 3209#endif
3210 3210
@@ -3330,7 +3330,7 @@ static __exit void cleanup_ipmi_si(void)
3330#ifdef CONFIG_PCI 3330#ifdef CONFIG_PCI
3331 pci_unregister_driver(&ipmi_pci_driver); 3331 pci_unregister_driver(&ipmi_pci_driver);
3332#endif 3332#endif
3333#ifdef CONFIG_PNP 3333#ifdef CONFIG_ACPI
3334 pnp_unregister_driver(&ipmi_pnp_driver); 3334 pnp_unregister_driver(&ipmi_pnp_driver);
3335#endif 3335#endif
3336 3336
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 7d73cd430340..2ad7d37afbd0 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -1651,10 +1651,10 @@ static void ntty_close(struct tty_struct *tty, struct file *file)
1651 1651
1652 dc->open_ttys--; 1652 dc->open_ttys--;
1653 port->count--; 1653 port->count--;
1654 tty_port_tty_set(port, NULL);
1655 1654
1656 if (port->count == 0) { 1655 if (port->count == 0) {
1657 DBG1("close: %d", nport->token_dl); 1656 DBG1("close: %d", nport->token_dl);
1657 tty_port_tty_set(port, NULL);
1658 spin_lock_irqsave(&dc->spin_mutex, flags); 1658 spin_lock_irqsave(&dc->spin_mutex, flags);
1659 dc->last_ier &= ~(nport->token_dl); 1659 dc->last_ier &= ~(nport->token_dl);
1660 writew(dc->last_ier, dc->reg_ier); 1660 writew(dc->last_ier, dc->reg_ier);
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c
index 8c7df5ba088f..f80810901db6 100644
--- a/drivers/char/nwflash.c
+++ b/drivers/char/nwflash.c
@@ -27,6 +27,7 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/smp_lock.h> 28#include <linux/smp_lock.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/jiffies.h>
30 31
31#include <asm/hardware/dec21285.h> 32#include <asm/hardware/dec21285.h>
32#include <asm/io.h> 33#include <asm/io.h>
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 0798754a607c..bba727c3807e 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -50,7 +50,6 @@
50#include <linux/err.h> 50#include <linux/err.h>
51#include <linux/kfifo.h> 51#include <linux/kfifo.h>
52#include <linux/platform_device.h> 52#include <linux/platform_device.h>
53#include <linux/smp_lock.h>
54 53
55#include <asm/uaccess.h> 54#include <asm/uaccess.h>
56#include <asm/io.h> 55#include <asm/io.h>
@@ -905,14 +904,13 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
905 904
906static int sonypi_misc_open(struct inode *inode, struct file *file) 905static int sonypi_misc_open(struct inode *inode, struct file *file)
907{ 906{
908 lock_kernel();
909 mutex_lock(&sonypi_device.lock); 907 mutex_lock(&sonypi_device.lock);
910 /* Flush input queue on first open */ 908 /* Flush input queue on first open */
911 if (!sonypi_device.open_count) 909 if (!sonypi_device.open_count)
912 kfifo_reset(&sonypi_device.fifo); 910 kfifo_reset(&sonypi_device.fifo);
913 sonypi_device.open_count++; 911 sonypi_device.open_count++;
914 mutex_unlock(&sonypi_device.lock); 912 mutex_unlock(&sonypi_device.lock);
915 unlock_kernel(); 913
916 return 0; 914 return 0;
917} 915}
918 916
@@ -955,10 +953,10 @@ static unsigned int sonypi_misc_poll(struct file *file, poll_table *wait)
955 return 0; 953 return 0;
956} 954}
957 955
958static int sonypi_misc_ioctl(struct inode *ip, struct file *fp, 956static long sonypi_misc_ioctl(struct file *fp,
959 unsigned int cmd, unsigned long arg) 957 unsigned int cmd, unsigned long arg)
960{ 958{
961 int ret = 0; 959 long ret = 0;
962 void __user *argp = (void __user *)arg; 960 void __user *argp = (void __user *)arg;
963 u8 val8; 961 u8 val8;
964 u16 val16; 962 u16 val16;
@@ -1074,7 +1072,8 @@ static const struct file_operations sonypi_misc_fops = {
1074 .open = sonypi_misc_open, 1072 .open = sonypi_misc_open,
1075 .release = sonypi_misc_release, 1073 .release = sonypi_misc_release,
1076 .fasync = sonypi_misc_fasync, 1074 .fasync = sonypi_misc_fasync,
1077 .ioctl = sonypi_misc_ioctl, 1075 .unlocked_ioctl = sonypi_misc_ioctl,
1076 .llseek = no_llseek,
1078}; 1077};
1079 1078
1080static struct miscdevice sonypi_misc_device = { 1079static struct miscdevice sonypi_misc_device = {
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c
index 663cd15d7c78..f8bc79f6de34 100644
--- a/drivers/char/toshiba.c
+++ b/drivers/char/toshiba.c
@@ -68,7 +68,7 @@
68#include <linux/stat.h> 68#include <linux/stat.h>
69#include <linux/proc_fs.h> 69#include <linux/proc_fs.h>
70#include <linux/seq_file.h> 70#include <linux/seq_file.h>
71 71#include <linux/smp_lock.h>
72#include <linux/toshiba.h> 72#include <linux/toshiba.h>
73 73
74#define TOSH_MINOR_DEV 181 74#define TOSH_MINOR_DEV 181
@@ -88,13 +88,13 @@ static int tosh_date;
88static int tosh_sci; 88static int tosh_sci;
89static int tosh_fan; 89static int tosh_fan;
90 90
91static int tosh_ioctl(struct inode *, struct file *, unsigned int, 91static long tosh_ioctl(struct file *, unsigned int,
92 unsigned long); 92 unsigned long);
93 93
94 94
95static const struct file_operations tosh_fops = { 95static const struct file_operations tosh_fops = {
96 .owner = THIS_MODULE, 96 .owner = THIS_MODULE,
97 .ioctl = tosh_ioctl, 97 .unlocked_ioctl = tosh_ioctl,
98}; 98};
99 99
100static struct miscdevice tosh_device = { 100static struct miscdevice tosh_device = {
@@ -252,8 +252,7 @@ int tosh_smm(SMMRegisters *regs)
252EXPORT_SYMBOL(tosh_smm); 252EXPORT_SYMBOL(tosh_smm);
253 253
254 254
255static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, 255static long tosh_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
256 unsigned long arg)
257{ 256{
258 SMMRegisters regs; 257 SMMRegisters regs;
259 SMMRegisters __user *argp = (SMMRegisters __user *)arg; 258 SMMRegisters __user *argp = (SMMRegisters __user *)arg;
@@ -275,13 +274,16 @@ static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
275 return -EINVAL; 274 return -EINVAL;
276 275
277 /* do we need to emulate the fan ? */ 276 /* do we need to emulate the fan ? */
277 lock_kernel();
278 if (tosh_fan==1) { 278 if (tosh_fan==1) {
279 if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { 279 if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) {
280 err = tosh_emulate_fan(&regs); 280 err = tosh_emulate_fan(&regs);
281 unlock_kernel();
281 break; 282 break;
282 } 283 }
283 } 284 }
284 err = tosh_smm(&regs); 285 err = tosh_smm(&regs);
286 unlock_kernel();
285 break; 287 break;
286 default: 288 default:
287 return -EINVAL; 289 return -EINVAL;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index f15df40bc318..c6f3b48be9dd 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1951,8 +1951,8 @@ static int tty_fasync(int fd, struct file *filp, int on)
1951 pid = task_pid(current); 1951 pid = task_pid(current);
1952 type = PIDTYPE_PID; 1952 type = PIDTYPE_PID;
1953 } 1953 }
1954 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1955 retval = __f_setown(filp, pid, type, 0); 1954 retval = __f_setown(filp, pid, type, 0);
1955 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
1956 if (retval) 1956 if (retval)
1957 goto out; 1957 goto out;
1958 } else { 1958 } else {