From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29DDB3E8337 for ; Mon, 20 Jul 2026 11:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784545206; cv=none; b=uOZgqDJToBOVDgss93VunlYFdTI8zki6OKIEifH9iwAiU+t9Ecr2quPDbJIQsFM0mj1C+Kd1yABo4o96FGLoo2TRPrvDxy0SHSJF7oCDUIVyU0IdDCYhIuoROxaBVzRhP0dLftvndQzv+HZB/hYTT3IpYSwJzQHaHXvg4kSvQIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784545206; c=relaxed/simple; bh=2k8fjsWMFN6GMT+sc9J9EcaoQPOMEq3xMWlka0Kgpug=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c4lsB98Ao0YmPWTTIh6niBy4go8QB/rR3OFKk510u5ywKRF/45n96NR/wx1LVD6K1YCDi0/Xew9UAMfzJDFHgtWxLe5Gmxb29pFRBFBN3yFafMHJN3YRY1xBTOlT8SWa2V4NMshODrvRWeMXD9Fh1dEqKt4pVDbX20PWz0fJkwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TbVNuhSk; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TbVNuhSk" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-c96c92c0980so4314847a12.3 for ; Mon, 20 Jul 2026 04:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784545204; x=1785150004; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=G2BleauhOlFHfgFKb+xZpEu9VA2OJcjX49c4NON5nGI=; b=TbVNuhSkP8aze65x1CPCMCWvU7VeOXvWFxejTHbvdNJ995hwlCyEkaLkwQuUhIQy+X 9ftz9m/FWdcnh5SiOPFnocX4/1zhHjWaGqP9MZA56VZc1YC8K0LuHu5FrAOcAc653j9X jJOuuZ4HkXJtb2JrxO/w7rKTviF1gJJKNK/rkwZb9wruVZne3GiG2/vvRNqfl3qHp00b FjLeOifS/Q+eoUvpE7p+htveB2uxjY4lgGf5SoIbJPruhHVLIEOolYs6lbD4G3E7e7eD Z4T/MVQ+QTNM7hDwg3Zzh9zIMQ+JimxbBzRe4sEE6MtXJzG5EHnESWQxEZ0Sszvrdyt0 Cewg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784545204; x=1785150004; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=G2BleauhOlFHfgFKb+xZpEu9VA2OJcjX49c4NON5nGI=; b=cR1pIMbdUNfx9k+3B3e7Fe8+CnkCVKtF5R3bRgfkZ0qd2I22NfX2lt8kH1lO+ueQPz F3TjHNuUBn9rAdu5SPBmISDHdLxgvdV5DwHuk7BRqoM+s5LKRTsuE0LMBBCMXNTvoA83 4Z1ZxLuYzEemmnnf5uSIOIV9rKZfm8YqcWF+svHaZ3nsglh+P2crGsAfGbCrNddHmdAW d38XgsOCHM4xWD27Zj8aHLFXMj1LfO4/Gutfa4DSGYPaxU59W0pELepXzLQ+I5NCAw5t u2YAfbIqyomfuqoNuWYIKbAp59irsrjvbVCaeBhK1WIHJOp/T4vUCEXsYfZpf0DpfYqj X+JQ== X-Forwarded-Encrypted: i=1; AHgh+RqgOLpNfxkaxNhbhZ5VwmRXS4sn1lktiAMxz2t8z6OElLT9FlLvbCLs0w4v2VTRf9PUUhfJXRv+0BZtlyc=@vger.kernel.org X-Gm-Message-State: AOJu0YwOU9g5W0dsyNE1i9Cxtaz7cfvfUk4cA5k8xQMbA65OV10TMi0D mxsdWlI/dvjtN/wWBRlomf77jACtWKAZ8e94qJuc/OLTZXGUpAZGJOw= X-Gm-Gg: AfdE7clikI5ySofofL7rnwh+BLt0A1BEh/sRHGNLu09p1+ZqzfuXL/tMfmHRTAHBJR0 2YV9J+83DMhkRoWzIR21zrGDARozsKR3d5Ga7MSS8GoYIDrhhE6mNX/tsOJ9wSp75cGU1eqAEr7 LrZTsEkgJHoWjJL0+hZMGCRYVeaLmFeau+aIwl6Z1GflryHPwUnKfWP0BFTnGagLXzvkKsmxVty ZBzxcS+vQCIUwEIZPujngJu57rr3VPcXjUJbIYQf7x2LfJJDaTYkCvvDyropTLNQ8fOfd60YXf5 T3jxj7R/upKabI7YVWGeWh9Zxann0jb9cVg3jIkiyK8T4TijUCSSsbhWTcoYlD6UaNCPQQx/f0d EvHhUZKV7hGquOGhn+1U3v05hjjYeHrlhK3N+xJS3sqYMJpuzbJ/3zSyR7l8Xr042Ckj9i4y6Et pmz2M58z/Go4MAhpDd6I7B9QfGog== X-Received: by 2002:a05:6a20:c70b:b0:3b4:cd6:88b with SMTP id adf61e73a8af0-3c3ada1e7d0mr14178427637.46.1784545204170; Mon, 20 Jul 2026 04:00:04 -0700 (PDT) Received: from t-rex ([2401:4900:c200:8f2e:8d2c:f805:595:9600]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce29e340esm28696875c88.5.2026.07.20.04.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 04:00:03 -0700 (PDT) From: kr494167@gmail.com To: broonie@kernel.org, lgirdwood@gmail.com Cc: neil.armstrong@linaro.org, kancy2333@outlook.com, linux-kernel@vger.kernel.org, surendra Subject: [PATCH] regulator: sgm3804: register rails with their DT nodes Date: Mon, 20 Jul 2026 16:29:55 +0530 Message-ID: <20260720105955.105148-1-kr494167@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: surendra The driver locates the pos and neg child nodes to obtain their enable GPIOs, but registers both regulators with the parent node. As a result, the regulator core does not parse per-rail DT constraints or supplies. Pass each matching child node in regulator_config.of_node. Fixes: 0c47e1a8cf5d ("regulator: add SGM3804 Dual Output driver") Signed-off-by: surendra --- drivers/regulator/sgm3804-regulator.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/sgm3804-regulator.c b/drivers/regulator/sgm3804-regulator.c index c3406cfb73d0..531b98460ee3 100644 --- a/drivers/regulator/sgm3804-regulator.c +++ b/drivers/regulator/sgm3804-regulator.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -268,14 +269,21 @@ static int sgm3804_probe(struct i2c_client *i2c) for (i = 0; i < ARRAY_SIZE(sgm3804_regulator_desc); i++) { struct regulator_config config = { }; + const struct regulator_desc *reg = &sgm3804_regulator_desc[i]; struct regulator_dev *rdev; + struct device_node *child; + + child = of_get_child_by_name(dev_of_node(dev), reg->of_match); + if (!child) + return dev_err_probe(dev, -EINVAL, "missing child '%s'\n", + reg->of_match); config.dev = dev; config.regmap = ctx->regmap; - config.of_node = dev_of_node(dev); + config.of_node = child; config.driver_data = ctx; - rdev = devm_regulator_register(dev, &sgm3804_regulator_desc[i], - &config); + rdev = devm_regulator_register(dev, reg, &config); + of_node_put(child); if (IS_ERR(rdev)) return dev_err_probe(dev, PTR_ERR(rdev), "failed to register regulator %d\n", i); -- 2.55.0