From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.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 DB2C935CB8C for ; Thu, 2 Jul 2026 04:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782968153; cv=none; b=HqzVEdHhfLNfnXZntsdwoUymXfQBBj2QQ6e8gNu0AYAmj1mMNusYOc6fhLWRdfEJPrDnfb3EK5cYtRWhCvVPe+CtIOCzNq0V92JFfnZ+I5213yBSQbTnP1BpEYP2o5Hy745bI7ephROqIjOwmlRqfJrNNQUjC+K2iRKzu2mk/Ro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782968153; c=relaxed/simple; bh=GSS4EZh7oBQIXtndY45bpUY9Co6B5hnpvR7DwawWloc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XcrTAK1n3n1E+4Y7jmemIOquTo0iPZFqyewGzz9gKT5T290YnldvlWDIr5EqNoJOrE9IEmKfygb6dVFl0p6TAcYyvAsVZQJBHrTBtsoRwbVHHdmQqeRzgxnmxuz/7vrvxYKcJ9l/q12qsXQ85LMPtCNSfllxOixlj5FC4m9f6/0= 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=srgtvfhF; arc=none smtp.client-ip=209.85.167.49 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="srgtvfhF" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5aeb2bc82ccso1391686e87.2 for ; Wed, 01 Jul 2026 21:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782968150; x=1783572950; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mMGAtiVG2tLVc2K86tjnvaWkLMJ+BxBeHK0dLBsStdY=; b=srgtvfhFk392LBY/6lVHEi2vmEXVgmIWyyUnQ/EFsiDv8xWaThAuywIYyhMplm5LVx CHWityjtWP9UhcEcM1B5laazeZBU2Lp9gFAGAKtDd5szXMniofUVWypUHz8vbHhgNF3k 0kQ0MLMTUGqeD5G8JOws2OIK9upTJQOT/lWX9BqqYRzteKwjR1fCFfYAejA13JFdsnEy /jDb7q/mnxu8ACzGqPQKFY0QE6NFGbZc3AHRcJO2nViXJQ/q6vhXKGft3Y5YnneODMhH bB3AHdjUBo5zVWJxYA1U/HWW1H+jOCW4fqscw1fwHKxFnnlGX365zbc+Yuw9+NeN+j9l tCQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782968150; x=1783572950; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mMGAtiVG2tLVc2K86tjnvaWkLMJ+BxBeHK0dLBsStdY=; b=sKQK9a7puexxcR4N6+hXcRdBM/ZlWvt2W2YAfrZ+m/cXXIT0gGDR6uEmFXOXHTNDnJ HQJDP8Ilykvpl4sqvZMoZEPebZp7lo70afnR6p97oiEH+issBC9E3yJMTDSKw8CSbH85 MzJw1bcLY6p7aFWcEI3jR+1Zb50cIQ1PaAkhFlmXeE/0OkYSceZi05Egok6DZnQirtVp dq1U7r7hY0Q+rjB0FqEwRWZLT0t+8k7EcJM9Tj/U8Ha25YDeC7k97yQlW6w42ozxmTSh 6zg4qKtW75LAYcoMIjcJGWUDGHLhF7Dxg4atstSv2jx4jgXRU7L7DqbIgjIZQFeHog3f SGtQ== X-Forwarded-Encrypted: i=1; AHgh+Rqs/lHDv4pU50sGUc7Svx9MyDXvjeES7xQnPV7FpeLM1XDmY9ddMgv+oAbYdDzfKnFwNyB9Z06PIP0=@vger.kernel.org X-Gm-Message-State: AOJu0YxZiu2azar/wrWXnH1pfPzp8uEj1F6sMvlVlvIzT/ibpmuHT2Ne aNHS5Fsn5ohMx4dZzo6PaEx2jZuqIiJFiguHm03eJlZz+j7LAh+zcQDn X-Gm-Gg: AfdE7clQILS7ZsrOsCQqTtwt/r83w8EaFg1UkLmXxwKOQLEd/KmodNFz91QJtspbzkB fY1FqsHSLt1rQut2mrFY/SIQc3eMhjxmAV+VhQULEEbmhpqRk+Kih0m9ONVGiBKOmNNyVHvM6RA MPfrblHWa1FFPnWBbtfYyzKpk41AaVWJtoObeKEdOj52YVASgtEgN1d6b17aLMiyQ3bmGYqivGp Y22x3KOoA+9PaPFmbAR75waLaTLFlHvsuYhdva7LYoj0lGs34A1oJbT0+o3GHJ+xlOYRwMzcHMM /lcWa1Qv933HNX4Vh8ASaCkCLCH+hI/+dpfekqfm/yQ3EIKwGQRsOMdkS8z8kofqzherZYhv7ly OS6Ez/BeXNeHBme3c0iNoFOzrH6DqbImFszK+EAXQ6Lrp2ZsuTMOtoG+YGKZTSaCZjAVAwBlVJY ZgnhTo7c8E6zbJpJ7rxU10QZysTYFSm0XF4i9r24Hjwy2WpbaXwibAT6050wESFE1OXwka6w== X-Received: by 2002:a05:6512:4502:b0:5ae:b489:95c0 with SMTP id 2adb3069b0e04-5aec8026071mr740640e87.16.1782968150042; Wed, 01 Jul 2026 21:55:50 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5aec899a3a8sm430135e87.31.2026.07.01.21.55.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 21:55:49 -0700 (PDT) Message-ID: <96afdec2-db03-46ba-96ac-f52b13a92d5d@gmail.com> Date: Thu, 2 Jul 2026 07:55:48 +0300 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/8] regulator: bd71828: Support ROHM BD73800 To: Mark Brown Cc: Matti Vaittinen , Matti Vaittinen , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Michael Turquette , Stephen Boyd , Brian Masney , Linus Walleij , Bartosz Golaszewski , Alexandre Belloni , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org References: <1d00359236272fd1fab0dfbcb9119d2f91aa0d23.1782909323.git.mazziesaccount@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/07/2026 16:01, Mark Brown wrote: > On Wed, Jul 01, 2026 at 03:42:35PM +0300, Matti Vaittinen wrote: >> From: Matti Vaittinen > >> + nproot = of_get_child_by_name(nproot, "regulators"); >> + if (!nproot) { >> + dev_err(dev, "failed to find regulators node\n"); >> + return -ENODEV; >> + } >> + for_each_child_of_node(nproot, np) { >> + if (of_node_name_eq(np, LDO1_NODE_NAME)) >> + ldo1_use_high_range = of_property_read_bool(np, >> + "rohm,ldo-range-high"); >> + if (of_node_name_eq(np, LDO3_NODE_NAME)) >> + ldo3_use_high_range = of_property_read_bool(np, >> + "rohm,ldo-range-high"); >> + } > > Why do we iterate over all nodes rather than doing additional > of_get_child_by_name()s? This series has been sitting in my "TODO" -folder for quite a while - so I am not anymore 100% sure as to why. I believe I've thought that the of_get_child_by_name() does (internally) iterate all the child nodes, so using it twice would cause code to loop through the nodes twice. So, looping through all child nodes in a single loop probably felt like the right thing to do. Furthermore, I've probably written the first version before I found out the cleanup.h... But yes. I think you're right. This can be made much leaner. >> + if (ldo1_use_high_range) { >> + d[BD73800_LDO1].desc.linear_ranges = bd73800_ldo13_high_volts; >> + d[BD73800_LDO1].desc.n_linear_ranges = >> + ARRAY_SIZE(bd73800_ldo13_high_volts); >> + } >> + if (ldo3_use_high_range) { >> + d[BD73800_LDO3].desc.linear_ranges = bd73800_ldo13_high_volts; >> + d[BD73800_LDO3].desc.n_linear_ranges = >> + ARRAY_SIZE(bd73800_ldo13_high_volts); >> + } > > You could just do these updates without the intermediate variables. Yes. Thanks for the suggestions! I will fix these for the v2, but it will probably be out only during August. Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~