浏览代码

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
  regulator, mc13xxx: Remove pointless test for unsigned less than zero
  regulator: Fix warning with CONFIG_BUG disabled
Linus Torvalds 14 年之前
父节点
当前提交
6366213ee3
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 1
      drivers/regulator/mc13xxx-regulator-core.c
  2. 1 0
      drivers/regulator/wm831x-dcdc.c

+ 1 - 1
drivers/regulator/mc13xxx-regulator-core.c

@@ -174,7 +174,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 < 0 || val > mc13xxx_regulators[id].desc.n_voltages);
+	BUG_ON(val > mc13xxx_regulators[id].desc.n_voltages);
 
 	return mc13xxx_regulators[id].voltages[val];
 }

+ 1 - 0
drivers/regulator/wm831x-dcdc.c

@@ -120,6 +120,7 @@ static unsigned int wm831x_dcdc_get_mode(struct regulator_dev *rdev)
 		return REGULATOR_MODE_IDLE;
 	default:
 		BUG();
+		return -EINVAL;
 	}
 }