Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220301111831.3742383-3-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Vincent Whitchurch and committed by
Mark Brown
d2fb5487 75c3543e

+13
+13
drivers/regulator/virtual.c
··· 285 285 { 286 286 char *reg_id = dev_get_platdata(&pdev->dev); 287 287 struct virtual_consumer_data *drvdata; 288 + static bool warned; 288 289 int ret; 290 + 291 + if (!warned) { 292 + warned = true; 293 + pr_warn("**********************************************************\n"); 294 + pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); 295 + pr_warn("** **\n"); 296 + pr_warn("** regulator-virtual-consumer is only for testing and **\n"); 297 + pr_warn("** debugging. Do not use it in a production kernel. **\n"); 298 + pr_warn("** **\n"); 299 + pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); 300 + pr_warn("**********************************************************\n"); 301 + } 289 302 290 303 drvdata = devm_kzalloc(&pdev->dev, sizeof(struct virtual_consumer_data), 291 304 GFP_KERNEL);