Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1282197imu; Wed, 28 Nov 2018 07:19:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/WmPtDAPGir8NDBzlMN33+kJLYU4D7HXDYAU3Rpj5/2px/SlOl22PQONH8O7oZhVWwEVS+4 X-Received: by 2002:a63:5153:: with SMTP id r19mr33467708pgl.281.1543418382938; Wed, 28 Nov 2018 07:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543418382; cv=none; d=google.com; s=arc-20160816; b=nf5EcWOeFETAcP2P3YJ6d/bbbUtkCq8o174aYgxQt2gFZpWQ7+JcFb9tZk4e44JHup nntM2IrUU0PxERp7pucm/IT9G0L6jFdOW2P5NySNMVTDtdG6HOQl7SEDTjFro9UALgeA rn91yL6CxkM2H4ISWReE3z078D1A2mAcmKVKyT21B83UN/RlUt6P5VkSoG7uZP+9os7/ Vznsajyd5JCrNhlmzw7gS/sXWB3VxFxC+Yfarf+6eKgDUEq9AYKDJPiYvvgsTA/H7wP8 j5DLHDvb3p2vXvDmqS7SRszxOuPl5ySHJbqIR3o+b6CpbF8G/Uac0E6h1Bh0YOLUQTdW jPAg== 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=TSmfF+CA1IiHYXSmD/aQdQavaC4R2I7+RHsvjvZT4Kw=; b=zdLKKTSBIoXHvLcqp0fPdzRV04PGL62sihac1XY7yPWOtyosHRZ+kxmu4W0weRsQKF hDZM8fheNHuebuadaC3ETDzq4zuMjVAFw/3MwuHC2lJaz47mATnLR+fCWlfHCpFlE3wt UUc/s5TrDu21wdK1Jzfj+tEnsL1fipulhUudkrpvqYWwEoBV2xPyLr88jJY3V0a4o2ZL /GXBLxWCsgHy+uCoCfZbfY/Do07YsyRvibNEZ5si14Xgt776LjglfPVF8hzyH1KfsFlz 2q1D2mLjjxKW78T1Xad54DYiY45CjfBJG5UNOhOHNywmOhePtxE856g2wHMX1OIGFya0 Jz5w== 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 h33si7917601plh.228.2018.11.28.07.19.17; Wed, 28 Nov 2018 07:19:42 -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 S1728387AbeK2CUk (ORCPT + 99 others); Wed, 28 Nov 2018 21:20:40 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:33182 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727789AbeK2CUk (ORCPT ); Wed, 28 Nov 2018 21:20:40 -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 wASFBk6x011690; Wed, 28 Nov 2018 09:18:37 -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 2ny4x670vf-1; Wed, 28 Nov 2018 09:18:37 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id 2C2DB611E124; Wed, 28 Nov 2018 09:18:37 -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:18:36 +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 wASFIaGV024024; Wed, 28 Nov 2018 15:18:36 GMT Date: Wed, 28 Nov 2018 15:18:36 +0000 From: Charles Keepax To: Linus Walleij CC: Liam Girdwood , Mark Brown , , Bartosz Golaszewski Subject: Re: [PATCH 10/10] regulator: tps65090: Let core handle GPIO descriptors Message-ID: <20181128151836.GU16508@imbe.wolfsonmicro.main> References: <20181128104350.31902-1-linus.walleij@linaro.org> <20181128104350.31902-11-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181128104350.31902-11-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-1811280134 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:50AM +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: 3012e81446d0 ("regulator: tps65090: Pass descriptor instead of GPIO number") > Signed-off-by: Linus Walleij > --- > drivers/regulator/tps65090-regulator.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c > index db714d5edafc..223f6974a9f3 100644 > --- a/drivers/regulator/tps65090-regulator.c > +++ b/drivers/regulator/tps65090-regulator.c > @@ -376,11 +376,11 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data( > gflags = GPIOD_OUT_LOW; > gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE; > > - rpdata->gpiod = devm_gpiod_get_from_of_node(&pdev->dev, > - tps65090_matches[idx].of_node, > - "dcdc-ext-control-gpios", 0, > - gflags, > - "tps65090"); > + rpdata->gpiod = gpiod_get_from_of_node( > + tps65090_matches[idx].of_node, > + "dcdc-ext-control-gpios", 0, > + gflags, > + "tps65090"); > if (IS_ERR(rpdata->gpiod)) > return ERR_CAST(rpdata->gpiod); > if (!rpdata->gpiod) This one needs some handling to avoid leaking the gpio too. Thanks, Charles