Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932670AbcDSPlJ (ORCPT ); Tue, 19 Apr 2016 11:41:09 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:54568 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754845AbcDSPlH (ORCPT ); Tue, 19 Apr 2016 11:41:07 -0400 Date: Tue, 19 Apr 2016 16:40:59 +0100 From: Mark Brown To: Jon Hunter Cc: Thierry Reding , Liam Girdwood , linux-kernel@vger.kernel.org Message-ID: <20160419154059.GW3217@sirena.org.uk> References: <1460038959-21592-1-git-send-email-thierry.reding@gmail.com> <20160411140300.GH3351@sirena.org.uk> <20160411141101.GB27400@ulmo.ba.sec> <20160411141621.GI3351@sirena.org.uk> <5716059B.3080503@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1MV0VfA6Y2yiVCnw" Content-Disposition: inline In-Reply-To: <5716059B.3080503@nvidia.com> X-Cookie: Tomorrow, you can be anywhere. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/5] regulator: core: Resolve supply earlier X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 43 --1MV0VfA6Y2yiVCnw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 19, 2016 at 11:16:59AM +0100, Jon Hunter wrote: > So the following seems to work, but only item I am uncertain about > is if it is ok to move the mutex_lock to after the > machine_set_constraints()? We definitely don't need the list to apply constraints to a single regulator. > + mutex_lock(®ulator_list_mutex); > + > ret =3D device_register(&rdev->dev); > if (ret !=3D 0) { > put_device(&rdev->dev); > + mutex_unlock(®ulator_list_mutex); > goto wash; > } This is *really* weird. Why would we need the list lock to do a device_register()? =20 --1MV0VfA6Y2yiVCnw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXFlGKAAoJECTWi3JdVIfQRg4H/3uaPTU/jDxArYwS/ZJIAm0Y Br8DCxLuuqE6Xh7EUCAxTOYAeVA4FqeBiwp621UjdSGmOZR9grvQMr4IAiV+8sUA 6vJknaYYURqJRXExFR1WDjLuQUntUCGlGpuxfY0lRY4M3u/5ka7mj7OYlGPMPbc6 3E9zQU5/S+SDGkrLXf5iDyDpt9uWdV1etnDKnw2dXaYIflOuYm2mVlH1zjR+dpw9 BucOfNVaUyDm8tRsrvCJQdf7Fwzv21tAzGS17gPhrTQJUcIoPokq/z0vKRxg3Wr+ s6da5MAKas0hPr1Z6O1BiHVxLjHFTOGDQey0dO+Ln3boBxhMFWQK0oAQOEeP2L0= =dZYa -----END PGP SIGNATURE----- --1MV0VfA6Y2yiVCnw--