Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3295597imm; Fri, 25 May 2018 03:16:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoiJsFDIn8cSijgcClknCqj+M6dFzclYvUj03fVpUiIGdImu91Q+RjgOErZNNx/K/tZsDuC X-Received: by 2002:a63:a807:: with SMTP id o7-v6mr1458292pgf.83.1527243375146; Fri, 25 May 2018 03:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527243375; cv=none; d=google.com; s=arc-20160816; b=EOSQSTh9od7tFfmwtCblEmiORt7LYRYsC1DUbHwXhfuuo6XMoe00BODc8Unjydoj5s 8gMsKGOxRUQIXKa95fb0yGKf5wdtln0hyrEQaOWipbUjvYQonTX7e+N1enJ4bZ6qVHNm RXpBXyJr7o6pTg1h6n+jGTav6pDPL32SIkgvEsEGSNn0Ye+PIz5qxG3QAYsxyB9277Q4 q86XvX+MMh70lWJIdj/7AEXAw+ASPtMkieLlyAlJagevwIhCAP8xCs6BCaNKc5zLiJdU u/K5ppsmLqECYwGR233CYHL1K8hEC/MuBgFO3jjvhQKtng20heqRh9+lpicu0nYu4Y0N dgBg== 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=4qHWiMtVTn769CakyAnRgAyHVvpTa+mB76ZiH86QOcI=; b=MCKAzEfPIyoxUwDxyZD7UjBLtOAclOCWPAQc279nSy37Rgpsho1uQWy4EopwdHxAtH ZYUXqxzObDE9LxyJcxB15lLgceUAARUsaevBqfgsn9CqsNjy3TsLzI5BxtkwWxULvg+6 dUDQ2CKJV7BIDHcKHjn9Q1y1KmAXDT6BxtEaArYlR9g0gP3nxRrZpYwG2LVLtEfIWzmE nNJnK2DIrv8/lKtWwrCXdfwPvivu6VHrZlS/ajYsGHliHhyv40ymg6iD65dZ9V+EbcbU rRnTQtLYzjzNXtQSC0Vluq5uZ5bGeJndUTY5oI36kEObLCw+cp2OPnFDpsxRHgxz6kzP Ti/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=sMW0szWq; 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 m3-v6si18145714pgc.229.2018.05.25.03.16.00; Fri, 25 May 2018 03:16:15 -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=sMW0szWq; 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 S936115AbeEYKOb (ORCPT + 99 others); Fri, 25 May 2018 06:14:31 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:42372 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935638AbeEYKO2 (ORCPT ); Fri, 25 May 2018 06:14:28 -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=4qHWiMtVTn769CakyAnRgAyHVvpTa+mB76ZiH86QOcI=; b=sMW0szWqtO3fleBYjiJ2bNAGV D6JHx/ulkArVuqsoa8aSvvpAQdtPsEpNhQEgUVDVM6zaHhasXjMLvrSTepgDsDtIChY0RwKaAGHIX epCDJ3Ms/Ab2pZZd60dCXlJ7cF/RJAR3ZyL7P83P2bUryG2dnVv0a7W/UdyWa6sKSdD5A=; 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 1fM9js-0007RK-NG; Fri, 25 May 2018 10:14:24 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fM9jr-0003OS-PH; Fri, 25 May 2018 11:14:23 +0100 Date: Fri, 25 May 2018 11:14:23 +0100 From: Mark Brown To: Matti Vaittinen Cc: "Vaittinen, Matti" , "mturquette@baylibre.com" , "sboyd@kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "lee.jones@linaro.org" , "lgirdwood@gmail.com" , "linux-clk@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Mutanen, Mikko" , "Haikola, Heikki" Subject: Re: [PATCH 8/9] regulator: bd71837: BD71837 PMIC regulator driver Message-ID: <20180525101423.GH4828@sirena.org.uk> References: <20180524060036.GI4249@localhost.localdomain> <20180524141427.GU4828@sirena.org.uk> <042F8805D2046347BB8420BEAE397A4016C06B60@WILL-MAIL002.REu.RohmEu.com> <20180525072253.GC16888@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5joxkA65nhhP20dL" Content-Disposition: inline In-Reply-To: <20180525072253.GC16888@localhost.localdomain> X-Cookie: Excellent day to have a rotten day. 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 --5joxkA65nhhP20dL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 25, 2018 at 10:22:53AM +0300, Matti Vaittinen wrote: > On Thu, May 24, 2018 at 05:51:27PM +0000, Vaittinen, Matti wrote: > > > devm_regulator_regster() > > Makes sense. Thanks > I was going to do=20 > - pmic =3D kzalloc(sizeof(struct bd71837_pmic), GFP_KERNEL); > + pmic =3D devm_kzalloc(&pdev->dev, sizeof(struct bd71837_pmic), > + GFP_KERNEL); > and > - rdev =3D regulator_register(desc, &config); > + rdev =3D devm_regulator_register(&pdev->dev, desc, &confi= g); >=20 > but is there now a race regarding freeing the pmic structure and > unregistering the regulator? Why? devm_ stuff gets unwound in the opposite order to the order in which it was allocated. --5joxkA65nhhP20dL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlsH4f8ACgkQJNaLcl1U h9DKDQf4uSA3vgrIWIUP402K0U92AnqIGE1tuwBS18LG8nCPC8ZFZ1eCX6TiGT4Y EZazDly8jgR+PHzV7EqWpfw9HwhYjrRbBzuAbC7JdtQQVRT1e71OPiE8DIS8j9Il 3T7/T3olewntmTbmYB74HC/lkR/eLm7b4n26JNVZQE0UuP1YV6RPi3gAHlFGmZov wEPbl4JhzJoDL3Wwjh0YzU66ZwwvgpvKsS6xBITDUn23npchiK5zJ3ue++ZeW4P9 UhudtTqJr7Z8m5LKoMnGFPYeo9m5TjOKBxoCmoQFvoCo7EykP1DXeITA4uXnex3L w/0IG0ArdpwwX/Wuq65wz7EcL4jn =OtVA -----END PGP SIGNATURE----- --5joxkA65nhhP20dL--