Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3363782imm; Fri, 25 May 2018 04:34:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpS77OWWxuFL5Eorxf8GMl//KutVWzI91WFLYW6QYsQ0UuYRVSxC6pl9nT/VGkfFzxrNXQC X-Received: by 2002:a65:49cb:: with SMTP id t11-v6mr1361949pgs.218.1527248073501; Fri, 25 May 2018 04:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527248073; cv=none; d=google.com; s=arc-20160816; b=Ebmmjo9pcPHE4FUm6WS45ELBLH4+jCbwrbtwhVefnBUT3niMzxXT0aCOBM2qI9m0LA GpKxEzNgBQYq3sp74FhjCBDR4Stu4GZB52oQ48QKPwnVnqXoO0rSMcLWoW3di6O+wq23 8hcqYuXQ5gjsd4JS2lFUYqOYBfc2TcghR1J0uGDTGElFFMsYXR1bqs4NsjCjVVIVrUAE hmA4sGof1mjdnekHZabJoPh4mU71Rtr1FcAs92q760Er42Z29Pcfag+KZq4ILdbMSJSa 0QtGDYZ+WqEts+EUE4gpLL+jJKPoSdNGhpgofmsKeIzkLSWEFQaczSS5HIbVBMWPNBiY e+Ug== 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:date:from:dkim-signature:arc-authentication-results; bh=x0ClQ86FRn2rDpTpDQMx0Ys23XZp572poqxsMO5nFJg=; b=su5Sf9oKWY9eQRG10eKMPwz3XSJMBSHlE45FCV4p/kBaAEltBMcSsacUIfvd9+5Veb ew753qBN0Wkd86KPgDKa6p/BTU1hxPLsPTYxGUMnDKrNR5IFbqXQHUjM2nIrCJvFLro/ 2SvTRUpZh3AClboI8EuW4gkXhgsDt5rhubR3zuJfgO1sjTyaIsy0bHx0snv5vLO0XlZ4 gxJ+h8n+s508eWSyNXnj8ZeyzESQMsaQ6P2qPAwAGpmIiNufuGeEuiqNuGLk3hkWuh7n Hmd/EWDVSzi1O0Vd3+q/krFx270+7KPv5qyjkwSUu6IcfyrIg/BG0SL2TzUp6x6/biBN 7xjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JBE9+X0+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si23499167plg.463.2018.05.25.04.34.18; Fri, 25 May 2018 04:34: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=pass header.i=@gmail.com header.s=20161025 header.b=JBE9+X0+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966454AbeEYLcr (ORCPT + 99 others); Fri, 25 May 2018 07:32:47 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34091 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965907AbeEYLcp (ORCPT ); Fri, 25 May 2018 07:32:45 -0400 Received: by mail-wm0-f66.google.com with SMTP id q4-v6so12906577wmq.1; Fri, 25 May 2018 04:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=x0ClQ86FRn2rDpTpDQMx0Ys23XZp572poqxsMO5nFJg=; b=JBE9+X0+VjCK2I4E/TIULNG1XkIw8VhyHZEP3ph3y9vFNDs3/nZ/2unvxeoc6K/BUI cB0z0e1iGbikrt4elWveZ3MWnJ63W5qmJkDADYcr/fHBLeZMWGmiQmng3li4vCMkuFgV pu4HKdfJjpzeyW8JFLBEc/m0fW9/ViljNc/81DAkKXUusqlscqMJn9yA06lDG/8Ba2hh 1VAUOEoa2ks+wE1SeYSBk23qMwqVltN0yap47QAXTWZiD4+mOPmkf0Q2BryCQKf20YND 8Jvv7twZoiCeljQXJxhPJ9ukGGwAgi4SK9Oxmvr9txr4c/Vk15EbA+eRIGtmueHi6Gop yHVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=x0ClQ86FRn2rDpTpDQMx0Ys23XZp572poqxsMO5nFJg=; b=p7eFsqGasD9HF2/9zIAv+y1ala+acWJMkofXkjxsetkEZeEJzWkZBNjlQem/EPmlTk G+wUB0LLXcT+X2NmhhqS3FzeSUSsHuTIIY20CQPheCa0id+0Tb2j24tZ5BYztje0mIp5 ESDfu/w0tq3TgU0trxpmHdnEbL/u2FZyITXU1awsRlmVzqJZGtddDSPtzGAE6pXVXwDR KXD1qCtiwPNfm3XB0My5JuxOZtlSuUcYJl3LgpMpm+LKJ3+VUAXHW9Yh2dvxgfTmwrKS qw5koX+pKK+77DgC8r6uNzrvQLAMxDxtEQw314LPGku5z/3okb+Pzn6R93gS9H8/kGWY +UYw== X-Gm-Message-State: ALKqPwfgJrZdvAOATsNiAq7tyM9YUkxXnGkP1KeRGueTVOylW7HntFtN gXq8k+0VuqgZ3wkX4oh5D9E= X-Received: by 2002:a2e:8456:: with SMTP id u22-v6mr1440208ljh.80.1527247964160; Fri, 25 May 2018 04:32:44 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.34]) by smtp.gmail.com with ESMTPSA id g20-v6sm752379lfh.84.2018.05.25.04.32.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 04:32:42 -0700 (PDT) From: Matti Vaittinen X-Google-Original-From: Matti Vaittinen Date: Fri, 25 May 2018 14:32:40 +0300 To: Mark Brown Cc: Matti Vaittinen , "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: <20180525113240.GE16888@localhost.localdomain> References: <20180524060036.GI4249@localhost.localdomain> <20180524141427.GU4828@sirena.org.uk> <042F8805D2046347BB8420BEAE397A4016C06B60@WILL-MAIL002.REu.RohmEu.com> <20180525072253.GC16888@localhost.localdomain> <20180525101423.GH4828@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180525101423.GH4828@sirena.org.uk> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 11:14:23AM +0100, Mark Brown wrote: > 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 > > > - pmic = kzalloc(sizeof(struct bd71837_pmic), GFP_KERNEL); > > + pmic = devm_kzalloc(&pdev->dev, sizeof(struct bd71837_pmic), > > + GFP_KERNEL); > > > and > > > - rdev = regulator_register(desc, &config); > > + rdev = devm_regulator_register(&pdev->dev, desc, &config); > > > > 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. Allright. Then there's no problems. I'll do the change.