Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3460719rwb; Sun, 9 Oct 2022 05:37:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FxLgBqxt+IspWrzoZHKAK87m0gcDmoELwKvloVS7lI21X1AevMJz0RAacWcnLpK/wgkK1 X-Received: by 2002:a63:fd4f:0:b0:45f:d7ef:9f94 with SMTP id m15-20020a63fd4f000000b0045fd7ef9f94mr7821519pgj.137.1665319052447; Sun, 09 Oct 2022 05:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665319052; cv=none; d=google.com; s=arc-20160816; b=VUnfoIhbMJguK0uKTokaUwoNm46spWC4zxg2jcIFeUYMSrTQPUf8HQXe/xpNRug9ED DncmnWtcHtugz82zS4LbG+fzymXQ/WYk7npZH4fY5p9OfBiWjXcmo0/UhNEqOmeKi4mb S0aflGvUKufY4YhdTcXvZoxDzzbQDDWlQD7HqyBZm80EEsaXd9/U2ozMXqUZ++RNHaPg R/QukDCc+KI5i4XDDhMK15U+5ms5PsHBHs17itWyE69LoblGmGYJNONtqjfZBgi4KFuE mNz/tPOeyWwcfJ21QEjkvTn6bDC0qtyRMM3H84wqJERLGFBW0RVfylzhWmtrQRe0q3YZ QyJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=aT5+SAbOwxvlOHDXrCNYREvb7cAhoasrbhzUld5it7U=; b=DO6DooT9ltWB55EYh+oVHG+l0T7lHH42Z8LnZmmwS0D5aflVQxx2d35n+ZAFx1KtFf i9tDH8gKk7HThJw9MogTGM/Di4/MQLdNzQCBhnrELf/11904QUdtSFUHgkdSBEkM88ow DWXsYmiqIb7TrydoYkpLGiXd425n7SjMZufJYLdzGYTUmbawSVbgcFQq0sGlTwRDJUi/ 1xNkb1XgbKlRsFaiJO0lbpWIju0n76QNV3CSZMsG5484wHcBKb+n6ej3VTPQ/SRJOfPg 7gWZhfKlJd2z2dG4ek2XHFk6kmEXtljs8Y0yTHZnDYN6sxSO0YYYJ02YUt43GUQbJwKq 8VdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ua9DhOLc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020aa78c08000000b0053e29668420si7741457pfd.94.2022.10.09.05.37.20; Sun, 09 Oct 2022 05:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ua9DhOLc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbiJIMYF (ORCPT + 99 others); Sun, 9 Oct 2022 08:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJIMYE (ORCPT ); Sun, 9 Oct 2022 08:24:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5982329CBE; Sun, 9 Oct 2022 05:24:03 -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 ams.source.kernel.org (Postfix) with ESMTPS id 06FEDB80D29; Sun, 9 Oct 2022 12:24:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEAE4C433D6; Sun, 9 Oct 2022 12:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665318240; bh=iogJFBqB7jc4F+XVnYjM6BUUDezLjY2DcrEm4bPESgg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ua9DhOLcJzbvLzby5YSvCSqfL3MzYlHsOag8txGEtxnvsuaE/cFFo4TYbxm3FbOSp PltcyLFijYDak5JsCmvxU9vespl9363ua73fZ0Gfke1arbk6VESCZqy2jpwlxaoQxa 6+NvinTaTrx3Ot1WC2HmXxOiM6YwC9Jm7K6qpCIdUx2+qsM/qitxD2t+dbmC0XtRbv iVVxJs2VsI4wx6Fht0+DVdy8uSuu5pTQiPT29L9jK4viLDdPJbLqJfkVVXP2K5E8PW /nruWSBr4oSKyzyTY3xR3RmQEFT4NFb/wfSj+uihRtVOhvXQ5FZ3y1t/fu8J0d6+40 so2RVUM8dTMtQ== Date: Sun, 9 Oct 2022 13:24:21 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Matti Vaittinen , Matti Vaittinen , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Jagath Jog J , Nikita Yushchenko , Cosmin Tanislav , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 1/5] regulator: Add devm helpers for get and enable Message-ID: <20221009132421.6e472385@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Oct 2022 19:17:39 +0300 Andy Shevchenko wrote: > On Thu, Oct 06, 2022 at 05:36:52PM +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. > > > > 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() > > ... > > > (cherry picked from commit b6058e052b842a19c8bb639798d8692cd0e7589f) > > Not sure: > - why this is in the commit message > - what it points to, since > $ git show b6058e052b842a19c8bb639798d8692cd0e7589f > fatal: bad object b6058e052b842a19c8bb639798d8692cd0e7589f These are now upstream in Linus' tree and in my testing branch. I'd not normally advocate working on top of that (because I rebase it), but if it is useful for this series go ahead. Jonathan > > > Already in Mark's regulator tree. Not to be merged. Included just for > > the sake of the completeness. Will be dropped when series is rebased on > > top of the 6.1-rc1 > > Ah, I see, but does it mean the commit has been rebased or you used wrong SHA? > > ... > > > +static void regulator_action_disable(void *d) > > +{ > > + struct regulator *r = (struct regulator *)d; > > Cast is not needed. > > > + regulator_disable(r); > > +} >