On 02/08/2025 13:22, Dzmitry Sankouski wrote: > + > + platform_set_drvdata(pdev, s2dos05); > + > + rdata = devm_kcalloc(dev, rdev_num, sizeof(*rdata), GFP_KERNEL); > + if (!rdata) > + return -ENOMEM; > + > + for (i = 0; i < rdev_num; i++) > + rdata[i].name = regulators[i].name; > + > + s2dos05->regmap = iodev->regmap_pmic; > + s2dos05->dev = dev; > + if (!dev->of_node) > + dev->of_node = dev->parent->of_node; > + > + for (i = 0; i < rdev_num; i++) { > + struct regulator_dev *regulator; > + > + config.init_data = rdata[i].init_data; > + config.of_node = rdata[i].of_node; > + config.dev = dev; > + config.driver_data = s2dos05; > + regulator = devm_regulator_register(&pdev->dev, > + ®ulators[i], &config); > + if (IS_ERR(regulator)) { > + ret = PTR_ERR(regulator); > + dev_err(&pdev->dev, "regulator init failed for %d\n", > + i); > + } > + } > + > + return ret; I do not understand your logic here and I already commented on issues with 'ret'. If 1st regulator fails, but the last one succeeds, you return 0. If 1st succeeds, but the last one fails, you return failure failing the probe. Why only last regulator is important? I see it is a buck, so maybe there is a difference, but this should be clearly explained. Or fixed. Best regards, Krzysztof