aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-14 23:00:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-14 23:00:28 -0500
commit5393f780277165f282a37ed82dd878159ec9dad5 (patch)
tree00df86ebd8b598b5db3c4fe4612c6614409caf94 /drivers/char
parentbca268565fd18f0b36ab8fff6e1623d8dffae2b1 (diff)
parentea0105ea3881b409e362451690184af494bce6e3 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits) powerpc/83xx: Move mcu_mpc8349emitx driver out of drivers/i2c/chips/ powerpc/83xx: Make serial ports work on MPC8315E-RDB w/ FSL U-Boots powerpc/e500mc: Doorbells need to be taken w/exceptions disabled powerpc: Enable PS3 options and QPACE in ppc64_defconfig powerpc/powermac: Fix occasional SMP boot failure powerpc/cacheinfo: Rename cache_dir per-cpu variable hvc_console: Use kzalloc() instead of kmalloc() + memset() hvc_console: Do not set low_latency when using interrupts hvc_console: Call free_irq() only if request_irq() was successful hvc_console: Change an mb() to smp_mb() and add some comments powerpc: Cleanup from l64 to ll64 change: drivers/net powerpc: Cleanup from l64 to ll64 change: drivers/char powerpc: Cleanup from l64 to ll64 change: arch code powerpc: Change u64/s64 to a long long integer type powerpc/kexec: Check crash_base for relocatable kernel powerpc: Make dummy section a valid note header Xilinx: SPI: updated driver for device tree drivers/of: Add the of_find_i2c_device_by_node function. powerpc/xsysace: add compatible string for non-ipcore instance powerpc/mpc52xx: remove dead code from GPIO driver ...
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/bsr.c2
-rw-r--r--drivers/char/hvc_console.c14
-rw-r--r--drivers/char/hvc_irq.c2
3 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 977dfb1096a0..f6094ae0ef33 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -103,7 +103,7 @@ static ssize_t
103bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) 103bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf)
104{ 104{
105 struct bsr_dev *bsr_dev = dev_get_drvdata(dev); 105 struct bsr_dev *bsr_dev = dev_get_drvdata(dev);
106 return sprintf(buf, "%lu\n", bsr_dev->bsr_len); 106 return sprintf(buf, "%llu\n", bsr_dev->bsr_len);
107} 107}
108 108
109static struct device_attribute bsr_dev_attrs[] = { 109static struct device_attribute bsr_dev_attrs[] = {
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 5a8a4c28c867..09676b4e5d89 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -318,7 +318,8 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
318 } /* else count == 0 */ 318 } /* else count == 0 */
319 319
320 tty->driver_data = hp; 320 tty->driver_data = hp;
321 tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ 321 if (!hp->irq_requested)
322 tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */
322 323
323 hp->tty = tty; 324 hp->tty = tty;
324 325
@@ -764,13 +765,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data,
764 return ERR_PTR(err); 765 return ERR_PTR(err);
765 } 766 }
766 767
767 hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, 768 hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
768 GFP_KERNEL); 769 GFP_KERNEL);
769 if (!hp) 770 if (!hp)
770 return ERR_PTR(-ENOMEM); 771 return ERR_PTR(-ENOMEM);
771 772
772 memset(hp, 0x00, sizeof(*hp));
773
774 hp->vtermno = vtermno; 773 hp->vtermno = vtermno;
775 hp->data = data; 774 hp->data = data;
776 hp->ops = ops; 775 hp->ops = ops;
@@ -876,8 +875,11 @@ static int hvc_init(void)
876 goto stop_thread; 875 goto stop_thread;
877 } 876 }
878 877
879 /* FIXME: This mb() seems completely random. Remove it. */ 878 /*
880 mb(); 879 * Make sure tty is fully registered before allowing it to be
880 * found by hvc_console_device.
881 */
882 smp_mb();
881 hvc_driver = drv; 883 hvc_driver = drv;
882 return 0; 884 return 0;
883 885
diff --git a/drivers/char/hvc_irq.c b/drivers/char/hvc_irq.c
index d09e5688d449..2623e177e8d6 100644
--- a/drivers/char/hvc_irq.c
+++ b/drivers/char/hvc_irq.c
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
37 37
38void notifier_del_irq(struct hvc_struct *hp, int irq) 38void notifier_del_irq(struct hvc_struct *hp, int irq)
39{ 39{
40 if (!irq) 40 if (!hp->irq_requested)
41 return; 41 return;
42 free_irq(irq, hp); 42 free_irq(irq, hp);
43 hp->irq_requested = 0; 43 hp->irq_requested = 0;