Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3503947imu; Fri, 30 Nov 2018 01:09:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ubn+rAtdpYv5OyYF/C3W9WbrGmsRWgnmdPfE76GEW7nIs6XkoJVwo95hucBcMA8jRpNeCk X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr4947891plb.244.1543568999814; Fri, 30 Nov 2018 01:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543568999; cv=none; d=google.com; s=arc-20160816; b=cZss6I4aJFOiA5GdMRB9QoZFYJCRMUZRj25M8NeF/Kf7FbzwS3OHUKm9gue4JZUWl9 LZpQnW6t9f6DNFb6Xa1K5CAsnx4WJ2WuJc16c6RlC9T8s1GwbJlfCwNx2VkSjiWHFQKx R8OuSJXW1C8ZggblOI3MVW+Npyi+rCK0iygL2ravOMO3HC6lW7FMB0k005fzLERc2+f6 OLtOi4k1Bm6NauwDYBoqA/re6c1ywvoQNSIxSfQexmLmNO+tTCeMmYE8jekWAbBWBLcw zLfWgPbIme/+bfkkI/XNTR41qzvgA3+6gMgSfhboC/HaVFcUschOeoOpz0hzkTZ7Zwo2 Q/UQ== 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=msbW71zcVZTDE/vM/KZLZouftnFVpG/GA8aRhA0bQCQ=; b=h7ZORieih9VcC5iO/1J5cl1NZtoi3OZGwqb9F3FcxNwMsS7mls95mAMl7yBCU9fs/6 QctHhQtfcasjw0C7hf85q1dAc2YXLHqIjWjx1ixBN3j5eAyg637qRHSsvmUTYogf55JI PtYqZBctUzF0kgzE/Pylb1qcW0GNO/hrKhsAuVVB6tO8EeWWQ+LHwg2FVlfgM4vN9PW2 kdxLZgr5mKxljktl3X1zoBfD5EqXSLhpiJUtXWsut00TslxnJFrEBUnO+2eHbfltz/A+ ftESvRyHdU5zY0rgbsy/nrkl5oBCzhxHRXsiwUl02Pd6VrCT2Z6Y7QJjfPL9RIioaaKD WGlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AeVdY0ON; 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 u3si4080826pgj.300.2018.11.30.01.09.45; Fri, 30 Nov 2018 01:09:59 -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=AeVdY0ON; 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 S1726989AbeK3UQe (ORCPT + 99 others); Fri, 30 Nov 2018 15:16:34 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45086 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbeK3UQe (ORCPT ); Fri, 30 Nov 2018 15:16:34 -0500 Received: by mail-lj1-f193.google.com with SMTP id s5-v6so4301445ljd.12 for ; Fri, 30 Nov 2018 01:07:55 -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=msbW71zcVZTDE/vM/KZLZouftnFVpG/GA8aRhA0bQCQ=; b=AeVdY0ONPdd72X3kE/xTImQJC/hRXjlVmYJWPlsNPPAn3jjKC2ONEt2O5BGdJYlAm4 zvDJBAQGWa2mSrKgUThj9vucB0VCZSj/90F/gObaMPSc19JFAsuW0PkRQymoOnt9OYWW HAgM40KYLMP7nJUgP44rtWxkPP9aGqdS7m844= 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=msbW71zcVZTDE/vM/KZLZouftnFVpG/GA8aRhA0bQCQ=; b=ATMfFWCYmlcVNI8CPvdzenFocFFg3oMz4yKN54QGNkPU80qQPiR6kiUaw9xpiUDUaN uvp+7aNrGNp1ymCbR4xVcez5s2QnNsNNxtoP6ExFg3+GWmMVyXMs/4aKYhhNa+BZj4u4 J1pQ1+5Hu0VO54GFc4zb15naU6QULrgQqJK4/1szeR7rYGIcfVTZ5RgN0sj+7BHdxvg8 r8USLD+NuOf3UQ3D4iYLCZ6vlnqeQ0oq/rQ6nioxt7j2Gdl240mIi2w8vaRbws3E4P4u Pym3wb8vWXxGmUA9VTEtR9PQNAS9hJqXyC5lnzuIfg2samr9GpwDvSNDatynFaZIE96K rScA== X-Gm-Message-State: AA+aEWZCmm33JHHlt5LalS9WuMTJ5QqfEIFwIeGHARmIeD3Esq97ho88 WjAJt1ybOrYnJmESIy2cndXLAo7fE1MMlpE2Qptwrg== X-Received: by 2002:a2e:710a:: with SMTP id m10-v6mr3321674ljc.66.1543568874635; Fri, 30 Nov 2018 01:07:54 -0800 (PST) MIME-Version: 1.0 References: <20181128104350.31902-1-linus.walleij@linaro.org> <20181128104350.31902-9-linus.walleij@linaro.org> <20181128152423.GW16508@imbe.wolfsonmicro.main> In-Reply-To: <20181128152423.GW16508@imbe.wolfsonmicro.main> From: Linus Walleij Date: Fri, 30 Nov 2018 10:07:42 +0100 Message-ID: Subject: Re: [PATCH 08/10] regulator: max77686: Let core handle GPIO descriptor To: Charles Keepax Cc: Liam Girdwood , Mark Brown , "linux-kernel@vger.kernel.org" , Bartosz Golaszewski 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, Nov 28, 2018 at 4:24 PM Charles Keepax wrote: > On Wed, Nov 28, 2018 at 11:43:48AM +0100, Linus Walleij wrote: > > @@ -255,8 +255,7 @@ static int max77686_of_parse_cb(struct device_node *np, (...) > > + config->ena_gpiod = gpiod_get_from_of_node(np, > > As this is inside the of_parse_cb, it probably needs some thought > on where the GPIO would need to be freed on which error paths, I > am not sure it is immediately obvious to me but I suspect it will > need to be freed in some cases. I looked it over and came up with a patch making sure that if the regulator_of_get_init_data() assigns config->ena_gpiod it gets freed unless handled over to the regulator core. Thanks for pointing this out, it was a tricky corner case! Yours, Linus Walleij