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)
commitf8c12fe329c8da9f50d8b2b1183eeaa4d587e747
tree8ec2dee6efcf6a6a96e161bf9a86c6d9befb2a58
parentf4d6adf11b0a596ac4fee2fb2591f286de35c088
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