mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
regulator: core: Report microvolts in sysfs even with only list_voltage()
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 <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
380a0e6f72
commit
f2889e650a
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue