Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1275824imu; Wed, 28 Nov 2018 07:14:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/XfKxh41FpWm7Zx57o057hkrM7vWpYSG1HfOpYNm7gtKs9W0GAoLBCs/wFo3vJKcveWq0BF X-Received: by 2002:a63:31d0:: with SMTP id x199mr33332478pgx.10.1543418058939; Wed, 28 Nov 2018 07:14:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543418058; cv=none; d=google.com; s=arc-20160816; b=TClZ3wnkWevVDEzfjlwGYjAl9m8DcUmNABuvK16Z8MA3ZGeoZD3kXLKklhRoNsgmvo 24V1YisNdth5HW4rs+0ox5GymgG10IvNT3JUWPQPW3IdwyrBbt4SXC2D5EJGhpGvnHoV PCW8O204r/3JgZLjs+MPMLcFYe5zCEG2VQudDo7eINlfuBzJqk4WXx5kcid/HwqM/CoN U7dfq0NROXWUfRkX5c6uaVo2XzflweW0BAtKEskHmnmkm4lDW4eoud8DmaMoYWdtMf0T BoLF/iFYCOy3up9C9AdkrOOTVbSXoOHuPu4AVkwQAt9aY0me7gwLZBgCujpZC/NAQd5a wXZw== 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=Jk/SmAlz9AxXf9x/KXgCDUz5+Vbc4bIMlLpaDTaZQzY=; b=NwQWHwQDSl+3sUX4DGtlEk90kelXYf/xJVZl/vOfEacD02DXDpjcb6XfPJX/Zqy9/R VvVNnF6+2eZSmRJup3fZnfqoqmQGxLGCwenRF097TdMI7fbQm1zr0lcmKh8DlIj8s0rp BrqMFL/OqvwfM8bofvareSN4msxWiCvWUblthy28U/J9nW27CgkxPZ0445G0Ae1sHPzq 5pH6aRvVCaGR/KSDCRbCPrgq0DN0C4TmGng07LAt6jEZnWwCv7phYbpoCRxeB3GQ7yFF Rmz5mm9WmDoDuMp103amMWORh58IJY+4JwovO4Gy0FM6SJwX7PywTh0VNMilalrqPNWO oPDA== 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 b11si7996332pfo.240.2018.11.28.07.13.53; Wed, 28 Nov 2018 07:14:18 -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 S1728669AbeK2CNK (ORCPT + 99 others); Wed, 28 Nov 2018 21:13:10 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:2290 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727726AbeK2CNJ (ORCPT ); Wed, 28 Nov 2018 21:13:09 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wASF5Ig8007301; Wed, 28 Nov 2018 09:11:06 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 2ny4x6704m-1; Wed, 28 Nov 2018 09:11:06 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id D1F17611E12A; Wed, 28 Nov 2018 09:11:05 -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:11:05 +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 wASFB5BG023330; Wed, 28 Nov 2018 15:11:05 GMT Date: Wed, 28 Nov 2018 15:11:05 +0000 From: Charles Keepax To: Linus Walleij CC: Liam Girdwood , Mark Brown , , Bartosz Golaszewski Subject: Re: [PATCH 07/10] regulator: da9211: Let core handle GPIO descriptors Message-ID: <20181128151105.GS16508@imbe.wolfsonmicro.main> References: <20181128104350.31902-1-linus.walleij@linaro.org> <20181128104350.31902-8-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181128104350.31902-8-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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=979 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280133 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:47AM +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. > > This patch requires "gpio: Export gpiod_get_from_of_node()" > to be applied first. > > Fixes: 11da04af0d3b ("regulator: da9211: Pass descriptors instead of GPIO numbers") > Signed-off-by: Linus Walleij > --- > drivers/regulator/da9211-regulator.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c > index 8f68c7a05d27..bfdead356526 100644 > --- a/drivers/regulator/da9211-regulator.c > +++ b/drivers/regulator/da9211-regulator.c > @@ -293,8 +293,8 @@ static struct da9211_pdata *da9211_parse_regulators_dt( > > pdata->init_data[n] = da9211_matches[i].init_data; > pdata->reg_node[n] = da9211_matches[i].of_node; > - pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev, > - da9211_matches[i].of_node, > + pdata->gpiod_ren[n] = > + gpiod_get_from_of_node(da9211_matches[i].of_node, This driver has a lot of error paths that will leak the GPIO with this change. Thanks, Charles > "enable", > 0, > GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, > -- > 2.19.1