From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 2B0333E1225 for ; Mon, 20 Jul 2026 16:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784563512; cv=none; b=EjMXIAmZSl/VyqMjupANOW80ZzrBp3yXUdANUi3xWV284kAX0Cy2Bq+4CuD06onR70XI9e7ikkxBmLalh8C9eLj8jcVOB8YTPLT9Zq1iN/4Aeei20inVEz2v6rjqc36GkpcAcA5s8dL4+o8PzdO2CPbKQl78diBN2SKIW2KAxzI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784563512; c=relaxed/simple; bh=FYDDgM6bUlCmjcTij8zGfIPF35hktGOvqG5TFe8jejU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=j+PZhZtwHvHDYFsukkMWE1jDY2tCEECG4wYDDcVCjmUv0yO4hYNkOdqA0KpoRLmU/JWPLP4HZ15mAUpdGGox8yOgkj4PpBYDRnWaF4215isOatASr0fsx/c+NSIAokGnYAWdlyOlVryGwTenz3aUESHWhoNsXjGuXDM2nJTQNdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YJQnrkB4; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YJQnrkB4" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-49545ba3d4eso20528955e9.3 for ; Mon, 20 Jul 2026 09:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784563509; x=1785168309; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:organization :autocrypt:content-language:references:cc:to:subject:reply-to:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to:content-type; bh=xzaUSJfGWfscUhpIieIz36Ejbb7OBxq8tsVXcyt0Z60=; b=YJQnrkB4qd51uTS1Fo3BrHCmNbT8KRgh9iHcX5CpGsbRLPzRQx+XASqr5FpisEk6/1 6EiS+2MGH9mAHDsoA4Wig9u1WvDc8YxF8KKg5pI0j+S0CqjlPOFXCIBUx+EFmS8ONHMY KLfZwBeZv6MO9oKHBuRfog0Doiu4Vu/1be6KlPiI0i7AQj9uT07WHDZ+uYNVv+ELODG7 pd9yLsnFYQzvZL9f3ZufRnOBO6oYk3H2RpVJ0sBJlwTxa8U+1yF73YrHslvMLp17TySK uzs61d+5Whsuv2ZwHIB6HB3H6KV9a8hOxvpgLqGmIhKfilf0MlsuLakbZuVppoKkQ6UK O7Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784563509; x=1785168309; h=content-transfer-encoding:content-type:in-reply-to:organization :autocrypt:content-language:references:cc:to:subject:reply-to:from :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to:content-type; bh=xzaUSJfGWfscUhpIieIz36Ejbb7OBxq8tsVXcyt0Z60=; b=XOH2mklf/ljXWY0W7f9z8LWb7lkDgWhhckE7k51BmwltAY9t9qsBobKXxgpLfVtkEO hKcPCFgwu/NcvZ8SazLWdk8VhX6ZJSv6Ruy9UWxR0jGDCntH6DsNFDoFYWWKSWvWakq3 JBxyV5+rQQh5ken9vHlfZ3jWICCIdI1X95DFoGA7go36z8BIbAx0kOVelkH2Q1RohbWL 0cNAa3zZalkFyyVuk4/Tnydr1j0z8ke1sIErGVcVq8hfzG8SFmUkXxabz3LtrtVm1ExE nNQyNLtR/idKemKm31cOJcrXEk52Im/6rkPrddn9sRvPwtrdI59HXjUb11Py30VOp0uO hE9w== X-Forwarded-Encrypted: i=1; AHgh+RoDsB0z5+/MAikST3LPnVAI6WHQiW0jdzvd68Zc+7YGZCiiDZKmrkOlunYj4zVxn5fRJAqUfjVontN0ln0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywi5JvnaMdi5paHM6qcQNGs/jhSD6+Lh23lGgAmTGS4I6qtTjj+ 4fFspp/OrKxXQ6uw5+fzM8nv7BXL4RFAMlRcPG9Romc8pbPONyD9CPN7BTASFsPXPs0= X-Gm-Gg: AfdE7clkcY6icuhs++vK6ATDModcb1oYDbjiIue9ywXVegBJt4cElvtDo+0tTicypdE bxcoq/4/keWoVUW6CDK5CmnsIuhHkZJl1RjW/g2YDxsJsUw68rrn1b6w/Wu6l3bd8PFKCw2GsrH ECGymFTRsrLW7ZDvDcyZAUfFaiTLpwcugHivF9XhLfwTKg6hmGdpbNtBZfYM6ldDm1ELB5EvIKf 8lPISiLe2Bwke8nUulQwqdrHACBy/aLVSOyMUNNgbYzpQA7KBDZzu/DsbKZtq/NonbXmOLiS5iz dzetTwte3WGkrI/yCiXhQkv6k3TbtOgqEOT2dU6HMxf/GrCSyO925+Q63BhGIAeWFxaWkfZTKz3 1p/9F9tGoaeV5qUuq6MD+1tT8DRJFXp37VwcLyxgTnbwCLc631pmOnsZvCVhisF2TQEML2/oKH2 oWAASpgriLuGkECXhvd6zokxUKapPivBMXO61Uxnf1ARLEw9ru+olwskcUkMKeSnkgffn7 X-Received: by 2002:a05:600c:4c2a:b0:493:c535:3934 with SMTP id 5b1f17b1804b1-4954a51fc5fmr126286145e9.36.1784563509064; Mon, 20 Jul 2026 09:05:09 -0700 (PDT) Received: from ?IPV6:2a01:e0a:106d:1080:544a:2852:f257:ebc5? ([2a01:e0a:106d:1080:544a:2852:f257:ebc5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f63eeece9sm29691064f8f.37.2026.07.20.09.05.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 09:05:08 -0700 (PDT) Message-ID: <0da42fc9-c9d7-4f3a-b81f-e460e8d1c58d@linaro.org> Date: Mon, 20 Jul 2026 18:05:07 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: neil.armstrong@linaro.org Reply-To: Neil Armstrong Subject: Re: [PATCH] regulator: sgm3804: register rails with their DT nodes To: kr494167@gmail.com, broonie@kernel.org, lgirdwood@gmail.com Cc: kancy2333@outlook.com, linux-kernel@vger.kernel.org References: <20260720105955.105148-1-kr494167@gmail.com> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhB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QzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <20260720105955.105148-1-kr494167@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/26 12:59, kr494167@gmail.com wrote: > 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. Hmmm, no it does get the constraints properly because the regulator core will fetch the associated subnodes with the of_match desc property in regulator_of_get_init_node(). This patch solves nothing and duplicates the regulator core behaviour. Neil > > 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);