You need to sign in or sign up before continuing.
提交 46fabe1e 编写于 作者: M Mark Brown 提交者: Liam Girdwood

regulator: check for init_data on registration

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 3de89609
......@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
!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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册