diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-23 18:38:00 +0200 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-23 22:06:49 +0200 |
commit | 70f311be5ac67303d3cf5347a9b944fa8a838071 (patch) | |
tree | dc7d55d67210e170986184b8d857fa5800968830 | |
parent | f235f8ee9d9591aaeed05a8e2eb40b7978d19e68 (diff) |
pcf50606-regulator: Remove obsolete tests
If the regulator id is out of range something else has been terrible gone
wrong and it does not make sense to catch it here in a soft way.
-rw-r--r-- | drivers/regulator/pcf50606-regulator.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/regulator/pcf50606-regulator.c b/drivers/regulator/pcf50606-regulator.c index f9a9b85bcb2..ae3193f3104 100644 --- a/drivers/regulator/pcf50606-regulator.c +++ b/drivers/regulator/pcf50606-regulator.c @@ -127,15 +127,12 @@ static int pcf50606_regulator_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) { struct pcf50606 *pcf; - int ret; int regulator_id, millivolts; uint8_t volt_bits, regnr; pcf = rdev_get_drvdata(rdev); regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50606_NUM_REGULATORS) - return -EINVAL; millivolts = min_uV / 1000; @@ -150,7 +147,7 @@ static int pcf50606_regulator_set_voltage(struct regulator_dev *rdev, break; case PCF50606_REGULATOR_DCUD: volt_bits = dcudc_voltage(millivolts); - reg_nr = PCF50606_REG_DCUDC1; + regnr = PCF50606_REG_DCUDC1; break; case PCF50606_REGULATOR_D1REG: case PCF50606_REGULATOR_D2REG: @@ -186,8 +183,6 @@ static int pcf50606_regulator_get_voltage(struct regulator_dev *rdev) pcf = rdev_get_drvdata(rdev); regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50606_NUM_REGULATORS) - voltageurn -EINVAL; switch (regulator_id) { case PCF50606_REGULATOR_DCD: @@ -227,7 +222,7 @@ static int pcf50606_regulator_get_voltage(struct regulator_dev *rdev) return -EINVAL; } - return volatage * 1000; + return voltage * 1000; } static int pcf50606_regulator_enable(struct regulator_dev *rdev) @@ -237,8 +232,6 @@ static int pcf50606_regulator_enable(struct regulator_dev *rdev) uint8_t regnr; regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50606_NUM_REGULATORS) - return -EINVAL; regnr = pcf50606_regulator_registers[regulator_id]; @@ -252,8 +245,6 @@ static int pcf50606_regulator_disable(struct regulator_dev *rdev) uint8_t regnr; regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50606_NUM_REGULATORS) - return -EINVAL; /* IOREG cannot be powered off since it powers the PMU I2C */ if (regulator_id == PCF50606_REGULATOR_IOREG) @@ -271,8 +262,6 @@ static int pcf50606_regulator_is_enabled(struct regulator_dev *rdev) uint8_t regnr, val; regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50606_NUM_REGULATORS) - return -EINVAL; /* the *ENA register is always one after the *OUT register */ regnr = pcf50606_regulator_registers[regulator_id]; |