Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753435AbdFMNPM (ORCPT ); Tue, 13 Jun 2017 09:15:12 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:44761 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752480AbdFMNPK (ORCPT ); Tue, 13 Jun 2017 09:15:10 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Tue, 13 Jun 2017 14:16:22 +0100 From: Charles Keepax To: Mark Brown CC: , , Subject: Re: [PATCH] regulator: core: Prioritise consumer mappings over regulator name Message-ID: <20170613131622.GC28618@localhost.localdomain> References: <1497280672-24011-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <20170612163856.vctl42rg674r72bj@sirena.org.uk> <20170613080731.GB28618@localhost.localdomain> <20170613101556.7xrzohow27dujwv4@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170613101556.7xrzohow27dujwv4@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706130233 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 911 Lines: 24 On Tue, Jun 13, 2017 at 11:15:56AM +0100, Mark Brown wrote: > On Tue, Jun 13, 2017 at 09:07:31AM +0100, Charles Keepax wrote: > > On Mon, Jun 12, 2017 at 05:38:56PM +0100, Mark Brown wrote: > > > On Mon, Jun 12, 2017 at 04:17:52PM +0100, Charles Keepax wrote: > > > > > r = regulator_lookup_by_name(supply); > > > > - if (r) > > > > - return r; > > > > Why have you left the lookup here? > > > Yeah was thinking that could maybe use a comment, if we don't > > find a match in the following loop over the supply map then we > > will exit with the regulator found here. So we can still use the > > regulator name for lookup just we default to the supply map. > > Why are we even doing the lookup here if we only use it if we fail to > find a supply mapping? Yeah I think that is probably a poor choice I will do a V2 that does the lookup conditionally after the search of the supply map. Thanks, Charles