DSS2: fix return value for rotate_type sysfs function
authorImre Deak <imre.deak@nokia.com>
Tue, 21 Apr 2009 13:18:36 +0000 (15:18 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 1 May 2009 16:45:11 +0000 (19:45 +0300)
Signed-off-by: Imre Deak <imre.deak@nokia.com>
drivers/video/omap2/omapfb/omapfb-sysfs.c

index 4e3da42..13028ae 100644 (file)
@@ -64,9 +64,10 @@ static ssize_t store_rotate_type(struct device *dev,
        if (rot_type == ofbi->rotation_type)
                goto out;
 
        if (rot_type == ofbi->rotation_type)
                goto out;
 
-       r = -EBUSY;
-       if (ofbi->region.size)
+       if (ofbi->region.size) {
+               r = -EBUSY;
                goto out;
                goto out;
+       }
 
        ofbi->rotation_type = rot_type;
 
 
        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.
         */
         * 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);
 
 out:
        omapfb_unlock(fbdev);
 
-       return r;
+       return r ? r : count;
 }
 
 
 }