From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AB94C00140 for ; Wed, 10 Aug 2022 11:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231705AbiHJL5B (ORCPT ); Wed, 10 Aug 2022 07:57:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbiHJL5A (ORCPT ); Wed, 10 Aug 2022 07:57:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C947B82F85 for ; Wed, 10 Aug 2022 04:56:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 658166131B for ; Wed, 10 Aug 2022 11:56:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC2D1C433D6; Wed, 10 Aug 2022 11:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660132618; bh=Q+3zp31hm5us8Ragge3GmJnAbYvcTWom+L06uIt81xQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CFSziIEZLnm/D4Tz79y/kG179fXxpyvPav5hm9gB6eWoKJKdJdLLTYv/w0+4BFYNy hHYXwir5DsgYL3iC1GiYC2lqXJYhpII6MB7P/Z63tjrjff7NjL0ZHkiWu72H/blkDL WJX7Wr6sB1wqGW9hPuXd97MzDSBVMF8YT5pwCfCZUBu02d7L5VkuDngOxATZhNBXzv TM033L5y0ii7BzCcOLeL/5WQxDgbETvAWBDpmoN1R4B4mOvzINr5qLa9htLR6vUV85 apIR40tm1f/7UEOXMnZSsbkZmwNHcA1eBLYc1oAD+ow70T1ipP0LITBpneIcgJ/aHV nWIAf0ZrUtsHg== Date: Wed, 10 Aug 2022 12:56:54 +0100 From: Mark Brown To: Matti Vaittinen Cc: matti.vaittinen@fi.rohmeurope.com, Liam Girdwood , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/7] regulator: Add devm helpers for get and enable Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VEGw3rzY/Fe5v0a/" Content-Disposition: inline In-Reply-To: X-Cookie: First pull up, then pull down. Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VEGw3rzY/Fe5v0a/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 10, 2022 at 02:29:55PM +0300, Matti Vaittinen wrote: > A few regulator consumer drivers seem to be just getting a regulator, > enabling it and registering a devm-action to disable the regulator at > the driver detach and then forget about it. >=20 > We can simplify this a bit by adding a devm-helper for this pattern. > Add devm_regulator_get_enable() and devm_regulator_get_enable_optional() I'm really not keen on the idea of a devm managed enable, it's too prone to bugs when someone gets round to implementing runtime PM. --VEGw3rzY/Fe5v0a/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmLznQUACgkQJNaLcl1U h9AIzAf/X+NMPhyskNdOzwuTnf5JL6aMQ/zaJRQZrPj3HWbXUBsD0zo97kgordwT xkKmtSRvixezeA+CvEOIQcJTc4myiLxOqbNWgpIw2D6bDv5ZzFD18c2GB7MsOf7Z VKmzH4HK130qf5qvo5FrxC5EIRebiP7q4V49x8wqqVkLxhQdQLJlKZ7ZW5mNS3oE jwIoux8+lnmNOOEiQQ+GlC7YhhxDcsh/5JcVE/5b+qMnKW12a3coAmiq+hEHoI9/ A78vuODzf9JCgfiSC/4d/ZKIDs+pQsCsMSXRKjisGY2pN9AE6va2pRQeCLprtHqv FqlouA068TRQb0FlIu7vPYJ4YAuETg== =7Hrc -----END PGP SIGNATURE----- --VEGw3rzY/Fe5v0a/--