Title: [5291] trunk/drivers/input/joystick/bfin_rotary.c: [#4373] BF54x / BF52x Rotary Input device driver
Revision
5291
Author
hennerich
Date
2008-09-15 07:40:25 -0500 (Mon, 15 Sep 2008)

Log Message

[#4373] BF54x / BF52x Rotary Input device driver
Incorporate review feedback by Mike Frysinger

Modified Paths

Diff

Modified: trunk/drivers/input/joystick/bfin_rotary.c (5290 => 5291)


--- trunk/drivers/input/joystick/bfin_rotary.c	2008-09-12 19:15:52 UTC (rev 5290)
+++ trunk/drivers/input/joystick/bfin_rotary.c	2008-09-15 12:40:25 UTC (rev 5291)
@@ -71,7 +71,6 @@
 	input_sync(input);
 	input_report_key(input, keycode, 0);
 	input_sync(input);
-
 }
 
 static void report_rotary_event(struct bfin_rot *rotary, int delta)
@@ -100,7 +99,6 @@
 {
 	struct platform_device *pdev = dev_id;
 	struct bfin_rot *rotary = platform_get_drvdata(pdev);
-	int cnt;
 	unsigned short status = bfin_read_CNT_STATUS();
 
 	switch (status) {
@@ -108,8 +106,7 @@
 		break;
 	case UCII:
 	case DCII:
-		cnt = bfin_read_CNT_COUNTER();
-		report_rotary_event(rotary, cnt);
+		report_rotary_event(rotary, bfin_read_CNT_COUNTER());
 		break;
 	case CZMII:
 		report_marker_event(rotary);
@@ -119,7 +116,7 @@
 	}
 
 	bfin_write_CNT_COMMAND(W1LCNT_ZERO);	/* Clear COUNTER */
-	bfin_write_CNT_STATUS(0xFFFF);	/* Clear STATUS */
+	bfin_write_CNT_STATUS(-1);	/* Clear STATUS */
 
 	return IRQ_HANDLED;
 }
@@ -131,24 +128,22 @@
 	struct input_dev *input;
 	int error;
 
-
 	rotary = kzalloc(sizeof(struct bfin_rot), GFP_KERNEL);
 	if (!rotary)
 		return -ENOMEM;
 
 	platform_set_drvdata(pdev, rotary);
 
-	if (peripheral_request_list(per_cnt, DRV_NAME)) {
+	error = peripheral_request_list(per_cnt, DRV_NAME);
+	if (error) {
 		printk(KERN_ERR DRV_NAME
 			": Requesting Peripherals failed\n");
-		error = -EFAULT;
 		goto out1;
 	}
 
-
 	rotary->irq = platform_get_irq(pdev, 0);
 	if (rotary->irq < 0) {
-		error = -ENODEV;
+		error = rotary->irq;
 		goto out2;
 	}
 
@@ -227,7 +222,7 @@
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	printk(KERN_ERR DRV_NAME
+	printk(KERN_INFO DRV_NAME
 		": Blackfin Rotary Driver registered IRQ %d\n", rotary->irq);
 
 	return 0;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to