Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3291459imm; Tue, 29 May 2018 04:49:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpnSS+Fap4lYinC0Lgsxg7B/TSDPPnKiTvWwZcJVvM44aFsoeauJnSgKXbDBbNtNGmOysFq X-Received: by 2002:a65:6250:: with SMTP id q16-v6mr13744639pgv.113.1527594573955; Tue, 29 May 2018 04:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527594573; cv=none; d=google.com; s=arc-20160816; b=U9xHYzv2q1fir+f/YyPQQiKomdITG0HcYfjHPQLUotQuN1rbLJxu5bC3DG3Zwib3Al LmrbmOD7D1C/BJ6rLJEznlFj3JlcJPUmDIagwSv9AkgaTb3DvMxH1xrbLbhWkbULxrNe EJcDDC8wPjiw+LZYDKkRuNVcArDnlSPxTdxYifXshkKvR5DCiU7b2ehj+5zbR5e9MYaY CCowh2rOZKa95yAxd2Hzp98aOaPabPS86OVwLz4Aufiwzfc2Es3dtamMz//mvN5mRMXy 1g/sjSgjUGql2hppqCvHd0CuW24i2VwFVPJkx6jPTCCnPOVdRb7q8bSD6I67B0TOlcWI zKMA== 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:arc-authentication-results; bh=GhnddPXo3DyNlMksDFuIQLT4DAtCI964exUn2KEtDl8=; b=Wb4yaZLb8gFqHlyiOd2T9kOvwpYUa4TojToyDt5tnF0QlV+af2nIzGl8JCQSpZm21v GaqaYhtP4KgwQazaD13vDi/d0FT3FDld5JjWSNcEOxqtl+wJNY4Wb+sNoTv/Jls1tOOK A9nGMYiCMvAXi4mFZjyq+XBYnuSTl0WwEZEu07splWTExEdigdt5q1BHgxK0r3Sq6wyn /eLthwSgiG1/ioMQCYKR0uQ3zSQNIoYxb1AN/Hlkt00JH2esL3yDMX/YvjMBUgBVco0H ohtZMrskjQ/HWAlYt8GJoewu+yzJRIx3b5iDSq19PxWL9upho7AHm3uBxRweLfDWPzPu FfWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=on8F9yEp; 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 i73-v6si3007660pfd.117.2018.05.29.04.49.19; Tue, 29 May 2018 04:49:33 -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=on8F9yEp; 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 S933376AbeE2Lrs (ORCPT + 99 others); Tue, 29 May 2018 07:47:48 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:58430 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933288AbeE2Lrp (ORCPT ); Tue, 29 May 2018 07:47:45 -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=GhnddPXo3DyNlMksDFuIQLT4DAtCI964exUn2KEtDl8=; b=on8F9yEpTvmwn3FsZwPIEU+Ci dvl52TLEIzyotujszT0vxHBqQhU+UQIMA7lsi+D1Rqthy3eYbIkPszC8BPgwYVW/YaKJk8WOLtI9s rr3qkiQWa5U6yWvVjbRr3X1cjl/3WPeajGEph7k952h8xIIfORVn7cucG8wVK28aIRmgo=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fNd6L-0005Ud-1r; Tue, 29 May 2018 11:47:41 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fNd6K-0008SN-It; Tue, 29 May 2018 12:47:40 +0100 Date: Tue, 29 May 2018 12:47:40 +0100 From: Mark Brown To: Matti Vaittinen Cc: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, lee.jones@linaro.org, lgirdwood@gmail.com, mazziesaccount@gmail.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, heikki.haikola@fi.rohmeurope.com Subject: Re: [PATCH v3 6/6] regulator: bd71837: BD71837 PMIC regulator driver Message-ID: <20180529114740.GG23509@sirena.org.uk> References: <68b0cf2c7ab5578eef2f71a33315bc8ab9a68a39.1527587295.git.matti.vaittinen@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="64j1qyTOoGvYcHb1" Content-Disposition: inline In-Reply-To: <68b0cf2c7ab5578eef2f71a33315bc8ab9a68a39.1527587295.git.matti.vaittinen@fi.rohmeurope.com> X-Cookie: Variables don't User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --64j1qyTOoGvYcHb1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 29, 2018 at 01:02:15PM +0300, Matti Vaittinen wrote: > @@ -0,0 +1,677 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* Copyright (C) 2018 ROHM Semiconductors */ > +/* > + * bd71837-regulator.c ROHM BD71837MWV regulator driver > + */ The SPDX header (and the rest of the block) need to be C++ comments. > +static int bd71837_regulator_set_regmap(struct regulator_dev *rdev, int set) > +{ > + int ret = -EINVAL; > + struct bd71837_pmic *pmic = rdev->reg_data; > + > + /* According to the data sheet we must not change regulator voltage > + * when it is enabled. Thus we need to check if regulator is enabled > + * before changing the voltage. This mutex is used to avoid race where > + * we might enable regulator after it's state has been checked but > + * before the voltage is changed > + */ > + mutex_lock(&pmic->mtx); > + if (!set) > + ret = regulator_disable_regmap(rdev); > + else > + ret = regulator_enable_regmap(rdev); > + mutex_unlock(&pmic->mtx); > + This still has the weird locking/wrapper thing going on. The regulator core will ensure that only one operation is called on a given regulator at once. > +static const struct regulator_desc bd71837_regulators[] = { > + { > + .name = "buck1", The indentation style here is weird, please follow CodingStyle. Looks like the second level is just indented by a space for some reason, and there's similar problems elsewhere. --64j1qyTOoGvYcHb1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlsNPdsACgkQJNaLcl1U h9DIMwf9Gko/cLaIOR7E6jd5feuDxB3vTjXfFNZPaTspdh0DO16BEpXHpqfVKEfU J8h+FlYeXeaiGA6PGN8hqVSR/VV4duOTRzstjYYeTNpBeYTDeL8KBP2JyqTd5rcO r+Wup8DMwGXZi7DbPcCYWef3KBe01tRvijThMkouhfu+6SUpc8jgaeNAQlcAw4O/ cbNIseTZs82gJAeAp3QJq4qvPNn7LpUjrZh85A0Xp9lVi0h4H/x60LDVPB+EmsII gzwDVmIopWv2U+75lkYXSVA0q+fYgzUpT6Cv5eaa19xL1E5KDquvp6CqTNwrjbhX s/D6TS6ufJyFzVUuAp59DT2LhrZXwQ== =Zutn -----END PGP SIGNATURE----- --64j1qyTOoGvYcHb1--