Commit d2fb5487 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Mark Brown

regulator: virtual: warn against production use

This driver is only meant for debugging and testing.  Currently, it's
not possible to use it without patching the kernel since it requires
platform data, but we'll be adding devicetree support, so add a loud
warning to make it clear that it's still only meant for debugging and
testing.
Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220301111831.3742383-3-vincent.whitchurch@axis.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 75c3543e
...@@ -285,8 +285,21 @@ static int regulator_virtual_probe(struct platform_device *pdev) ...@@ -285,8 +285,21 @@ static int regulator_virtual_probe(struct platform_device *pdev)
{ {
char *reg_id = dev_get_platdata(&pdev->dev); char *reg_id = dev_get_platdata(&pdev->dev);
struct virtual_consumer_data *drvdata; struct virtual_consumer_data *drvdata;
static bool warned;
int ret; int ret;
if (!warned) {
warned = true;
pr_warn("**********************************************************\n");
pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
pr_warn("** **\n");
pr_warn("** regulator-virtual-consumer is only for testing and **\n");
pr_warn("** debugging. Do not use it in a production kernel. **\n");
pr_warn("** **\n");
pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
pr_warn("**********************************************************\n");
}
drvdata = devm_kzalloc(&pdev->dev, sizeof(struct virtual_consumer_data), drvdata = devm_kzalloc(&pdev->dev, sizeof(struct virtual_consumer_data),
GFP_KERNEL); GFP_KERNEL);
if (drvdata == NULL) if (drvdata == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment