From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbdC0WmQ (ORCPT ); Mon, 27 Mar 2017 18:42:16 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:36209 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752443AbdC0WmK (ORCPT ); Mon, 27 Mar 2017 18:42:10 -0400 Subject: Re: [PATCH v3] regulator: core: Limit propagation of parent voltage count and list To: Matthias Kaehlcke , Liam Girdwood , Mark Brown References: <20170327213129.109189-1-mka@chromium.org> From: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Douglas Anderson , Brian Norris Message-ID: Date: Mon, 27 Mar 2017 18:41:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170327213129.109189-1-mka@chromium.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Matthias, On 03/27/2017 05:31 PM, Matthias Kaehlcke wrote: > Commit 26988efe11b1 ("regulator: core: Allow to get voltage count and > list from parent") introduces the propagation of the parent voltage > count and list for regulators that don't provide this information > themselves. The goal is to support simple switch regulators, however as > a side effect normal continuous regulators can leak details of their > supplies and provide consumers with inconsistent information. > > Limit the propagation of the voltage count and list to switch > regulators. > Should we add a Fixes: 26988efe11b1 ("regulator: core: Allow to get voltage count and list from parent") tag? > Signed-off-by: Matthias Kaehlcke > --- > Changes in v3: > - Removed unused variable ops from regulator_count_voltages() > - Updated commit message to use correct format for referencing commits > (sorry, both stem from using different trees for testing and upstreaming) > You should add complete patch history, not only the delta with latest version. [snip] > > + if (!rdev->desc->ops->get_voltage && > + !rdev->desc->ops->get_voltage_sel && > + !rdev->desc->ops->list_voltage && > + !rdev->desc->fixed_uV) > + rdev->is_switch = true; > + Again, I think the check for get_voltage_sel is superfluous since !list_voltage implies the former, otherwise regulator_register() would had returned -EINVAL. Patch looks good to me though and I also see no regressions with it so: Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America