virtio: console: Associate each port with a char device
[safe/jmp/linux-2.6] / drivers / char / tb0219.c
index bb1bad4..cad4eb6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Driver for TANBAC TB0219 base board.
  *
- *  Copyright (C) 2005  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2005  Yoichi Yuasa <yuasa@linux-mips.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 #include <asm/vr41xx/giu.h>
 #include <asm/vr41xx/tb0219.h>
 
-MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>");
+MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
 MODULE_DESCRIPTION("TANBAC TB0219 base board driver");
 MODULE_LICENSE("GPL");
 
@@ -37,7 +37,7 @@ MODULE_PARM_DESC(major, "Major device number");
 
 static void (*old_machine_restart)(char *command);
 static void __iomem *tb0219_base;
-static spinlock_t tb0219_lock;
+static DEFINE_SPINLOCK(tb0219_lock);
 
 #define tb0219_read(offset)            readw(tb0219_base + (offset))
 #define tb0219_write(offset, value)    writew((value), tb0219_base + (offset))
@@ -164,7 +164,7 @@ static ssize_t tanbac_tb0219_read(struct file *file, char __user *buf, size_t le
        unsigned int minor;
        char value;
 
-       minor = iminor(file->f_dentry->d_inode);
+       minor = iminor(file->f_path.dentry->d_inode);
        switch (minor) {
        case 0:
                value = get_led();
@@ -200,7 +200,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
        int retval = 0;
        char c;
 
-       minor = iminor(file->f_dentry->d_inode);
+       minor = iminor(file->f_path.dentry->d_inode);
        switch (minor) {
        case 0:
                type = TYPE_LED;
@@ -304,8 +304,6 @@ static int __devinit tb0219_probe(struct platform_device *dev)
                return retval;
        }
 
-       spin_lock_init(&tb0219_lock);
-
        old_machine_restart = _machine_restart;
        _machine_restart = tb0219_restart;