Re: [PATCH 4/4] regulator: Add support for UGREEN NASync DH2300 MCU SATA power gate

From: Mark Brown

Date: Fri Jun 12 2026 - 12:40:02 EST


On Fri, Jun 12, 2026 at 07:34:17PM +0400, Alexey Charkov wrote:

> +static int ugreen_dh2300_mcu_regulator_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct regulator_config config = { };
> + struct regulator_dev *rdev;
> + struct device_node *np;
> +
> + np = of_get_child_by_name(dev->parent->of_node, "regulator");
> + if (!np)
> + return dev_err_probe(dev, -ENODEV,
> + "missing regulator child node\n");

You should just be able to configured this in the regulator_desc rather
than describe it.

> + config.init_data = of_get_regulator_init_data(dev, np,
> + &ugreen_dh2300_sata_desc);
> +

Similarly here, there should be no need for this open coding.

Attachment: signature.asc
Description: PGP signature