Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3648266ybl; Mon, 12 Aug 2019 04:09:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaMLu2QN1ECNKVLXvje5vfGsnPYjlDsrhqOLUqliibJWcBuYHsx1G3K8qI6UmXpONtSGEq X-Received: by 2002:a17:902:44f:: with SMTP id 73mr32830765ple.192.1565608161775; Mon, 12 Aug 2019 04:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565608161; cv=none; d=google.com; s=arc-20160816; b=xoJJiepkOV8l41OqfcIi/EilFvQTxSxAT7LERdFSV5Gmlw0TcKxca2CGrXm5QzFyLy TVdujWaV4Q1nFy0QV6PgeVdI75doqGVuj92l0pd6WMknL5BXxgf/n3L2N6RmhlZKpMgS h9S6uyiseAar2j4H9bTOYrMQsd5wkIrE7akXWT/v5MyYzijqzpm0/u+9P7brs4t4wSUl c2x0MfuJsc1peWPCBW8alopsAfMl5fvwSef/SpWwtNXwbDvc2z284iXlKcJH8spSRqEo jRyfmzajy3UesiP61HNKoOEQZjAJWKkFxkqOUtQzOzd/xFKE2AICW7V61JfEna+I4b7a 2c5Q== 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:dkim-signature; bh=DXHfdczzz0Ngw+McQkfe+Do33h0S24f/hNtYp5Nr2Ho=; b=hFGvFnPGOXwDSepzqNTB23dtAvMS4hY0K1gEF4ZNjzO4lLkIUXO99Llgs4WPBOarC3 XObEqyIveg/3IWyOTMstPhRLr94Rxtpf06RDdcCAVn3ZHP6Q5iQnf7e5PxjWHiqaLJko 4nhHa/GbtxbAIpbEU1qDeAj/Vl7IuWSBJowhgy1of8eGMhZXnQv2lcbk9262eAMXUpFw ZN2iG+nruYu1Gl0glFYnqmItZCSC3z5N3MK8nrpj6rqZIbRyKrvEaRo6YIaDmJN3fhmB WRqTJVeST895HU6OaQ9I1m+OiTWyLSzGlXXf/Whfo8+CRAMMc2+WOXWDkJuNfy4VMDMj wbiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="Nv/NKn/6"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si32467827pgs.322.2019.08.12.04.09.06; Mon, 12 Aug 2019 04:09:21 -0700 (PDT) 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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="Nv/NKn/6"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbfHLLHW (ORCPT + 99 others); Mon, 12 Aug 2019 07:07:22 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:59360 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728054AbfHLLHV (ORCPT ); Mon, 12 Aug 2019 07:07:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DXHfdczzz0Ngw+McQkfe+Do33h0S24f/hNtYp5Nr2Ho=; b=Nv/NKn/6zoFeAuQr5jGDYm312 L3o64lDHq5rXTY9MV7JA5VtpYsL8fr05Wfrn9h7MmUF6suls3UKo6FDBD8e+1PQjx+2gel/b08krO kh1l8qJWFLludx1SAcIG5KPn7JBt0amMVaydDs8uAcJZrT5/KvkWN2i3XOxdi39eSg0Dw=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hx8Aa-000123-8B; Mon, 12 Aug 2019 11:07:20 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 594B927430B7; Mon, 12 Aug 2019 12:07:19 +0100 (BST) Date: Mon, 12 Aug 2019 12:07:19 +0100 From: Mark Brown To: Chuhong Yuan Cc: Liam Girdwood , LKML Subject: Re: [PATCH] regulator: core: Add devres versions of regulator_enable/disable Message-ID: <20190812110719.GE4592@sirena.co.uk> References: <20190809030352.8387-1-hslester96@gmail.com> <20190809151114.GD3963@sirena.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sfyO1m2EN8ZOtJL6" Content-Disposition: inline In-Reply-To: X-Cookie: Decaffeinated coffee? Just Say No. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sfyO1m2EN8ZOtJL6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 10, 2019 at 09:44:45AM +0800, Chuhong Yuan wrote: > On Fri, Aug 9, 2019 at 11:11 PM Mark Brown wrote: > > I'm not super keen on managed versions of these functions since they're > > very likely to cause reference counting issues between the probe/remove > > path and the suspend/resume path which aren't obvious from the code, I'm > > especially worried about double frees on release. > I find that 29 of 31 cases I found call regulator_disable() only when encounter > probe failure or in .remove. > So I think the devm versions of regulator_enable/disable() will not cause big > problems. There's way more drivers using regulators than that... > I even found a driver to forget to disable regulator when encounter > probe failure, > which is drivers/iio/adc/ti-adc128s052.c. > And a devm version of regulator_enable() can prevent such mistakes. Yes, it's useful for that. --sfyO1m2EN8ZOtJL6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1RSGYACgkQJNaLcl1U h9BI5Qf+MjbM11UyOu1uRb8i9kBtXAhB3Nf++MDh5wUhKYEmZa3Jd9HPcfiSl1BI bG2CUtD8eHAktpenvf2YudwZ18GYuTA09RaauWbEu07aB3uUAzRykh9Af6yPj8wH tt3tn97PeEaYb5DaiJYQtbMyUALv2k0cWxrnXWIJvG9tClfuy4VWTKeEOfw0t09N pzsFWUE980VeemegI4ceyMYVQ7/aUxmsdvSFnQF0v5+qzeMH0Io1M9IU2YBUhvqz WuCdRXW81YoO+rhwbBguczlriy6cCN27ilwM+tpX9eilBYdhfFkUHIjptjYW1P01 Jh1z5hndyvZrMvpMpM8iJam8nXgBEQ== =SvNi -----END PGP SIGNATURE----- --sfyO1m2EN8ZOtJL6--