Skip to content

Commit

Permalink
regulator: core: Report microvolts in sysfs even with only list_volta…
Browse files Browse the repository at this point in the history
…ge()

If a regulator only supports a single voltage list_voltage() can be used
to report what that voltage is so add this as one of the criteria for
creating the microvolts file in sysfs.

Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
broonie committed Sep 7, 2012
1 parent 380a0e6 commit f2889e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3020,7 +3020,8 @@ static int add_regulator_attributes(struct regulator_dev *rdev)

/* some attributes need specific methods to be displayed */
if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) ||
(ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0)) {
(ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0) ||
(ops->list_voltage && ops->list_voltage(rdev, 0) >= 0)) {
status = device_create_file(dev, &dev_attr_microvolts);
if (status < 0)
return status;
Expand Down

0 comments on commit f2889e6

Please sign in to comment.