1 #include <linux/errno.h>
3 #include <linux/types.h>
10 #define SYNTH_MINOR 25
13 static int misc_registered;
14 static int dev_opened;
17 size_t nbytes, loff_t *ppos)
28 bytes =
min(count,
sizeof(buf));
46 static int speakup_file_open(
struct inode *
ip,
struct file *
fp)
50 if (
xchg(&dev_opened, 1))
55 static int speakup_file_release(
struct inode *ip,
struct file *fp)
62 .read = speakup_file_read,
63 .write = speakup_file_write,
64 .open = speakup_file_open,
65 .release = speakup_file_release,
76 if (misc_registered != 0)
80 pr_warn(
"Couldn't initialize miscdevice /dev/synth.\n");
82 pr_info(
"initialized device: /dev/synth, node (MAJOR %d, MINOR %d)\n",
92 pr_info(
"speakup: unregistering synth device /dev/synth\n");