]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/tty/hvc/hvcs.c
TTY: remove re-assignments to tty_driver members
[linux-2.6.git] / drivers / tty / hvc / hvcs.c
index bef238f9ffd73aa33fc397b56f6173a3be74f93e..da0aa476804d204d8b1b73e4bc9409a64ef4431c 100644 (file)
  * arch/powerepc/include/asm/hvcserver.h
  *
  * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to
- * prevent possible lockup with realtime scheduling as similarily pointed out by
+ * prevent possible lockup with realtime scheduling as similarly pointed out by
  * akpm in hvc_console.  Changed resulted in the removal of hvcs_final_close()
  * to reorder cleanup operations and prevent discarding of pending data during
  * an hvcs_close().  Removed spinlock protection of hvcs_struct data members in
@@ -581,7 +581,7 @@ static void hvcs_try_write(struct hvcs_struct *hvcsd)
                        /*
                         * We are still obligated to deliver the data to the
                         * hypervisor even if the tty has been closed because
-                        * we commited to delivering it.  But don't try to wake
+                        * we committed to delivering it.  But don't try to wake
                         * a non-existent tty.
                         */
                        if (tty) {
@@ -1057,7 +1057,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,
         * the conn was registered and now.
         */
        if (!(rc = request_irq(irq, &hvcs_handle_interrupt,
-                               IRQF_DISABLED, "ibmhvcs", hvcsd))) {
+                               0, "ibmhvcs", hvcsd))) {
                /*
                 * It is possible the vty-server was removed after the irq was
                 * requested but before we have time to enable interrupts.
@@ -1203,7 +1203,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
 {
        struct hvcs_struct *hvcsd;
        unsigned long flags;
-       int irq = NO_IRQ;
+       int irq;
 
        /*
         * Is someone trying to close the file associated with this device after
@@ -1237,7 +1237,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
                irq = hvcsd->vdev->irq;
                spin_unlock_irqrestore(&hvcsd->lock, flags);
 
-               tty_wait_until_sent(tty, HVCS_CLOSE_WAIT);
+               tty_wait_until_sent_from_close(tty, HVCS_CLOSE_WAIT);
 
                /*
                 * This line is important because it tells hvcs_open that this
@@ -1264,7 +1264,7 @@ static void hvcs_hangup(struct tty_struct * tty)
        struct hvcs_struct *hvcsd = tty->driver_data;
        unsigned long flags;
        int temp_open_count;
-       int irq = NO_IRQ;
+       int irq;
 
        spin_lock_irqsave(&hvcsd->lock, flags);
        /* Preserve this so that we know how many kref refs to put */
@@ -1349,7 +1349,7 @@ static int hvcs_write(struct tty_struct *tty,
        spin_lock_irqsave(&hvcsd->lock, flags);
 
        /*
-        * Somehow an open succedded but the device was removed or the
+        * Somehow an open succeeded but the device was removed or the
         * connection terminated between the vty-server and partner vty during
         * the middle of a write operation?  This is a crummy place to do this
         * but we want to keep it all in the spinlock.
@@ -1420,7 +1420,7 @@ static int hvcs_write(struct tty_struct *tty,
 }
 
 /*
- * This is really asking how much can we guarentee that we can send or that we
+ * This is really asking how much can we guarantee that we can send or that we
  * absolutely WILL BUFFER if we can't send it.  This driver MUST honor the
  * return value, hence the reason for hvcs_struct buffering.
  */
@@ -1499,8 +1499,6 @@ static int __devinit hvcs_initialize(void)
                goto index_fail;
        }
 
-       hvcs_tty_driver->owner = THIS_MODULE;
-
        hvcs_tty_driver->driver_name = hvcs_driver_name;
        hvcs_tty_driver->name = hvcs_device_node;
 
@@ -1532,7 +1530,7 @@ static int __devinit hvcs_initialize(void)
                goto register_fail;
        }
 
-       hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);
+       hvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);
        if (!hvcs_pi_buff) {
                rc = -ENOMEM;
                goto buff_alloc_fail;
@@ -1548,7 +1546,7 @@ static int __devinit hvcs_initialize(void)
        return 0;
 
 kthread_fail:
-       kfree(hvcs_pi_buff);
+       free_page((unsigned long)hvcs_pi_buff);
 buff_alloc_fail:
        tty_unregister_driver(hvcs_tty_driver);
 register_fail:
@@ -1597,7 +1595,7 @@ static void __exit hvcs_module_exit(void)
        kthread_stop(hvcs_task);
 
        spin_lock(&hvcs_pi_lock);
-       kfree(hvcs_pi_buff);
+       free_page((unsigned long)hvcs_pi_buff);
        hvcs_pi_buff = NULL;
        spin_unlock(&hvcs_pi_lock);