]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: Fix regression due to NULL constraints check
authorTakashi Iwai <tiwai@suse.de>
Tue, 3 Mar 2015 13:28:51 +0000 (14:28 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 4 Mar 2015 12:31:01 +0000 (12:31 +0000)
commit8d4d716fa4fa4dac04d69cb185abc30e0dbad7e5
tree5300ae2245998992e08ff0f3006c2299151b6247
parent9cbe621030a9cce16d27329dac74fd4b1c1d9412
regulator: Fix regression due to NULL constraints check

The commit [7fa01e29b445: '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: 7fa01e29b445 ('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>
drivers/regulator/core.c