Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2872384imu; Fri, 23 Nov 2018 16:27:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VG1oMgC3efbYxMCKWsAqjm7ECopG+HQL0U2qwLAR3Nlpd/iFTdiKzFnEzheluUoiVXEmNl X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr17833855plb.238.1543019238908; Fri, 23 Nov 2018 16:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543019238; cv=none; d=google.com; s=arc-20160816; b=qMajtbrM3H+xO66XMLqMAC48IaEhcAzcNhyQsnpiIU82cpNICdpv97TxaY+evkOHfn oUjBc4uJgmBz4IqaKTEGauxFii4ZdDT24FtupGc90zdMG7Qm4kJliAlofQfk94BfKuDy ZR8WbYZRStboCR36GhJ+XORpf87CO+gbDAbH1dMTX1zZJBzdb6DLN5Dij+jH4LpCM1qo t2K4X0gy29MgdLW8BNcAeWIXy1wyrqJeuEn/8HoU2oCL+c3YiwLiu5GwKZeM5zA69y3Q pjYSNGWoQcKeUd5rUwLM1n4q75hbYNOIUp69avALwAPTEvTLEwqatEp5JfqvzQeBOnqJ R9LA== 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=Ty6xzGtClUOXO0cCX1e1VMQ/MHg88JzkJ6fl3Fiw8JI=; b=UvX471D4qlPMuAyCiYb1Ub0CBqXA5Kpjk5mweO95ZEtU7W+RseMm0X1DsuE7olHm5D pvJ3wMW/8jPxa/n2NrRm2i1v6pURKLD1ZPJa+Ib/X7DyzuOB1HfXdt5MVDd560UPVw04 uf5z29aMuku8Ew0m8MzpynPhyUIHM7yxN2hb2OJUM2y7MpesRJajne18qxuE69CcEGoI oxCBNaWMOyGVEImY1Siuer9J65bfQ4tjEfX2iVPb90KEBG1fzsW1ODDSPWn0jXr2kSJ0 Xf/XE2ufYSc3mmnumjj+DHI3RDaJQgxbmjJnQm0mJRVS4LkFAh2kdTOatDuTdAjwIECo oRcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NPosrY4G; 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 a2si41829874pgd.461.2018.11.23.16.27.04; Fri, 23 Nov 2018 16:27: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; dkim=pass header.i=@linaro.org header.s=google header.b=NPosrY4G; 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 S2405874AbeKWC12 (ORCPT + 99 others); Thu, 22 Nov 2018 21:27:28 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33723 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728825AbeKWC12 (ORCPT ); Thu, 22 Nov 2018 21:27:28 -0500 Received: by mail-lf1-f66.google.com with SMTP id i26so6834089lfc.0 for ; Thu, 22 Nov 2018 07:47:32 -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=Ty6xzGtClUOXO0cCX1e1VMQ/MHg88JzkJ6fl3Fiw8JI=; b=NPosrY4Gc9FpZiaaXPGluswgQCo7Wh+JncB7rbjhPkmN3WOlO54uFW6bE7+o9z4qPl 0KivetmRjdWD4fJRq4uCGaukrzkvL2qUdlIL2YxzW9SxI9lJrGZOeN41lWL0XsYP/JpF r5GTRjbMrF8/ug+LxklPbetn10m2UUvnfaFRU= 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=Ty6xzGtClUOXO0cCX1e1VMQ/MHg88JzkJ6fl3Fiw8JI=; b=jXndIalPn4m7fzd0Kx0fBMBvvFwJglD09jfym3DnR/6FTxkPpuup7foCa2D8VvaC0Y 8dKd9FbmJ6wd8IZRHt7fWyuTmz+Dj4kP/Lnk7+iHMsUlpL+OmBN3hLd+qWPBKYtUkSRS KI5dE3+LZ6oU+Hq7k/oGRAOgSeeof4TB9NkjydpRIBPPZegEGc/fvAC7lo8nhlWerSVs WWe4ekv13/0njGXu84uiSa/lvSnteDRHiqIV6AzQZCrOaiV2Cl13vMNwfuOXotWoTEfT BF4jnIKqQFZQqg36zAtbgd+Jl+W8ZnlLK7Db1GKr4SXr3NhlRkw/PZbQS9FA/KEl7KqK VMfQ== X-Gm-Message-State: AGRZ1gKyFKFFbvfaY5G4Pv1IxbCtpKzIFJuCTevDMEnNvBN4y/gucVwN GaLO3c7+b9S+joxAr8xkJ4/EDa4u1ibcpUGmn3zmUw== X-Received: by 2002:a19:5154:: with SMTP id f81mr7293403lfb.96.1542901652035; Thu, 22 Nov 2018 07:47:32 -0800 (PST) MIME-Version: 1.0 References: <20181121101316.32194-1-ckeepax@opensource.cirrus.com> In-Reply-To: From: Linus Walleij Date: Thu, 22 Nov 2018 16:47:20 +0100 Message-ID: Subject: Re: [PATCH v2] regulator: wm8994: Don't use devres for enable GPIOs To: Charles Keepax Cc: Mark Brown , Liam Girdwood , Marek Szyprowski , "linux-kernel@vger.kernel.org" , patches@opensource.cirrus.com 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 Thu, Nov 22, 2018 at 3:19 PM Linus Walleij wrote: > On Wed, Nov 21, 2018 at 11:13 AM Charles Keepax > wrote: > > > The regulator core takes over managing the lifetime of the enable GPIO > > once the regulator is registered. As such we shouldn't register the > > enable GPIO using devm, or it will be freed twice. > > > > Reported-by: Marek Szyprowski > > Signed-off-by: Charles Keepax > > Reviewed-by: Linus Walleij Oh no this is not the right solution I think. All drivers passing a descriptor (config->ena_gpiod) do their own refcounting, including some using a function that has no non-devm* counterpart. It is better if we teach the core to not gpiod_put() those. The other patch series I am floating to get rid of the legacy GPIO handling from the core will do away with all the legacy GPIO handling anyway, so let me introduce a bit of ugliness (that can be backported) and then delete that ugliness with an updated series v8 of my legacy GPIO cleanup. Sorry for the inconvenience. Will send a patch soon. Yours, Linus Walleij