diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-03-03 08:28:51 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-04 07:31:01 -0500 |
commit | cde72ccfdd5920abb0413d16240c1551de3bd13a (patch) | |
tree | 5300ae2245998992e08ff0f3006c2299151b6247 | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
regulator: Fix regression due to NULL constraints check
The commit [39f802d6b6d9: 'regulator: Build sysfs entries with static
attribute groups'] converted the sysfs entry creation to static
attribute groups, but this resulted in a regression due to the NULL
check of rdev->constraints. At the point where the device is
registered, rdev->constraints isn't set, so the attributes depending
on it are missing.
We may fix it by shuffling the code order in regulator_register(), but
a quicker fix is to just remove this NULL check. rdev->constraints is
in anyway always set to non-NULL in set_machine_constraints(), thus
the check there is basically superfluous.
Fixes: 39f802d6b6d9 ('regulator: Build sysfs entries with static attribute groups')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reportded-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/core.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index b899947d839d..1245dca79009 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -3444,13 +3444,6 @@ static umode_t regulator_attr_is_visible(struct kobject *kobj, | |||
3444 | if (attr == &dev_attr_requested_microamps.attr) | 3444 | if (attr == &dev_attr_requested_microamps.attr) |
3445 | return rdev->desc->type == REGULATOR_CURRENT ? mode : 0; | 3445 | return rdev->desc->type == REGULATOR_CURRENT ? mode : 0; |
3446 | 3446 | ||
3447 | /* all the other attributes exist to support constraints; | ||
3448 | * don't show them if there are no constraints, or if the | ||
3449 | * relevant supporting methods are missing. | ||
3450 | */ | ||
3451 | if (!rdev->constraints) | ||
3452 | return 0; | ||
3453 | |||
3454 | /* constraints need specific supporting methods */ | 3447 | /* constraints need specific supporting methods */ |
3455 | if (attr == &dev_attr_min_microvolts.attr || | 3448 | if (attr == &dev_attr_min_microvolts.attr || |
3456 | attr == &dev_attr_max_microvolts.attr) | 3449 | attr == &dev_attr_max_microvolts.attr) |