소스 검색

[PATCH] const file_operations fallout

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro 18 년 전
부모
커밋
d8b3966e4c
1개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. 16 4
      sound/oss/dmasound/dmasound_core.c

+ 16 - 4
sound/oss/dmasound/dmasound_core.c

@@ -1346,22 +1346,34 @@ static const struct file_operations sq_fops =
 	.ioctl		= sq_ioctl,
 	.ioctl		= sq_ioctl,
 	.open		= sq_open,
 	.open		= sq_open,
 	.release	= sq_release,
 	.release	= sq_release,
+};
+
 #ifdef HAS_RECORD
 #ifdef HAS_RECORD
-	.read		= NULL	/* default to no read for compat mode */
-#endif
+static const struct file_operations sq_fops_record =
+{
+	.owner		= THIS_MODULE,
+	.llseek		= no_llseek,
+	.write		= sq_write,
+	.poll		= sq_poll,
+	.ioctl		= sq_ioctl,
+	.open		= sq_open,
+	.release	= sq_release,
+	.read		= sq_read,
 };
 };
+#endif
 
 
 static int sq_init(void)
 static int sq_init(void)
 {
 {
+	const struct file_operations *fops = &sq_fops;
 #ifndef MODULE
 #ifndef MODULE
 	int sq_unit;
 	int sq_unit;
 #endif
 #endif
 
 
 #ifdef HAS_RECORD
 #ifdef HAS_RECORD
 	if (dmasound.mach.record)
 	if (dmasound.mach.record)
-		sq_fops.read = sq_read ;
+		fops = &sq_fops_record;
 #endif
 #endif
-	sq_unit = register_sound_dsp(&sq_fops, -1);
+	sq_unit = register_sound_dsp(fops, -1);
 	if (sq_unit < 0) {
 	if (sq_unit < 0) {
 		printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
 		printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
 		return sq_unit ;
 		return sq_unit ;