Skip to content

Commit d2fb548

Browse files
vwaxbroonie
authored andcommitted
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>
1 parent 75c3543 commit d2fb548

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/regulator/virtual.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,21 @@ static int regulator_virtual_probe(struct platform_device *pdev)
285285
{
286286
char *reg_id = dev_get_platdata(&pdev->dev);
287287
struct virtual_consumer_data *drvdata;
288+
static bool warned;
288289
int ret;
289290

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+
}
302+
290303
drvdata = devm_kzalloc(&pdev->dev, sizeof(struct virtual_consumer_data),
291304
GFP_KERNEL);
292305
if (drvdata == NULL)

0 commit comments

Comments
 (0)