viafb: correct sync polarity for OLPC DCON
[pandora-kernel.git] / drivers / regulator / mc13xxx-regulator-core.c
index 2bb5de1..6532853 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/err.h>
+#include <linux/module.h>
 #include "mc13xxx.h"
 
 static int mc13xxx_regulator_enable(struct regulator_dev *rdev)
@@ -174,7 +175,7 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
 
        dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val);
 
-       BUG_ON(val > mc13xxx_regulators[id].desc.n_voltages);
+       BUG_ON(val >= mc13xxx_regulators[id].desc.n_voltages);
 
        return mc13xxx_regulators[id].voltages[val];
 }