omap_overclocking: don't reject higher opp values
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 30 May 2012 21:02:53 +0000 (00:02 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 21 Jun 2012 13:32:39 +0000 (16:32 +0300)
.. clamp them instead, so that scripts don't have to care if this is
3530 (5 OPPs) or 3730 (4 OPPs).

drivers/misc/omap_overclocking.c

index 129241d..24c352a 100644 (file)
@@ -272,7 +272,10 @@ static int cpu_maxopp_write(struct file *file, const char __user *buffer,
        if (retval < 0)
                return retval;
 
-       if (val < 1 || val > opp_max_avail)
+       if (val > opp_max_avail)
+               val = opp_max_avail;
+
+       if (val < 1)
                return -EINVAL;
 
        ret = set_opp_max(val);