Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp436211ybl; Fri, 9 Aug 2019 08:12:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxncO9WkRWl8zj++CJXQz9p1ZsBFqCXmdACJ/VkM2OGdgSBmhtzEAUo8WYtwU7u1pP+Vc4V X-Received: by 2002:a17:902:bd06:: with SMTP id p6mr19899164pls.189.1565363573901; Fri, 09 Aug 2019 08:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565363573; cv=none; d=google.com; s=arc-20160816; b=ULYUv5ra93DvcSOqUoI5qxyc3/KIhPxgHl3o5Y2P0i+l4H1pe5z3DQkHY2EuDDqOwv N0v1OexOeEy/jDdGfAfo01hxH7Etxj3ahCoemmiR96k1n/6Bw8dyCY5E6/D6azHNP4lC uYOJPp+R3armDjHUY2NK57aBX+j6vPDMVPBJBx+FbkwD1hLWEfunV8ifZDuHqEDJcBpy dIQmn8btZqlnT6V5NsyXB7XYFhaQjXLuw4ceH2eOp6gHTsRzJGvoh108qaP08dpsPnAq qp+eY3OkL9BZNPxRkkwvC55oNIdEKpxIj0bsU36dfDHWngcGxYqPpqvFy+M0bZGyeA78 ON6A== 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=bIWTiMeUYnykHbNSF5Kxw8W8GsoGR8QuHVL9Nk+APwg=; b=Qd4EysjrgkLHGEFUO9MPbpDG6pA4gVdZYzMxs4YdFV4D6zwxDcGNyYrhfkixGJo/kL 5ZffQEDvivL5PuynZE+abaa6N+lBCNkCUeBB/Xgh/EX8AoMHK/RxFPrAvArDYEI02lcd 1Gw5tgIvmSS2Lm/j1PwQRxy6G1HCfrL8YiHlmxDr6WS3jAvhcp9Qh29WVcOexcCmAjhu qyho3gA4b3JypBU2nDVv10laGc0SFPmvGx2Ahl5A2CEyrmzMZrvHx6WmeSZE8e5mMYbI oCXFKAaGMUeO4DwRIolwmwq1CgjbYhedZZ7vyIwM2umiNMYdZFVEGwDVqPOF7yra3UYg 0lOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Nb6IUUPz; 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 c1si53446642pgw.444.2019.08.09.08.12.36; Fri, 09 Aug 2019 08:12:53 -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=Nb6IUUPz; 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 S2407300AbfHIPLR (ORCPT + 99 others); Fri, 9 Aug 2019 11:11:17 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:44714 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406652AbfHIPLR (ORCPT ); Fri, 9 Aug 2019 11:11:17 -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=bIWTiMeUYnykHbNSF5Kxw8W8GsoGR8QuHVL9Nk+APwg=; b=Nb6IUUPzreGh345jUNoeNq8t0 x4P7mzEyDG38v3zf2mB54dr8H9WxJs6O/sFjo4gRRpTpBmurxXEJwip0N/itBwRwfQPzu1G+CVFPN 9lOimj0YunFhOgMZ6nTBwUmYNR0xfUQwelJ7xcS9eApRd7eOlFGURxleBwN76VsSLamt8=; Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hw6Xz-0006Ki-G6; Fri, 09 Aug 2019 15:11:15 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 37F48274303D; Fri, 9 Aug 2019 16:11:14 +0100 (BST) Date: Fri, 9 Aug 2019 16:11:14 +0100 From: Mark Brown To: Chuhong Yuan Cc: Liam Girdwood , linux-kernel@vger.kernel.org Subject: Re: [PATCH] regulator: core: Add devres versions of regulator_enable/disable Message-ID: <20190809151114.GD3963@sirena.co.uk> References: <20190809030352.8387-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+KJYzRxRHjYqLGl5" Content-Disposition: inline In-Reply-To: <20190809030352.8387-1-hslester96@gmail.com> X-Cookie: Klatu barada nikto. 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 --+KJYzRxRHjYqLGl5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 09, 2019 at 11:03:52AM +0800, Chuhong Yuan wrote: > I wrote a coccinelle script to detect possible chances > of utilizing devm_() APIs to simplify the driver. > The script found 147 drivers in total and 22 of them > have be patched. > Within the 125 left ones, at least 31 of them (24.8%) > are hindered from benefiting from devm_() APIs because > of lack of a devres version of regulator_enable(). 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. --+KJYzRxRHjYqLGl5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1NjREACgkQJNaLcl1U h9BTwQf/eqfid6pFWWsC2XkcNrM+hxfvfGZELEmM6UU6BNiNRv5wbAWCDwfoW5ol 6NsV3LufKaBWz9ETFQGoDzXaUP6Vzfz+qz6/kcnRBT4CCt169NopcB4+92kPhO4s lHlHczBN26rx9pQoEJNSYwXdNrhqgcjywUtWX4sTw2yzP+QSxMUcYIlGYkrh8LBl laGfWsPWJJJxwcLqtP/iEVS1iBb5BJ9dvyfnWxpSLscg7QDxGQwgB/yiwTHE6lUY C9ivrG/b0VUj4q8rY3kcRJZgRqNhLWYK0LtBJVvRPpulgeE66c1vtQ3IgTyAAlia hd4LtLSWpAZ7r2s0Qe0jH2ol73qHmQ== =HCBh -----END PGP SIGNATURE----- --+KJYzRxRHjYqLGl5--