Skip to content

Commit

Permalink
Merge remote-tracking branch 'regulator/topic/tps516312' into regulat…
Browse files Browse the repository at this point in the history
…or-next
  • Loading branch information
Mark Brown committed Dec 10, 2012
2 parents f4244c6 + dbc7051 commit f8c85fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/regulator/tps51632-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ static int tps51632_probe(struct i2c_client *client,
return -EINVAL;
}

if (pdata->enable_pwm_dvfs) {
if ((pdata->base_voltage_uV < TPS51632_MIN_VOLATGE) ||
(pdata->base_voltage_uV > TPS51632_MAX_VOLATGE)) {
dev_err(&client->dev, "Invalid base_voltage_uV setting\n");
return -EINVAL;
}

if ((pdata->max_voltage_uV) &&
((pdata->max_voltage_uV < TPS51632_MIN_VOLATGE) ||
(pdata->max_voltage_uV > TPS51632_MAX_VOLATGE))) {
dev_err(&client->dev, "Invalid max_voltage_uV setting\n");
return -EINVAL;
}
}

tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
if (!tps) {
dev_err(&client->dev, "Memory allocation failed\n");
Expand Down

0 comments on commit f8c85fe

Please sign in to comment.