[RFC PATCH 3/4] regulator: rts490x: Add driver for on-die regulators

Krzysztof Kozlowski krzk at kernel.org
Sun Sep 20 06:05:28 PDT 2026


On 20/09/2026 12:05, zain_zhou at realsil.com.cn wrote:
> +
> +	regulators = of_get_available_child_by_name(pdev->dev.of_node, "regulators");
> +	if (!regulators)
> +		return 0;
> +
> +	config.dev = &pdev->dev;
> +	config.regmap = rts490x->regmap;
> +	config.driver_data = priv;
> +
> +	for (i = 0; i < ARRAY_SIZE(rts490x_regulators); i++) {
> +		struct device_node *node __free(device_node) = NULL;
> +		const char *name = rts490x_regulators[i].of_match;
> +
> +		node = of_get_available_child_by_name(regulators, name);
> +		if (!node)
> +			continue;
> +
> +		config.of_node = node;
> +		rdev = devm_regulator_register(&pdev->dev, &rts490x_regulators[i],
> +					       &config);
> +		if (IS_ERR(rdev))

You leak OF nodes.

Best regards,
Krzysztof



More information about the linux-i3c mailing list