Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3158982imm; Fri, 25 May 2018 00:23:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGzgMcvm7oF/x3fgltM5ojy5ey5XFskvoGk0ixBoOB2WssBM6RMu758Rxog+mS4Rff0fPa X-Received: by 2002:a17:902:6687:: with SMTP id e7-v6mr1453520plk.242.1527233005547; Fri, 25 May 2018 00:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527233005; cv=none; d=google.com; s=arc-20160816; b=gf3sE0q7qYxGJ+5HUnB4iNBFOQ4BiJ26VmXZceRA1quPu5FDoJPJ8cZ7wXI5uBxh2g NV5880UaFneJ3lRypvfKUnG4BBMw/i+r9AgnfiuiGLPyp1DqFretcVOigtK6UQ9USU5M jVdryJNxzxpFziWw4LV+TTA5a80t5em16CGmnT9PCab8kdevisdRy6NV5NCipRgazI+i XRllXIL5w/v0t9jm9pf4e8a2ueZZf694RKpuBI9Y2/31xNAIN/+ibojAKggrudFr25b9 sfAtS3EuTaG9oLO8k/2FYyOXJiTaDwmLkxLD4iHCpI8Zu66kN+EZLDCGcSbR7Ejv3Vgl sGZg== 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=efkcQ2IgHZ7PQZ8G8Txu5mhlHjga8VY4Cfm09+mFiX8=; b=Yb17wZUilZOeNvrI+zBxN7toBEgQ/ZmjrvfZsezcyluR6hVEeHL1eCQZ2HbX29ojKs JtYbnhZdY1sjjPC2SO8jzlwxPLHe9NbEW6V9izd+XNn3Pv2MnseMTMrPQ354fh9foKeq rqtZ59KbDKAvJXhMX3KBXk42733YmhiOg2FuPvvDufijCq9ESLfBU0UNe6XELxoWc4WT PCpeG7n/uzQlBlRwdlUvZgqNFR3TvRJiEX/nwTwaCOZzYK0Q57bg3NJ3835Wloa+eT9f SmcooodolGgGSXfV2h0efDyIJBkog9mOunQUMtPyITirZstpI7W6SEnr2YehyCydQlGw KYqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WWKKnFID; 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 s66-v6si442776pgc.142.2018.05.25.00.23.10; Fri, 25 May 2018 00:23:25 -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=WWKKnFID; 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 S935853AbeEYHXA (ORCPT + 99 others); Fri, 25 May 2018 03:23:00 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34267 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935134AbeEYHW5 (ORCPT ); Fri, 25 May 2018 03:22:57 -0400 Received: by mail-wr0-f194.google.com with SMTP id j1-v6so7395384wrm.1; Fri, 25 May 2018 00:22:57 -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=efkcQ2IgHZ7PQZ8G8Txu5mhlHjga8VY4Cfm09+mFiX8=; b=WWKKnFIDMexH1h4XL6qHAUX6HnOt6Kobo0qs6x12U+wpVScD3Yu7HI7Bn5kwRPEiAa 7W246x+FgWBwvkoyTjR3bCwEBKi+lVpsVA/hKmkJu4ErfCWkn1vkTemf1uUPwnuJFE0P 4kN1nVuzrXUP57TWq49caMcL33C82OFPfSOoqCmlS3COMNE4iu3Nq5tpTRnjm4WUP378 44EFGoqbd2vlC0ycBHNjgmxpYd37U2yeQBEPN9k773EQ6eDfHcxt4u0cm99wyb8al1mE WIuAc/ikNEDoZU2EVCSf2wQhKc4pfeCA52mWC2Q1+QaWtMjGgx/UZTWTx6v2+KklpyZ1 gDLg== 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=efkcQ2IgHZ7PQZ8G8Txu5mhlHjga8VY4Cfm09+mFiX8=; b=gtid6E3W5/uGNcQJwdpSLtTBc2l1SQJ1H6JEvCzRU78SmBoPfhbgJfmvzcuqwX+Xvq ivcvy/DDBHy6os482YZx/1JX0hmuK5a0oZeQj06Kpk4ZXqVkXQkzgxc8AfMDTKNZGk/Z /6gu12TVmXEo+ffeoFwbkb+Q9QCXakcvY0x3jbKC2zJqR503LgiUN1+y55ShAwYwbI08 a666Kite7gB/o8/abATysT8RjklsqqJnZK2xHlGqIzCkQQigwpljQF8FQJseeIkfu2Qv DVRgAUCDOGM2qoujcJlsMemghUQGalM0a6+O4bctgKmD5pT54oLHLJqe+ioRYcZnspiP hdlw== X-Gm-Message-State: ALKqPweFaT2nTSypnjLKYyD2szm8/EmEzEH7KG1m6Q19oi4jeLjBaypC gZA3/zSuCR0MTBZ9Lc5mM0g= X-Received: by 2002:a19:f03:: with SMTP id e3-v6mr469802lfi.145.1527232976405; Fri, 25 May 2018 00:22:56 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.34]) by smtp.gmail.com with ESMTPSA id 17-v6sm4235118ljr.17.2018.05.25.00.22.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 00:22:55 -0700 (PDT) From: Matti Vaittinen X-Google-Original-From: Matti Vaittinen Date: Fri, 25 May 2018 10:22:53 +0300 To: "Vaittinen, Matti" , Mark Brown 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" , "Mutanen, Mikko" , "Haikola, Heikki" Subject: Re: [PATCH 8/9] regulator: bd71837: BD71837 PMIC regulator driver Message-ID: <20180525072253.GC16888@localhost.localdomain> References: <20180524060036.GI4249@localhost.localdomain> <20180524141427.GU4828@sirena.org.uk> <042F8805D2046347BB8420BEAE397A4016C06B60@WILL-MAIL002.REu.RohmEu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <042F8805D2046347BB8420BEAE397A4016C06B60@WILL-MAIL002.REu.RohmEu.com> 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 Thu, May 24, 2018 at 05:51:27PM +0000, Vaittinen, Matti wrote: > > From: Mark Brown [broonie@kernel.org] > > Sent: Thursday, May 24, 2018 5:14 PM > > On Thu, May 24, 2018 at 09:00:36AM +0300, Matti Vaittinen wrote: > > > + rdev = regulator_register(desc, &config); > > > + if (IS_ERR(rdev)) { > > > > 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? Best Regards Matti Vaittinen