Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1289447imu; Wed, 28 Nov 2018 07:26:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vz2CW5rO/MQaQ5nHvRgYzLNweqyN0t4jYWDQvma6AaOuY5zkf+ITtpGXOV7WayEAGMEgo1 X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr14784824pll.63.1543418783979; Wed, 28 Nov 2018 07:26:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543418783; cv=none; d=google.com; s=arc-20160816; b=f9QifFYFUQlvFhT9knqCKT62LeKRxU+nlM+DrUenXXgNTr5kbKljTRdBzfaVKICpfG PLiZmIMgSgNNXNcvEQn3JPeF8GAgv3/GlivRi5upK4OJKshVZqRSBFlpiWEEO7Ddbygt a4D9xTSOD9MAr/sb3X2Q5/Smyk8VHarRBQ1ivW9S4GvRMIrfPKlT5ef++1W3tMhxRRuW K//J5nbsU4oWhOM8MwQzZGI7R1ukET+/DGSwNn+6JiwyRgZb9grhWGd8aQVIH3KC/ew4 mpB+SI/dA9VomswxJBvUGWTV4SjMoiyS5Rjh4ycyTUAN4PNw16aEcs39nZ+W3UZMDd8g Cy7g== 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; bh=9YJTRbGyegpQECvI7xUyqFgeq36PkLr2SK/kr9l5mwM=; b=OiABpnjaz4UcAcid8yh0JIONlR9eLF8isZgSV3S3oyT10J32N8VONML+xoTEYH7/w3 wvALHxfHyr9ALUT0qv5h8SVpPTXwVER8XLtO8JaLNq+RUrSuokGfx4KnLQadR9QyzmOc ocFwtK0u4LkbVhIg/q21Vle+DalEm4NYVRBBKU2gaTWd25X4yMKsYKpNlPV4GHYQg5qg vppV9s3gjbqW+fk6Jtw9u4FnFddbqiOGWpif34g7CdqB9Elp5O8elFsWZ9kgbGyqE1Ea paUljPLvMCvwgNgqlAnuaX/JQCSNvLKx+ZrN/Zq9/5hAzmeYDtqUyNWE57cn5b8RuWjR XK2A== ARC-Authentication-Results: i=1; mx.google.com; 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=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si7811526plr.311.2018.11.28.07.25.57; Wed, 28 Nov 2018 07:26:23 -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; 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=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728914AbeK2C0c (ORCPT + 99 others); Wed, 28 Nov 2018 21:26:32 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:52250 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728163AbeK2C0b (ORCPT ); Wed, 28 Nov 2018 21:26:31 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wASFJKqK002038; Wed, 28 Nov 2018 09:24:24 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail4.cirrus.com ([87.246.98.35]) by mx0b-001ae601.pphosted.com with ESMTP id 2ny3xu6pkq-1; Wed, 28 Nov 2018 09:24:24 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail4.cirrus.com (Postfix) with ESMTP id 77153611CE60; Wed, 28 Nov 2018 09:27:54 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Wed, 28 Nov 2018 15:24:23 +0000 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id wASFONsX030051; Wed, 28 Nov 2018 15:24:23 GMT Date: Wed, 28 Nov 2018 15:24:23 +0000 From: Charles Keepax To: Linus Walleij CC: Liam Girdwood , Mark Brown , , Bartosz Golaszewski Subject: Re: [PATCH 08/10] regulator: max77686: Let core handle GPIO descriptor Message-ID: <20181128152423.GW16508@imbe.wolfsonmicro.main> References: <20181128104350.31902-1-linus.walleij@linaro.org> <20181128104350.31902-9-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181128104350.31902-9-linus.walleij@linaro.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280135 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 11:43:48AM +0100, Linus Walleij wrote: > Use the gpiod_get_from_of_node() rather than the devm_* > version so that the regulator core can handle the lifecycle > of these descriptors. > > Fixes: 96392c3d8ca4 ("regulator: max77686: Pass descriptor instead of GPIO number") > Signed-off-by: Linus Walleij > --- > drivers/regulator/max77686-regulator.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/regulator/max77686-regulator.c b/drivers/regulator/max77686-regulator.c > index f5cee1775905..236cd42002f0 100644 > --- a/drivers/regulator/max77686-regulator.c > +++ b/drivers/regulator/max77686-regulator.c > @@ -255,8 +255,7 @@ static int max77686_of_parse_cb(struct device_node *np, > case MAX77686_BUCK8: > case MAX77686_BUCK9: > case MAX77686_LDO20 ... MAX77686_LDO22: > - config->ena_gpiod = devm_gpiod_get_from_of_node(max77686->dev, > - 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. Thanks, Charles