Merge remote-tracking branch 'regulator/topic/core' into regulator-next
This commit is contained in:
commit
4ccb09f697
|
@ -780,58 +780,63 @@ static void print_constraints(struct regulator_dev *rdev)
|
||||||
{
|
{
|
||||||
struct regulation_constraints *constraints = rdev->constraints;
|
struct regulation_constraints *constraints = rdev->constraints;
|
||||||
char buf[160] = "";
|
char buf[160] = "";
|
||||||
|
size_t len = sizeof(buf) - 1;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (constraints->min_uV && constraints->max_uV) {
|
if (constraints->min_uV && constraints->max_uV) {
|
||||||
if (constraints->min_uV == constraints->max_uV)
|
if (constraints->min_uV == constraints->max_uV)
|
||||||
count += sprintf(buf + count, "%d mV ",
|
count += scnprintf(buf + count, len - count, "%d mV ",
|
||||||
constraints->min_uV / 1000);
|
constraints->min_uV / 1000);
|
||||||
else
|
else
|
||||||
count += sprintf(buf + count, "%d <--> %d mV ",
|
count += scnprintf(buf + count, len - count,
|
||||||
constraints->min_uV / 1000,
|
"%d <--> %d mV ",
|
||||||
constraints->max_uV / 1000);
|
constraints->min_uV / 1000,
|
||||||
|
constraints->max_uV / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!constraints->min_uV ||
|
if (!constraints->min_uV ||
|
||||||
constraints->min_uV != constraints->max_uV) {
|
constraints->min_uV != constraints->max_uV) {
|
||||||
ret = _regulator_get_voltage(rdev);
|
ret = _regulator_get_voltage(rdev);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
count += sprintf(buf + count, "at %d mV ", ret / 1000);
|
count += scnprintf(buf + count, len - count,
|
||||||
|
"at %d mV ", ret / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (constraints->uV_offset)
|
if (constraints->uV_offset)
|
||||||
count += sprintf(buf + count, "%dmV offset ",
|
count += scnprintf(buf + count, len - count, "%dmV offset ",
|
||||||
constraints->uV_offset / 1000);
|
constraints->uV_offset / 1000);
|
||||||
|
|
||||||
if (constraints->min_uA && constraints->max_uA) {
|
if (constraints->min_uA && constraints->max_uA) {
|
||||||
if (constraints->min_uA == constraints->max_uA)
|
if (constraints->min_uA == constraints->max_uA)
|
||||||
count += sprintf(buf + count, "%d mA ",
|
count += scnprintf(buf + count, len - count, "%d mA ",
|
||||||
constraints->min_uA / 1000);
|
constraints->min_uA / 1000);
|
||||||
else
|
else
|
||||||
count += sprintf(buf + count, "%d <--> %d mA ",
|
count += scnprintf(buf + count, len - count,
|
||||||
constraints->min_uA / 1000,
|
"%d <--> %d mA ",
|
||||||
constraints->max_uA / 1000);
|
constraints->min_uA / 1000,
|
||||||
|
constraints->max_uA / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!constraints->min_uA ||
|
if (!constraints->min_uA ||
|
||||||
constraints->min_uA != constraints->max_uA) {
|
constraints->min_uA != constraints->max_uA) {
|
||||||
ret = _regulator_get_current_limit(rdev);
|
ret = _regulator_get_current_limit(rdev);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
count += sprintf(buf + count, "at %d mA ", ret / 1000);
|
count += scnprintf(buf + count, len - count,
|
||||||
|
"at %d mA ", ret / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (constraints->valid_modes_mask & REGULATOR_MODE_FAST)
|
if (constraints->valid_modes_mask & REGULATOR_MODE_FAST)
|
||||||
count += sprintf(buf + count, "fast ");
|
count += scnprintf(buf + count, len - count, "fast ");
|
||||||
if (constraints->valid_modes_mask & REGULATOR_MODE_NORMAL)
|
if (constraints->valid_modes_mask & REGULATOR_MODE_NORMAL)
|
||||||
count += sprintf(buf + count, "normal ");
|
count += scnprintf(buf + count, len - count, "normal ");
|
||||||
if (constraints->valid_modes_mask & REGULATOR_MODE_IDLE)
|
if (constraints->valid_modes_mask & REGULATOR_MODE_IDLE)
|
||||||
count += sprintf(buf + count, "idle ");
|
count += scnprintf(buf + count, len - count, "idle ");
|
||||||
if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY)
|
if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY)
|
||||||
count += sprintf(buf + count, "standby");
|
count += scnprintf(buf + count, len - count, "standby");
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
sprintf(buf, "no parameters");
|
scnprintf(buf, len, "no parameters");
|
||||||
|
|
||||||
rdev_dbg(rdev, "%s\n", buf);
|
rdev_dbg(rdev, "%s\n", buf);
|
||||||
|
|
||||||
|
@ -1192,10 +1197,10 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
|
||||||
if (regulator->supply_name == NULL)
|
if (regulator->supply_name == NULL)
|
||||||
goto overflow_err;
|
goto overflow_err;
|
||||||
|
|
||||||
err = sysfs_create_link(&rdev->dev.kobj, &dev->kobj,
|
err = sysfs_create_link_nowarn(&rdev->dev.kobj, &dev->kobj,
|
||||||
buf);
|
buf);
|
||||||
if (err) {
|
if (err) {
|
||||||
rdev_warn(rdev, "could not add device link %s err %d\n",
|
rdev_dbg(rdev, "could not add device link %s err %d\n",
|
||||||
dev->kobj.name, err);
|
dev->kobj.name, err);
|
||||||
/* non-fatal */
|
/* non-fatal */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue