mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/6] regulator: check for init_data on registration
@ 2008-09-19 17:39 Liam Girdwood
  0 siblings, 0 replies; only message in thread
From: Liam Girdwood @ 2008-09-19 17:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Mark Brown

Since it is now mandatory to supply constraints via init_data on device
registration check for that when registering, saving us from oopsing
later on.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
---
 drivers/regulator/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index cec9c73..f5fcdf7 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct device *dev,
 	    !regulator_desc->type == REGULATOR_CURRENT)
 		return ERR_PTR(-EINVAL);
 
+	if (!init_data)
+		return ERR_PTR(-EINVAL);
+
 	rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
 	if (rdev == NULL)
 		return ERR_PTR(-ENOMEM);
-- 
1.5.4.3



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-19 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-19 17:39 [PATCH 3/6] regulator: check for init_data on registration Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®