Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10447824imu; Thu, 6 Dec 2018 01:00:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/X207oE5oWqkg0i9OltD3s3uQ9ScI6De3rIIGplNuNDvJ4VJUMLyPjMpIeRHgzMgXzhsFlk X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr28003610pls.281.1544086815861; Thu, 06 Dec 2018 01:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544086815; cv=none; d=google.com; s=arc-20160816; b=o6BAnOX1B/YAwlws6GgJmoCEzoPC11SYHoyraLHuKTImlwB94LFzgb0tqou5VOn9Hm Cvx69GiA9MzkY5y0ockipLY6KY38pVi2PINuv9ohGl3Ubdfff69SfX5Au43uTcbx1DTL fcbSa2enz6+Wb/28FBhr23SlFpi7/NqCD8VeSyLTbHFHLPszxwKDf+/k6YoNs48ONH+H 4dof49b+s2mgsUiKG/lppiKQsd8Y3nZqRTxwud/TKm7GxKxD6bWUz6lNYbgPVyH3dLq3 8n+341xPqaYT9Iys7VpG4mKrWQhyt4alADsX3seCsGv4BMlAb7QqQ4OctXYSkHywMlkr mHXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yuv/GqEQjpt+FmCZ1hHtpaatnZ/UFWJoiI69v2HIxdY=; b=q23f3U+wemYf+MGNGEvq12nVJs53jvkzizT02a3qFso4qAzi0MA/isPiL055bsc4Jw zpTlpK9e2Fvj9nOoqfOYJ6XEhrhPe7ooIJMtsEz57Fr5k8x5BDvxS/vqX6fCW0Dy/kQV J/T3Ku0IyRT+F2Zv/Ztsn+Kd0qaGVjH2gtBcU02xQTZmVzxoOHO/P6J5y0vN21Phu9Yq TzCl+ImtpqYU/1+YX8MclQYkkyMr/YcPrWY/ldbTuAqx1jP1fPDGcW8TwIPm8h4NBkEt hvro8p9k7VV/jJBaC0tCXOAeeI3Ajm2xio5XRtKUNJi4e1PHLnO9ozfSDCAO538OawjF gp6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kNLTg4Ed; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u129si22063583pfu.117.2018.12.06.00.59.59; Thu, 06 Dec 2018 01:00:15 -0800 (PST) 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=@linaro.org header.s=google header.b=kNLTg4Ed; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728482AbeLFI6o (ORCPT + 99 others); Thu, 6 Dec 2018 03:58:44 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40736 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbeLFI6o (ORCPT ); Thu, 6 Dec 2018 03:58:44 -0500 Received: by mail-lj1-f194.google.com with SMTP id n18-v6so20963510lji.7 for ; Thu, 06 Dec 2018 00:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yuv/GqEQjpt+FmCZ1hHtpaatnZ/UFWJoiI69v2HIxdY=; b=kNLTg4EdTzQhAwxeMsoOmzlBE/Iu1l05HXj0ZY4F1JWoBgcS/v/8SZ3aR9/fCowCzY bhswiKUN7lYUHLKWvwxmQPDyjE/r0szzH+2g0pjRQh9rpQcEVzeb8a0BNPG6e2adFoVE CuRpw2h8JysXmE0ElVlML1UWGNGYs6/KkK2Wc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yuv/GqEQjpt+FmCZ1hHtpaatnZ/UFWJoiI69v2HIxdY=; b=Lec0LByEzlSpyJU2kWSvsJwn/htBE669SsA90TaXsOQnMZ4hT2VhMoy4w6rQ8yGNnA fi0Fc5Kmn5RxGLeCN+KudUoFdHeWs9jGCmUT9TviLxye+MBEr+uENyzYyeEIYyWRx1me wIXu38luYoeQbrf9hnE4xcSP1LGaIxRwU9S53t747K2Z5YmhPJe1fvQDvttxzvAgos3V +dl5Hp1XFoNZi+a+W+nj7anm60r50N5WhEahRWBVZYAR/18jMttZu5BzHdRfYzSXWJPP 39+CUDF4jbthmcz6OcwrbwnnTgXHg8HFCRv27HmleALbTl+nreH1OVQkec35X47GUB1C BKDA== X-Gm-Message-State: AA+aEWZL9wtXiokjRdg7JnCBmW2SokW7PjX7coF7y0KyXMIvkP+LtGC0 dO8TUjjwZxDMMOV3Qv/o78Vom+6La8XDjGOTALXo/g== X-Received: by 2002:a2e:9e03:: with SMTP id e3-v6mr17961982ljk.4.1544086722335; Thu, 06 Dec 2018 00:58:42 -0800 (PST) MIME-Version: 1.0 References: <20181205124721.26624-1-linus.walleij@linaro.org> <20181205124721.26624-7-linus.walleij@linaro.org> <20181205134345.GF16508@imbe.wolfsonmicro.main> <20181205153331.GG16508@imbe.wolfsonmicro.main> In-Reply-To: <20181205153331.GG16508@imbe.wolfsonmicro.main> From: Linus Walleij Date: Thu, 6 Dec 2018 09:58:30 +0100 Message-ID: Subject: Re: [PATCH 06/15 v3] regulator: max8973: Let core handle GPIO descriptor To: Charles Keepax Cc: Liam Girdwood , Mark Brown , "linux-kernel@vger.kernel.org" , Bartosz Golaszewski , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 5, 2018 at 4:33 PM Charles Keepax wrote: > On Wed, Dec 05, 2018 at 03:42:06PM +0100, Linus Walleij wrote: > > On Wed, Dec 5, 2018 at 2:43 PM Charles Keepax > > wrote: > > > On Wed, Dec 05, 2018 at 01:47:12PM +0100, Linus Walleij wrote: > > > > @@ -775,10 +779,13 @@ static int max8973_probe(struct i2c_client *client, > > > > /* > > > > * We do not let the core switch this regulator on/off, > > > > * we just leave it on. > > > > + * > > > > + * Do not use devm* here: the regulator core takes over the > > > > + * lifecycle management of the GPIO descriptor. > > > > */ > > > > - gpiod = devm_gpiod_get_optional(&client->dev, > > > > - "maxim,enable", > > > > - GPIOD_OUT_HIGH); > > > > + gpiod = gpiod_get_optional(&client->dev, > > > > + "maxim,enable", > > > > + GPIOD_OUT_HIGH); > > > > > > My comment on v2 still stands here, the GPIO is not passed to > > > the regulator core on this path. > > > > Patch 01 should take care of that, did you check it? > > Yeah, patch 1 makes the regulator core consistently handle GPIOs > that are passed into it. Sorry. I confused this patch for the max77686 patch. That one was fixed with patch 01... > However, on the MAX77621 path in this > switch statement the GPIO is never passed into the regulator > core, so the core never takes ownership of it, so the driver still > needs to manage the lifetime. > > It should be a pretty easy fix though as commented on v2, again > apologies for the slow review. OK I switch it to devm_ as you suggested, as we implemented gpiod_unhinge it's a piece of cake nowadays. Thanks a lot! Linus Walleij