]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: Copy constraints from regulators when initialising them
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 29 Nov 2010 15:55:17 +0000 (15:55 +0000)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Wed, 12 Jan 2011 14:33:01 +0000 (14:33 +0000)
commitee612c4a01c3caa030f9f107f5fe32e2fd058851
tree8ec2dee6efcf6a6a96e161bf9a86c6d9befb2a58
parent183aa454ea092affb56c978f8b2f6c1f139ee64d
regulator: Copy constraints from regulators when initialising them

Currently the regulator API uses the constraints structure passed in to
the core throughout the lifetime of the object. This means that it is not
possible to mark the constraints as __initdata so if the kernel supports
many boards the constraints for all of them are kept around throughout the
lifetime of the system, consuming memory needlessly. By copying constraints
that are actually used we allow the use of __initdata, saving memory when
multiple boards are supported.

This also means the constraints can be const.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/core.c
include/linux/regulator/driver.h