Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2308865yba; Thu, 25 Apr 2019 14:14:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyl088quqajBllokXsdo1SKk/fN2H8CPwpvjwepIdEYaiHQZoE3wDDx99YYA89wWjgbJ7bu X-Received: by 2002:a17:902:6bc5:: with SMTP id m5mr42836946plt.180.1556226893050; Thu, 25 Apr 2019 14:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556226893; cv=none; d=google.com; s=arc-20160816; b=VD0GjBBoaTcisGmRZElkbLYxRbFuNpNFKIimqD0RfOPzw1qFdryUeXtKMdDS6UKdhi 6oWIn5U43sSXge6imJsDRmMOjHJqoLM3svOr/I/VliSTwC86add9Ntejgphh7bFUDEQ2 uC5QQ4QOOKWplLqRem4tCW0ubuI4pSmXDKQY6ce/TKaiaQ8nO/HVHWEU3KeIij2V+Q2I 2uvag+Tj94VsmtIZwTdzHRC3uqn70GD5kBIaMoUq3AiCdbCEOFDxcrtyZFtIY+Hmfwqm /xWR6QPCd4LxSB5EDVhDzd1eIJ+dGu1qO8Jw6Q6B8I/jjqOe8p4UM5gE1LfJkgDrD06d Woog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nSIfCqlsx2G+8+G5t23TY+XHbHiOh9kZsU20xPG2v1M=; b=G+1Lbxm1dALqczIplSyMyqNB0cuJPAFG0TcKD9ThweVAxJH+Ty681WtexINoyClRa0 SkTtAgT5AkAiSKNW8I+ZQhoL1NBgsvbjdEyih6uqKLXUaqHgesK4IaKukem3ezcHnA1H cbjFLFdXJ3pZahvZfgavvmGcR7PN6BQ1qs7RYj1wF/qGasPn3lKJmRYlhz60fOkI8M+M LOaYrnJ/uip0MHSn2Kn8N/EHD4peMxTlFWbd7oYYKavXDOHy19DzpjbvnRyJ7yOKsP5J k7ydBsdT3qAEvjCK7L/D5oRi9lrZE4XX+FeoNlLFospiayvEKpOd/FL7do+M7tRHk812 mpOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=exnzUHlN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si815310plo.359.2019.04.25.14.14.38; Thu, 25 Apr 2019 14:14:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=exnzUHlN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730677AbfDYShu (ORCPT + 99 others); Thu, 25 Apr 2019 14:37:50 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:54864 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbfDYShu (ORCPT ); Thu, 25 Apr 2019 14:37:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nSIfCqlsx2G+8+G5t23TY+XHbHiOh9kZsU20xPG2v1M=; b=exnzUHlNpzmHwn5XHFYkoe7/d PZ5KYKhHzwVHZsMdHOAVWXx5a7psDNSwFphhKR45k+t3p7qaRAZ2PZIMeFYyjKjn7LKgHLDXJ5l38 oF2TlKuh+18FAyZI0bzvVhoHsPs6tvHgTvPsnMlm9M6cn/PZghT/EQCZfNolxfu71+ykk=; Received: from 188.29.165.56.threembb.co.uk ([188.29.165.56] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hJjFa-0004EV-Sj; Thu, 25 Apr 2019 18:37:39 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 1FD68441D3B; Thu, 25 Apr 2019 19:37:36 +0100 (BST) Date: Thu, 25 Apr 2019 19:37:36 +0100 From: Mark Brown To: Jorge Ramirez Cc: lgirdwood@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, bjorn.andersson@linaro.org, vinod.koul@linaro.org, niklas.cassel@linaro.org, khasim.mohammed@linaro.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 2/3] drivers: regulator: qcom: add PMS405 SPMI regulator Message-ID: <20190425183736.GF23183@sirena.org.uk> References: <1548675904-18324-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1548675904-18324-3-git-send-email-jorge.ramirez-ortiz@linaro.org> <20190204090301.GC23441@sirena.org.uk> <95276ca0-6896-a595-867a-184a518fa31f@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s5/bjXLgkIwAv6Hi" Content-Disposition: inline In-Reply-To: <95276ca0-6896-a595-867a-184a518fa31f@linaro.org> X-Cookie: But they went to MARS around 1953!! User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --s5/bjXLgkIwAv6Hi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 19, 2019 at 07:29:48PM +0200, Jorge Ramirez wrote: > On 2/4/19 10:03, Mark Brown wrote: > >> + /* we know we only have one range for this type */ > >> + if (vreg->logical_type == SPMI_REGULATOR_LOGICAL_TYPE_HFS430) > >> + return range; > > Rather than have special casing for the logical type in here it seems > > better to just provide a specific op for this logical type, you could > > always make _find_range() call into that one if you really want code > > reuse here. You already have separate ops for this regulator type > > anyway. > sorry I dont quite understand your point. If you need to skip the majority of the contents of the function for some regulators just define a separate function for those regulators and give them different ops structures rather than using the same ops structure and handling it in the functions. > But also I am not sure I see the benefits with respect to the proposed > change... The benefit is that the selection of which operations to use is done in only one place (the selection of the ops structure) rather than in multiple places (the selection of the ops structure and the contents of the operations). --s5/bjXLgkIwAv6Hi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlzB/m8ACgkQJNaLcl1U h9DS4gf/bAbnyiU2v4l44+1nIFu1Ffa/AwcPHiVzkuINIa7V6xi3h/yxk1Cr4s43 aXJvrdZ/ntwIw4bKuV8OyNDwFgO5yICJmECx6aBP0ripdl7pC9dUg72aalbcr0z9 7Q9G+HDvgk+g3iFWbVKzKvjzyAuczqQUQApPIYUNmMN9GCvCBp3AZcrE8bSA9fW4 jBg4bnkesubO/6c4S3b1guJV/+/EviDML4LxpOTUuhXd3lVWyzrRdNZoGMAmn5U+ Eq5xWl1UQY8jXLPLvqU3/iS1cv7IPvfzoKez/nYHIxibVNREG3R4iq/jDnKZZkuv vbmbmthnr1zVnDQmehWKd6qumeH+Hg== =GJ7z -----END PGP SIGNATURE----- --s5/bjXLgkIwAv6Hi--