diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-02 07:39:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 09:03:42 -0500 |
commit | 4c78899b92335af0da11e104698e329bb50810b5 (patch) | |
tree | 377f59b67fabaf229072f74daf8e3350cf2b5175 /drivers/regulator | |
parent | aebe495895f5542213dd17a644647b0aae8353f0 (diff) |
regulator: Don't create voltage sysfs entries if we can't read voltage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 669d02160221..679f92ec9a45 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2503,7 +2503,8 @@ static int add_regulator_attributes(struct regulator_dev *rdev) | |||
2503 | int status = 0; | 2503 | int status = 0; |
2504 | 2504 | ||
2505 | /* some attributes need specific methods to be displayed */ | 2505 | /* some attributes need specific methods to be displayed */ |
2506 | if (ops->get_voltage || ops->get_voltage_sel) { | 2506 | if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) || |
2507 | (ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0)) { | ||
2507 | status = device_create_file(dev, &dev_attr_microvolts); | 2508 | status = device_create_file(dev, &dev_attr_microvolts); |
2508 | if (status < 0) | 2509 | if (status < 0) |
2509 | return status; | 2510 | return status; |