[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1320234513-13150-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Date: Wed, 2 Nov 2011 11:48:32 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Liam Girdwood <lrg@...com>
Cc: linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH] regulator: Don't create voltage sysfs entries if we can't read voltage
Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
---
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 669d021..dc3b31a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2503,7 +2503,8 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
int status = 0;
/* some attributes need specific methods to be displayed */
- if (ops->get_voltage || ops->get_voltage_sel) {
+ if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) ||
+ (ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0) {
status = device_create_file(dev, &dev_attr_microvolts);
if (status < 0)
return status;
--
1.7.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists