When the kernel is compiled with CONFIG_ENABLE_MUST_CHECK=y the following
warning message appears:

em28xx-input.c: In function 'em2880_ir_attach':
em28xx-input.c:344: warning: ignoring return value of 'input_register_device', 
declared with attribute warn_unused_result

The attached patch handles the return value of input_register_device().
diff -r 3fe18e8981e5 em28xx-input.c
--- a/em28xx-input.c	Mon Nov 17 15:35:18 2008 +0100
+++ b/em28xx-input.c	Wed Nov 19 21:53:50 2008 +0100
@@ -311,6 +311,7 @@
 	struct input_dev *input_dev;
 	char buf[5];
 	int i;
+	int error = 0;
 
 	mutex_lock(&dev->input_lock);
 	if (dev->ir_em2880) {
@@ -341,24 +342,28 @@
 	input_dev->keycodemax = IR_KEYTAB_SIZE;
 	input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
 
-	input_register_device(ir->input);
+	error = input_register_device(ir->input);
 
-	ir->state = EM28XX_REMOTE_POLLING;
+	if (!error) {
+		ir->state = EM28XX_REMOTE_POLLING;
 
-	if (dev->board->ir_getkey == em2888_get_key_empia) {
-		dev->em28xx_read_reg_req_len(dev, 0, 0x50, buf, 5);
-		ir->key = buf[4];
-		ir->oldval = get_timestamp();
-		ir->btn = buf[1];
-		ir->released = 1;
+		if (dev->board->ir_getkey == em2888_get_key_empia) {
+			dev->em28xx_read_reg_req_len(dev, 0, 0x50, buf, 5);
+			ir->key = buf[4];
+			ir->oldval = get_timestamp();
+			ir->btn = buf[1];
+			ir->released = 1;
+		}
+
+		INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
+		schedule_delayed_work(&ir->work, msecs_to_jiffies(50));
+		printk(KERN_INFO "em28xx-input.c: remote control handler attached\n");
 	}
-
-	INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
-	schedule_delayed_work(&ir->work, msecs_to_jiffies(50));
-	printk(KERN_INFO"em28xx-input.c: remote control handler attached\n");
 	mutex_unlock(&dev->input_lock);
+	if (error)
+		em2880_ir_detach(dev);
 #endif
-	return 0;
+	return error;
 }
 
 
_______________________________________________
Em28xx mailing list
[email protected]
http://mcentral.de/mailman/listinfo/em28xx

Reply via email to