aboutsummaryrefslogtreecommitdiffstats
path: root/meta/packages/linux/linux-omap-2.6.29/dss2/0047-DSS2-fix-return-value-for-rotate_type-sysfs-functio.patch
blob: 0b0f104b304fb22848b40c6aa60035d50bcb1b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 7ddd5eaa7bc345c3719d613a46a95b7e8052ad2c Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Tue, 21 Apr 2009 15:18:36 +0200
Subject: [PATCH] DSS2: fix return value for rotate_type sysfs function

Signed-off-by: Imre Deak <imre.deak@nokia.com>
---
 drivers/video/omap2/omapfb/omapfb-sysfs.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-sysfs.c b/drivers/video/omap2/omapfb/omapfb-sysfs.c
index 4e3da42..13028ae 100644
--- a/drivers/video/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/omap2/omapfb/omapfb-sysfs.c
@@ -64,9 +64,10 @@ static ssize_t store_rotate_type(struct device *dev,
 	if (rot_type == ofbi->rotation_type)
 		goto out;
 
-	r = -EBUSY;
-	if (ofbi->region.size)
+	if (ofbi->region.size) {
+		r = -EBUSY;
 		goto out;
+	}
 
 	ofbi->rotation_type = rot_type;
 
@@ -74,12 +75,10 @@ static ssize_t store_rotate_type(struct device *dev,
 	 * Since the VRAM for this FB is not allocated at the moment we don't need to
 	 * do any further parameter checking at this point.
 	 */
-
-	r = count;
 out:
 	omapfb_unlock(fbdev);
 
-	return r;
+	return r ? r : count;
 }
 
 
-- 
1.5.6.5